@zohodesk/components 1.2.30 → 1.2.32
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/propValidation_report.html +1 -1
- package/README.md +10 -0
- package/es/DateTime/DateTime.js +7 -2
- package/es/DateTime/DateWidget.js +27 -5
- package/es/DateTime/Time.js +25 -10
- package/es/DateTime/props/defaultProps.js +4 -2
- package/es/DateTime/props/propTypes.js +7 -3
- package/es/Select/GroupSelect.js +11 -6
- package/es/Select/Select.js +0 -1
- package/es/Select/props/defaultProps.js +1 -0
- package/es/v1/DateTime/DateTime.js +7 -2
- package/es/v1/DateTime/DateWidget.js +27 -5
- package/es/v1/DateTime/Time.js +25 -10
- package/es/v1/DateTime/props/propTypes.js +7 -3
- package/es/v1/Select/GroupSelect.js +11 -6
- package/es/v1/Select/Select.js +0 -1
- package/es/v1/Select/props/defaultProps.js +1 -0
- package/lib/DateTime/DateTime.js +7 -2
- package/lib/DateTime/DateWidget.js +127 -103
- package/lib/DateTime/Time.js +29 -13
- package/lib/DateTime/props/defaultProps.js +4 -2
- package/lib/DateTime/props/propTypes.js +7 -3
- package/lib/Select/GroupSelect.js +11 -6
- package/lib/Select/Select.js +0 -2
- package/lib/Select/props/defaultProps.js +1 -0
- package/lib/v1/DateTime/DateTime.js +7 -2
- package/lib/v1/DateTime/DateWidget.js +129 -105
- package/lib/v1/DateTime/Time.js +29 -13
- package/lib/v1/DateTime/props/propTypes.js +7 -3
- package/lib/v1/Select/GroupSelect.js +11 -6
- package/lib/v1/Select/Select.js +0 -2
- package/lib/v1/Select/props/defaultProps.js +1 -0
- package/package.json +3 -3
- package/result.json +1 -1
|
@@ -129,7 +129,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
129
129
|
_createClass(DateWidgetComponent, [{
|
|
130
130
|
key: "componentDidMount",
|
|
131
131
|
value: function componentDidMount() {
|
|
132
|
-
var
|
|
132
|
+
var _this$props = this.props,
|
|
133
|
+
validation = _this$props.validation,
|
|
134
|
+
getPopupProps = _this$props.getPopupProps,
|
|
135
|
+
isPopupReady = _this$props.isPopupReady;
|
|
133
136
|
var selected = this.state.selected;
|
|
134
137
|
|
|
135
138
|
if (validation && validation.validate) {
|
|
@@ -145,6 +148,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
145
148
|
selected: newSelected
|
|
146
149
|
});
|
|
147
150
|
this.handleSelectionRangeDetails(this.props);
|
|
151
|
+
|
|
152
|
+
if (getPopupProps) {
|
|
153
|
+
getPopupProps({
|
|
154
|
+
isPopupReady: isPopupReady
|
|
155
|
+
});
|
|
156
|
+
}
|
|
148
157
|
}
|
|
149
158
|
}, {
|
|
150
159
|
key: "componentDidUpdate",
|
|
@@ -160,14 +169,15 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
160
169
|
isDateEdited = _this$state.isDateEdited,
|
|
161
170
|
stateFocusOrder = _this$state.stateFocusOrder,
|
|
162
171
|
isFocused = _this$state.isFocused;
|
|
163
|
-
var _this$
|
|
164
|
-
value = _this$
|
|
165
|
-
validation = _this$
|
|
166
|
-
isPopupReady = _this$
|
|
167
|
-
_this$
|
|
168
|
-
dateFormat = _this$
|
|
169
|
-
is24Hour = _this$
|
|
170
|
-
isHideCurrentYear = _this$
|
|
172
|
+
var _this$props2 = this.props,
|
|
173
|
+
value = _this$props2.value,
|
|
174
|
+
validation = _this$props2.validation,
|
|
175
|
+
isPopupReady = _this$props2.isPopupReady,
|
|
176
|
+
_this$props2$dateForm = _this$props2.dateFormat,
|
|
177
|
+
dateFormat = _this$props2$dateForm === void 0 ? '' : _this$props2$dateForm,
|
|
178
|
+
is24Hour = _this$props2.is24Hour,
|
|
179
|
+
isHideCurrentYear = _this$props2.isHideCurrentYear,
|
|
180
|
+
getPopupProps = _this$props2.getPopupProps;
|
|
171
181
|
|
|
172
182
|
if (validation && validation.validate) {
|
|
173
183
|
this.validateOnSelect(selected, this.props);
|
|
@@ -201,6 +211,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
201
211
|
if (isPopupReady) {
|
|
202
212
|
this.resetLocalDate && this.resetLocalDate();
|
|
203
213
|
}
|
|
214
|
+
|
|
215
|
+
if (getPopupProps) {
|
|
216
|
+
getPopupProps({
|
|
217
|
+
isPopupReady: isPopupReady
|
|
218
|
+
});
|
|
219
|
+
}
|
|
204
220
|
}
|
|
205
221
|
|
|
206
222
|
var haveLocalValue = [day, month, year, hour, minute, noon].some(function (value) {
|
|
@@ -229,11 +245,11 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
229
245
|
}, {
|
|
230
246
|
key: "handleSelect",
|
|
231
247
|
value: function handleSelect(userZoneSelectedTime, fotmattedValue, e) {
|
|
232
|
-
var _this$
|
|
233
|
-
id = _this$
|
|
234
|
-
onSelect = _this$
|
|
235
|
-
closePopupOnly = _this$
|
|
236
|
-
validation = _this$
|
|
248
|
+
var _this$props3 = this.props,
|
|
249
|
+
id = _this$props3.id,
|
|
250
|
+
onSelect = _this$props3.onSelect,
|
|
251
|
+
closePopupOnly = _this$props3.closePopupOnly,
|
|
252
|
+
validation = _this$props3.validation;
|
|
237
253
|
|
|
238
254
|
if (validation && validation.validateOn) {
|
|
239
255
|
var selected = this.state.selected;
|
|
@@ -275,12 +291,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
275
291
|
}, {
|
|
276
292
|
key: "handleTogglePopup",
|
|
277
293
|
value: function handleTogglePopup(e, isOpenOnly) {
|
|
278
|
-
var _this$
|
|
279
|
-
togglePopup = _this$
|
|
280
|
-
_this$
|
|
281
|
-
defaultPosition = _this$
|
|
282
|
-
isPopupOpen = _this$
|
|
283
|
-
removeClose = _this$
|
|
294
|
+
var _this$props4 = this.props,
|
|
295
|
+
togglePopup = _this$props4.togglePopup,
|
|
296
|
+
_this$props4$defaultP = _this$props4.defaultPosition,
|
|
297
|
+
defaultPosition = _this$props4$defaultP === void 0 ? 'bottom' : _this$props4$defaultP,
|
|
298
|
+
isPopupOpen = _this$props4.isPopupOpen,
|
|
299
|
+
removeClose = _this$props4.removeClose;
|
|
284
300
|
|
|
285
301
|
if (isOpenOnly) {
|
|
286
302
|
if (!isPopupOpen) {
|
|
@@ -374,12 +390,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
374
390
|
key: "handleKeyDown",
|
|
375
391
|
value: function handleKeyDown(e) {
|
|
376
392
|
var keyCode = e.keyCode;
|
|
377
|
-
var _this$
|
|
378
|
-
isPopupOpen = _this$
|
|
379
|
-
isPopupOpenOnEnter = _this$
|
|
380
|
-
onKeyDown = _this$
|
|
381
|
-
closePopupOnly = _this$
|
|
382
|
-
cantEditOnPopupOpen = _this$
|
|
393
|
+
var _this$props5 = this.props,
|
|
394
|
+
isPopupOpen = _this$props5.isPopupOpen,
|
|
395
|
+
isPopupOpenOnEnter = _this$props5.isPopupOpenOnEnter,
|
|
396
|
+
onKeyDown = _this$props5.onKeyDown,
|
|
397
|
+
closePopupOnly = _this$props5.closePopupOnly,
|
|
398
|
+
cantEditOnPopupOpen = _this$props5.cantEditOnPopupOpen;
|
|
383
399
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
384
400
|
|
|
385
401
|
if (isPopupOpen) {
|
|
@@ -481,19 +497,19 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
481
497
|
e.preventDefault();
|
|
482
498
|
}
|
|
483
499
|
|
|
484
|
-
var _this$
|
|
485
|
-
isDateTime = _this$
|
|
486
|
-
timeZone = _this$
|
|
487
|
-
value = _this$
|
|
488
|
-
onSelect = _this$
|
|
489
|
-
id = _this$
|
|
490
|
-
min = _this$
|
|
491
|
-
max = _this$
|
|
492
|
-
minErrorText = _this$
|
|
493
|
-
maxErrorText = _this$
|
|
494
|
-
onError = _this$
|
|
495
|
-
closePopupOnly = _this$
|
|
496
|
-
is24Hour = _this$
|
|
500
|
+
var _this$props6 = this.props,
|
|
501
|
+
isDateTime = _this$props6.isDateTime,
|
|
502
|
+
timeZone = _this$props6.timeZone,
|
|
503
|
+
value = _this$props6.value,
|
|
504
|
+
onSelect = _this$props6.onSelect,
|
|
505
|
+
id = _this$props6.id,
|
|
506
|
+
min = _this$props6.min,
|
|
507
|
+
max = _this$props6.max,
|
|
508
|
+
minErrorText = _this$props6.minErrorText,
|
|
509
|
+
maxErrorText = _this$props6.maxErrorText,
|
|
510
|
+
onError = _this$props6.onError,
|
|
511
|
+
closePopupOnly = _this$props6.closePopupOnly,
|
|
512
|
+
is24Hour = _this$props6.is24Hour;
|
|
497
513
|
var _this$state3 = this.state,
|
|
498
514
|
dateFormatSelection = _this$state3.dateFormatSelection,
|
|
499
515
|
day = _this$state3.day,
|
|
@@ -780,19 +796,19 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
780
796
|
if (!isAllowedDateType) {
|
|
781
797
|
this.handleTogglePopup(e);
|
|
782
798
|
} else {
|
|
783
|
-
var _this$
|
|
784
|
-
isPopupOpenOnClick = _this$
|
|
785
|
-
isReadOnly = _this$
|
|
786
|
-
isDisabled = _this$
|
|
799
|
+
var _this$props7 = this.props,
|
|
800
|
+
isPopupOpenOnClick = _this$props7.isPopupOpenOnClick,
|
|
801
|
+
isReadOnly = _this$props7.isReadOnly,
|
|
802
|
+
isDisabled = _this$props7.isDisabled;
|
|
787
803
|
|
|
788
804
|
if (isPopupOpenOnClick && (!isReadOnly || !isDisabled)) {
|
|
789
805
|
this.handleTogglePopup(e, true);
|
|
790
806
|
}
|
|
791
807
|
|
|
792
|
-
var _this$
|
|
793
|
-
isPopupCloseOnClick = _this$
|
|
794
|
-
isPopupOpen = _this$
|
|
795
|
-
closePopupOnly = _this$
|
|
808
|
+
var _this$props8 = this.props,
|
|
809
|
+
isPopupCloseOnClick = _this$props8.isPopupCloseOnClick,
|
|
810
|
+
isPopupOpen = _this$props8.isPopupOpen,
|
|
811
|
+
closePopupOnly = _this$props8.closePopupOnly;
|
|
796
812
|
|
|
797
813
|
if (isPopupCloseOnClick && !isPopupOpen) {
|
|
798
814
|
closePopupOnly && closePopupOnly(e);
|
|
@@ -820,12 +836,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
820
836
|
isDateEdited = _this$state4.isDateEdited,
|
|
821
837
|
isFocused = _this$state4.isFocused,
|
|
822
838
|
selected = _this$state4.selected;
|
|
823
|
-
var _this$
|
|
824
|
-
isDateTime = _this$
|
|
825
|
-
is24Hour = _this$
|
|
826
|
-
isPopupReady = _this$
|
|
827
|
-
timeZone = _this$
|
|
828
|
-
isPopupOpen = _this$
|
|
839
|
+
var _this$props9 = this.props,
|
|
840
|
+
isDateTime = _this$props9.isDateTime,
|
|
841
|
+
is24Hour = _this$props9.is24Hour,
|
|
842
|
+
isPopupReady = _this$props9.isPopupReady,
|
|
843
|
+
timeZone = _this$props9.timeZone,
|
|
844
|
+
isPopupOpen = _this$props9.isPopupOpen;
|
|
829
845
|
|
|
830
846
|
if (isDateEdited || isFocused || isPopupReady || isPopupOpen) {
|
|
831
847
|
var _getDateDetails2 = (0, _dateFormat.getDateDetails)(selected, {
|
|
@@ -875,10 +891,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
875
891
|
}, {
|
|
876
892
|
key: "handleGetAllowedType",
|
|
877
893
|
value: function handleGetAllowedType() {
|
|
878
|
-
var _this$
|
|
879
|
-
isReadOnly = _this$
|
|
880
|
-
isDisabled = _this$
|
|
881
|
-
isEditable = _this$
|
|
894
|
+
var _this$props10 = this.props,
|
|
895
|
+
isReadOnly = _this$props10.isReadOnly,
|
|
896
|
+
isDisabled = _this$props10.isDisabled,
|
|
897
|
+
isEditable = _this$props10.isEditable;
|
|
882
898
|
|
|
883
899
|
if (isEditable) {
|
|
884
900
|
if (isReadOnly || isDisabled) {
|
|
@@ -893,10 +909,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
893
909
|
}, {
|
|
894
910
|
key: "handleDateClear",
|
|
895
911
|
value: function handleDateClear() {
|
|
896
|
-
var _this$
|
|
897
|
-
id = _this$
|
|
898
|
-
onSelect = _this$
|
|
899
|
-
value = _this$
|
|
912
|
+
var _this$props11 = this.props,
|
|
913
|
+
id = _this$props11.id,
|
|
914
|
+
onSelect = _this$props11.onSelect,
|
|
915
|
+
value = _this$props11.value;
|
|
900
916
|
this.setState({
|
|
901
917
|
day: '',
|
|
902
918
|
month: '',
|
|
@@ -974,46 +990,52 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
974
990
|
}, {
|
|
975
991
|
key: "render",
|
|
976
992
|
value: function render() {
|
|
977
|
-
var _this$
|
|
978
|
-
removeClose = _this$
|
|
979
|
-
minErrorText = _this$
|
|
980
|
-
maxErrorText = _this$
|
|
981
|
-
min = _this$
|
|
982
|
-
max = _this$
|
|
983
|
-
placeholder = _this$
|
|
984
|
-
isPopupOpen = _this$
|
|
985
|
-
isPopupReady = _this$
|
|
986
|
-
isDateTime = _this$
|
|
987
|
-
position = _this$
|
|
988
|
-
textBoxVariant = _this$
|
|
989
|
-
textBoxSize = _this$
|
|
990
|
-
_this$
|
|
991
|
-
children = _this$
|
|
992
|
-
isDisabled = _this$
|
|
993
|
-
getContainerRef = _this$
|
|
994
|
-
getTargetRef = _this$
|
|
995
|
-
timeZone = _this$
|
|
996
|
-
isReadOnly = _this$
|
|
997
|
-
dataId = _this$
|
|
998
|
-
needResponsive = _this$
|
|
999
|
-
className = _this$
|
|
1000
|
-
needBorder = _this$
|
|
1001
|
-
defaultTime = _this$
|
|
1002
|
-
needDefaultTime = _this$
|
|
1003
|
-
borderColor = _this$
|
|
1004
|
-
i18nKeys = _this$
|
|
1005
|
-
needErrorOnBlur = _this$
|
|
1006
|
-
htmlId = _this$
|
|
1007
|
-
iconOnHover = _this$
|
|
1008
|
-
is24Hour = _this$
|
|
1009
|
-
isAbsolutePositioningNeeded = _this$
|
|
1010
|
-
positionsOffset = _this$
|
|
1011
|
-
targetOffset = _this$
|
|
1012
|
-
isRestrictScroll = _this$
|
|
1013
|
-
dropBoxPortalId = _this$
|
|
1014
|
-
a11y = _this$
|
|
1015
|
-
boxSize = _this$
|
|
1016
|
-
onError = _this$
|
|
993
|
+
var _this$props12 = this.props,
|
|
994
|
+
removeClose = _this$props12.removeClose,
|
|
995
|
+
minErrorText = _this$props12.minErrorText,
|
|
996
|
+
maxErrorText = _this$props12.maxErrorText,
|
|
997
|
+
min = _this$props12.min,
|
|
998
|
+
max = _this$props12.max,
|
|
999
|
+
placeholder = _this$props12.placeholder,
|
|
1000
|
+
isPopupOpen = _this$props12.isPopupOpen,
|
|
1001
|
+
isPopupReady = _this$props12.isPopupReady,
|
|
1002
|
+
isDateTime = _this$props12.isDateTime,
|
|
1003
|
+
position = _this$props12.position,
|
|
1004
|
+
textBoxVariant = _this$props12.textBoxVariant,
|
|
1005
|
+
textBoxSize = _this$props12.textBoxSize,
|
|
1006
|
+
_this$props12$childre = _this$props12.children,
|
|
1007
|
+
children = _this$props12$childre === void 0 ? null : _this$props12$childre,
|
|
1008
|
+
isDisabled = _this$props12.isDisabled,
|
|
1009
|
+
getContainerRef = _this$props12.getContainerRef,
|
|
1010
|
+
getTargetRef = _this$props12.getTargetRef,
|
|
1011
|
+
timeZone = _this$props12.timeZone,
|
|
1012
|
+
isReadOnly = _this$props12.isReadOnly,
|
|
1013
|
+
dataId = _this$props12.dataId,
|
|
1014
|
+
needResponsive = _this$props12.needResponsive,
|
|
1015
|
+
className = _this$props12.className,
|
|
1016
|
+
needBorder = _this$props12.needBorder,
|
|
1017
|
+
defaultTime = _this$props12.defaultTime,
|
|
1018
|
+
needDefaultTime = _this$props12.needDefaultTime,
|
|
1019
|
+
borderColor = _this$props12.borderColor,
|
|
1020
|
+
i18nKeys = _this$props12.i18nKeys,
|
|
1021
|
+
needErrorOnBlur = _this$props12.needErrorOnBlur,
|
|
1022
|
+
htmlId = _this$props12.htmlId,
|
|
1023
|
+
iconOnHover = _this$props12.iconOnHover,
|
|
1024
|
+
is24Hour = _this$props12.is24Hour,
|
|
1025
|
+
isAbsolutePositioningNeeded = _this$props12.isAbsolutePositioningNeeded,
|
|
1026
|
+
positionsOffset = _this$props12.positionsOffset,
|
|
1027
|
+
targetOffset = _this$props12.targetOffset,
|
|
1028
|
+
isRestrictScroll = _this$props12.isRestrictScroll,
|
|
1029
|
+
dropBoxPortalId = _this$props12.dropBoxPortalId,
|
|
1030
|
+
a11y = _this$props12.a11y,
|
|
1031
|
+
boxSize = _this$props12.boxSize,
|
|
1032
|
+
onError = _this$props12.onError,
|
|
1033
|
+
_this$props12$customP = _this$props12.customProps,
|
|
1034
|
+
customProps = _this$props12$customP === void 0 ? {} : _this$props12$customP;
|
|
1035
|
+
var _customProps$DateTime = customProps.DateTimeProps,
|
|
1036
|
+
DateTimeProps = _customProps$DateTime === void 0 ? {} : _customProps$DateTime,
|
|
1037
|
+
_customProps$TextBoxP = customProps.TextBoxProps,
|
|
1038
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP;
|
|
1017
1039
|
var _this$state6 = this.state,
|
|
1018
1040
|
_this$state6$selected = _this$state6.selected,
|
|
1019
1041
|
value = _this$state6$selected === void 0 ? '' : _this$state6$selected,
|
|
@@ -1065,7 +1087,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1065
1087
|
iconOnHover: iconOnHover,
|
|
1066
1088
|
isFocus: isPopupReady,
|
|
1067
1089
|
autoComplete: false,
|
|
1068
|
-
a11y: a11y
|
|
1090
|
+
a11y: a11y,
|
|
1091
|
+
customProps: TextBoxProps
|
|
1069
1092
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1070
1093
|
align: "both",
|
|
1071
1094
|
onClick: isDisabled || isReadOnly ? null : this.handleDateIconClick
|
|
@@ -1102,7 +1125,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1102
1125
|
isRestrictScroll: isRestrictScroll,
|
|
1103
1126
|
dropBoxPortalId: dropBoxPortalId,
|
|
1104
1127
|
boxSize: boxSize,
|
|
1105
|
-
onError: onError
|
|
1128
|
+
onError: onError,
|
|
1129
|
+
customProps: DateTimeProps
|
|
1106
1130
|
}));
|
|
1107
1131
|
}
|
|
1108
1132
|
}]);
|
package/lib/DateTime/Time.js
CHANGED
|
@@ -25,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
+
|
|
28
30
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
31
|
|
|
30
32
|
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); } }
|
|
@@ -74,7 +76,15 @@ var Time = /*#__PURE__*/function (_PureComponent) {
|
|
|
74
76
|
ampmSuggestions = _this$props.ampmSuggestions,
|
|
75
77
|
onAmPmSelect = _this$props.onAmPmSelect,
|
|
76
78
|
amPm = _this$props.amPm,
|
|
77
|
-
is24Hour = _this$props.is24Hour
|
|
79
|
+
is24Hour = _this$props.is24Hour,
|
|
80
|
+
_this$props$customPro = _this$props.customProps,
|
|
81
|
+
customProps = _this$props$customPro === void 0 ? {} : _this$props$customPro;
|
|
82
|
+
var _customProps$HourSele = customProps.HourSelectProps,
|
|
83
|
+
HourSelectProps = _customProps$HourSele === void 0 ? {} : _customProps$HourSele,
|
|
84
|
+
_customProps$MinuteSe = customProps.MinuteSelectProps,
|
|
85
|
+
MinuteSelectProps = _customProps$MinuteSe === void 0 ? {} : _customProps$MinuteSe,
|
|
86
|
+
_customProps$AmPmSele = customProps.AmPmSelectProps,
|
|
87
|
+
AmPmSelectProps = _customProps$AmPmSele === void 0 ? {} : _customProps$AmPmSele;
|
|
78
88
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
79
89
|
className: _DateTimeModule["default"].text
|
|
80
90
|
}, timeText), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -91,7 +101,8 @@ var Time = /*#__PURE__*/function (_PureComponent) {
|
|
|
91
101
|
onHourSelect: onHourSelect,
|
|
92
102
|
hours: hours,
|
|
93
103
|
needResponsive: needResponsive,
|
|
94
|
-
hourEmptyText: hourEmptyText
|
|
104
|
+
hourEmptyText: hourEmptyText,
|
|
105
|
+
customProps: HourSelectProps
|
|
95
106
|
})), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
96
107
|
flexible: true,
|
|
97
108
|
className: _DateTimeModule["default"].dropDownContainer
|
|
@@ -100,7 +111,8 @@ var Time = /*#__PURE__*/function (_PureComponent) {
|
|
|
100
111
|
onMinutesSelect: onMinutesSelect,
|
|
101
112
|
mins: mins,
|
|
102
113
|
minuteEmptyText: minuteEmptyText,
|
|
103
|
-
needResponsive: needResponsive
|
|
114
|
+
needResponsive: needResponsive,
|
|
115
|
+
customProps: MinuteSelectProps
|
|
104
116
|
})), !is24Hour ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
105
117
|
flexible: true,
|
|
106
118
|
className: _DateTimeModule["default"].dropDownContainer
|
|
@@ -108,7 +120,8 @@ var Time = /*#__PURE__*/function (_PureComponent) {
|
|
|
108
120
|
ampmSuggestions: ampmSuggestions,
|
|
109
121
|
onAmPmSelect: onAmPmSelect,
|
|
110
122
|
amPm: amPm,
|
|
111
|
-
needResponsive: needResponsive
|
|
123
|
+
needResponsive: needResponsive,
|
|
124
|
+
customProps: AmPmSelectProps
|
|
112
125
|
})) : null));
|
|
113
126
|
}
|
|
114
127
|
}]);
|
|
@@ -139,8 +152,9 @@ var Hour = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
139
152
|
onHourSelect = _this$props2.onHourSelect,
|
|
140
153
|
hours = _this$props2.hours,
|
|
141
154
|
needResponsive = _this$props2.needResponsive,
|
|
142
|
-
hourEmptyText = _this$props2.hourEmptyText
|
|
143
|
-
|
|
155
|
+
hourEmptyText = _this$props2.hourEmptyText,
|
|
156
|
+
customProps = _this$props2.customProps;
|
|
157
|
+
return /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
|
|
144
158
|
options: hourSuggestions,
|
|
145
159
|
onChange: onHourSelect,
|
|
146
160
|
selectedValue: hours,
|
|
@@ -159,7 +173,7 @@ var Hour = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
159
173
|
needListBorder: true,
|
|
160
174
|
needTick: false,
|
|
161
175
|
listItemSize: "small"
|
|
162
|
-
});
|
|
176
|
+
}, customProps));
|
|
163
177
|
}
|
|
164
178
|
}]);
|
|
165
179
|
|
|
@@ -185,8 +199,9 @@ var Minute = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
185
199
|
onMinutesSelect = _this$props3.onMinutesSelect,
|
|
186
200
|
mins = _this$props3.mins,
|
|
187
201
|
minuteEmptyText = _this$props3.minuteEmptyText,
|
|
188
|
-
needResponsive = _this$props3.needResponsive
|
|
189
|
-
|
|
202
|
+
needResponsive = _this$props3.needResponsive,
|
|
203
|
+
customProps = _this$props3.customProps;
|
|
204
|
+
return /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
|
|
190
205
|
options: minSuggestions,
|
|
191
206
|
onChange: onMinutesSelect,
|
|
192
207
|
selectedValue: mins,
|
|
@@ -205,7 +220,7 @@ var Minute = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
205
220
|
needListBorder: true,
|
|
206
221
|
needTick: false,
|
|
207
222
|
listItemSize: "small"
|
|
208
|
-
});
|
|
223
|
+
}, customProps));
|
|
209
224
|
}
|
|
210
225
|
}]);
|
|
211
226
|
|
|
@@ -230,8 +245,9 @@ var AmPm = /*#__PURE__*/function (_React$PureComponent3) {
|
|
|
230
245
|
ampmSuggestions = _this$props4.ampmSuggestions,
|
|
231
246
|
onAmPmSelect = _this$props4.onAmPmSelect,
|
|
232
247
|
amPm = _this$props4.amPm,
|
|
233
|
-
needResponsive = _this$props4.needResponsive
|
|
234
|
-
|
|
248
|
+
needResponsive = _this$props4.needResponsive,
|
|
249
|
+
customProps = _this$props4.customProps;
|
|
250
|
+
return /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
|
|
235
251
|
options: ampmSuggestions,
|
|
236
252
|
onChange: onAmPmSelect,
|
|
237
253
|
selectedValue: amPm,
|
|
@@ -246,7 +262,7 @@ var AmPm = /*#__PURE__*/function (_React$PureComponent3) {
|
|
|
246
262
|
needListBorder: true,
|
|
247
263
|
needTick: false,
|
|
248
264
|
listItemSize: "small"
|
|
249
|
-
});
|
|
265
|
+
}, customProps));
|
|
250
266
|
}
|
|
251
267
|
}]);
|
|
252
268
|
|
|
@@ -28,7 +28,8 @@ var DateTime_defaultProps = {
|
|
|
28
28
|
i18nKeys: {},
|
|
29
29
|
is24Hour: false,
|
|
30
30
|
isDefaultPosition: false,
|
|
31
|
-
customDateFormat: null
|
|
31
|
+
customDateFormat: null,
|
|
32
|
+
customProps: {}
|
|
32
33
|
};
|
|
33
34
|
exports.DateTime_defaultProps = DateTime_defaultProps;
|
|
34
35
|
var DateWidget_defaultProps = {
|
|
@@ -65,6 +66,7 @@ var DateTimePopupFooter_defaultProps = {
|
|
|
65
66
|
};
|
|
66
67
|
exports.DateTimePopupFooter_defaultProps = DateTimePopupFooter_defaultProps;
|
|
67
68
|
var Time_defaultProps = {
|
|
68
|
-
dataId: 'Time'
|
|
69
|
+
dataId: 'Time',
|
|
70
|
+
customProps: {}
|
|
69
71
|
};
|
|
70
72
|
exports.Time_defaultProps = Time_defaultProps;
|
|
@@ -97,7 +97,8 @@ var DateTime_propTypes = {
|
|
|
97
97
|
positionsOffset: _propTypes["default"].array,
|
|
98
98
|
targetOffset: _propTypes["default"].string,
|
|
99
99
|
isRestrictScroll: _propTypes["default"].bool,
|
|
100
|
-
dropBoxPortalId: _propTypes["default"].string
|
|
100
|
+
dropBoxPortalId: _propTypes["default"].string,
|
|
101
|
+
customProps: _propTypes["default"].object
|
|
101
102
|
};
|
|
102
103
|
exports.DateTime_propTypes = DateTime_propTypes;
|
|
103
104
|
var DateWidget_propTypes = {
|
|
@@ -165,7 +166,9 @@ var DateWidget_propTypes = {
|
|
|
165
166
|
targetOffset: _propTypes["default"].array,
|
|
166
167
|
isRestrictScroll: _propTypes["default"].bool,
|
|
167
168
|
dropBoxPortalId: _propTypes["default"].string,
|
|
168
|
-
a11y: _propTypes["default"].object
|
|
169
|
+
a11y: _propTypes["default"].object,
|
|
170
|
+
getPopupProps: _propTypes["default"].func,
|
|
171
|
+
customProps: _propTypes["default"].object
|
|
169
172
|
};
|
|
170
173
|
exports.DateWidget_propTypes = DateWidget_propTypes;
|
|
171
174
|
var YearView_propTypes = {
|
|
@@ -214,6 +217,7 @@ var Time_propTypes = {
|
|
|
214
217
|
ampmSuggestions: _propTypes["default"].array,
|
|
215
218
|
onAmPmSelect: _propTypes["default"].func,
|
|
216
219
|
amPm: _propTypes["default"].string,
|
|
217
|
-
is24Hour: _propTypes["default"].bool
|
|
220
|
+
is24Hour: _propTypes["default"].bool,
|
|
221
|
+
customProps: _propTypes["default"].object
|
|
218
222
|
};
|
|
219
223
|
exports.Time_propTypes = Time_propTypes;
|
|
@@ -692,7 +692,9 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
692
692
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
693
693
|
className: "".concat(className ? className : ''),
|
|
694
694
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
|
695
|
-
ref: getTargetRef
|
|
695
|
+
ref: getTargetRef,
|
|
696
|
+
"data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
|
|
697
|
+
"data-test-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId)
|
|
696
698
|
}, children ? children : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, needSelectDownIcon ? /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
697
699
|
isDisabled: isDisabled,
|
|
698
700
|
iconRotated: isPopupOpen,
|
|
@@ -707,7 +709,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
707
709
|
value: selected,
|
|
708
710
|
variant: textBoxVariant,
|
|
709
711
|
needReadOnlyStyle: isReadOnly ? true : false,
|
|
710
|
-
dataId: dataId,
|
|
712
|
+
dataId: "".concat(dataId, "_textBox"),
|
|
711
713
|
onKeyPress: this.handleValueInputChange,
|
|
712
714
|
needEffect: isReadOnly || isDisabled ? false : true,
|
|
713
715
|
borderColor: borderColor,
|
|
@@ -744,7 +746,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
744
746
|
value: selected,
|
|
745
747
|
variant: textBoxVariant,
|
|
746
748
|
needReadOnlyStyle: isReadOnly ? true : false,
|
|
747
|
-
dataId: dataId,
|
|
749
|
+
dataId: "".concat(dataId, "_textBox"),
|
|
748
750
|
onKeyPress: this.handleValueInputChange,
|
|
749
751
|
borderColor: borderColor,
|
|
750
752
|
htmlId: htmlId,
|
|
@@ -776,7 +778,8 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
776
778
|
needResponsive: needResponsive,
|
|
777
779
|
isPadding: false,
|
|
778
780
|
isResponsivePadding: getFooter ? false : true,
|
|
779
|
-
alignBox: "row"
|
|
781
|
+
alignBox: "row",
|
|
782
|
+
dataId: "".concat(dataId, "_suggestionBox")
|
|
780
783
|
}, isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
781
784
|
align: "both",
|
|
782
785
|
className: _SelectModule["default"].loader
|
|
@@ -801,7 +804,8 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
801
804
|
ariaAutocomplete: 'list',
|
|
802
805
|
ariaDescribedby: ariaErrorId
|
|
803
806
|
},
|
|
804
|
-
autoComplete: false
|
|
807
|
+
autoComplete: false,
|
|
808
|
+
dataId: "".concat(dataId, "_search")
|
|
805
809
|
}))) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
806
810
|
shrink: true,
|
|
807
811
|
customClass: !tabletMode && dropBoxSize ? _SelectModule["default"][dropBoxSize] : '',
|
|
@@ -834,7 +838,8 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
834
838
|
a11y: {
|
|
835
839
|
ariaParentRole: 'listbox',
|
|
836
840
|
role: 'option'
|
|
837
|
-
}
|
|
841
|
+
},
|
|
842
|
+
dataId: "".concat(dataId, "_Options")
|
|
838
843
|
}));
|
|
839
844
|
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
840
845
|
options: revampedGroups,
|
package/lib/Select/Select.js
CHANGED
|
@@ -43,8 +43,6 @@ var _Common = require("../utils/Common.js");
|
|
|
43
43
|
|
|
44
44
|
var _SelectModule = _interopRequireDefault(require("./Select.module.css"));
|
|
45
45
|
|
|
46
|
-
var _Config = require("../Provider/Config");
|
|
47
|
-
|
|
48
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
47
|
|
|
50
48
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -726,7 +726,11 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
726
726
|
isRestrictScroll = _this$props7.isRestrictScroll,
|
|
727
727
|
dropBoxPortalId = _this$props7.dropBoxPortalId,
|
|
728
728
|
startDate = _this$props7.startDate,
|
|
729
|
-
endDate = _this$props7.endDate
|
|
729
|
+
endDate = _this$props7.endDate,
|
|
730
|
+
_this$props7$customPr = _this$props7.customProps,
|
|
731
|
+
customProps = _this$props7$customPr === void 0 ? {} : _this$props7$customPr;
|
|
732
|
+
var _customProps$TimeProp = customProps.TimeProps,
|
|
733
|
+
TimeProps = _customProps$TimeProp === void 0 ? {} : _customProps$TimeProp;
|
|
730
734
|
var _i18nKeys$timeText = i18nKeys.timeText,
|
|
731
735
|
timeText = _i18nKeys$timeText === void 0 ? 'Time' : _i18nKeys$timeText,
|
|
732
736
|
_i18nKeys$submitText = i18nKeys.submitText,
|
|
@@ -794,7 +798,8 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
794
798
|
ampmSuggestions: this.ampmSuggestions,
|
|
795
799
|
onAmPmSelect: this.amPmSelect,
|
|
796
800
|
amPm: amPm,
|
|
797
|
-
is24Hour: is24Hour
|
|
801
|
+
is24Hour: is24Hour,
|
|
802
|
+
customProps: TimeProps
|
|
798
803
|
}) : null, needAction ? /*#__PURE__*/_react["default"].createElement(_DateTimePopupFooter["default"], {
|
|
799
804
|
submitText: submitText,
|
|
800
805
|
onSubmit: this.handleSelect,
|