@zohodesk/components 1.2.31 → 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.
@@ -649,8 +649,12 @@ export default class DateTime extends React.PureComponent {
649
649
  positionsOffset,
650
650
  targetOffset,
651
651
  isRestrictScroll,
652
- dropBoxPortalId
652
+ dropBoxPortalId,
653
+ customProps = {}
653
654
  } = this.props;
655
+ const {
656
+ TimeProps = {}
657
+ } = customProps;
654
658
  const {
655
659
  timeText = 'Time',
656
660
  submitText = 'Set',
@@ -706,7 +710,8 @@ export default class DateTime extends React.PureComponent {
706
710
  ampmSuggestions: this.ampmSuggestions,
707
711
  onAmPmSelect: this.amPmSelect,
708
712
  amPm: amPm,
709
- is24Hour: is24Hour
713
+ is24Hour: is24Hour,
714
+ customProps: TimeProps
710
715
  }) : null, needAction ? /*#__PURE__*/React.createElement(DateTimePopupFooter, {
711
716
  submitText: submitText,
712
717
  onSubmit: this.handleSelect,
@@ -79,7 +79,9 @@ class DateWidgetComponent extends React.Component {
79
79
 
80
80
  componentDidMount() {
81
81
  const {
82
- validation
82
+ validation,
83
+ getPopupProps,
84
+ isPopupReady
83
85
  } = this.props;
84
86
  const {
85
87
  selected
@@ -98,6 +100,12 @@ class DateWidgetComponent extends React.Component {
98
100
  selected: newSelected
99
101
  });
100
102
  this.handleSelectionRangeDetails(this.props);
103
+
104
+ if (getPopupProps) {
105
+ getPopupProps({
106
+ isPopupReady
107
+ });
108
+ }
101
109
  }
102
110
 
103
111
  componentDidUpdate(prevProps, prevState) {
@@ -119,7 +127,8 @@ class DateWidgetComponent extends React.Component {
119
127
  isPopupReady,
120
128
  dateFormat = '',
121
129
  is24Hour,
122
- isHideCurrentYear
130
+ isHideCurrentYear,
131
+ getPopupProps
123
132
  } = this.props;
124
133
 
125
134
  if (validation && validation.validate) {
@@ -154,6 +163,12 @@ class DateWidgetComponent extends React.Component {
154
163
  if (isPopupReady) {
155
164
  this.resetLocalDate && this.resetLocalDate();
156
165
  }
166
+
167
+ if (getPopupProps) {
168
+ getPopupProps({
169
+ isPopupReady
170
+ });
171
+ }
157
172
  }
158
173
 
159
174
  const haveLocalValue = [day, month, year, hour, minute, noon].some(value => !getIsEmptyValue(value));
@@ -988,8 +1003,13 @@ class DateWidgetComponent extends React.Component {
988
1003
  dropBoxPortalId,
989
1004
  a11y,
990
1005
  boxSize,
991
- onError
1006
+ onError,
1007
+ customProps = {}
992
1008
  } = this.props;
1009
+ const {
1010
+ DateTimeProps = {},
1011
+ TextBoxProps = {}
1012
+ } = customProps;
993
1013
  const {
994
1014
  selected: value = '',
995
1015
  isError,
@@ -1041,7 +1061,8 @@ class DateWidgetComponent extends React.Component {
1041
1061
  iconOnHover: iconOnHover,
1042
1062
  isFocus: isPopupReady,
1043
1063
  autoComplete: false,
1044
- a11y: a11y
1064
+ a11y: a11y,
1065
+ customProps: TextBoxProps
1045
1066
  }, /*#__PURE__*/React.createElement(Container, {
1046
1067
  align: "both",
1047
1068
  onClick: isDisabled || isReadOnly ? null : this.handleDateIconClick
@@ -1078,7 +1099,8 @@ class DateWidgetComponent extends React.Component {
1078
1099
  isRestrictScroll: isRestrictScroll,
1079
1100
  dropBoxPortalId: dropBoxPortalId,
1080
1101
  boxSize: boxSize,
1081
- onError: onError
1102
+ onError: onError,
1103
+ customProps: DateTimeProps
1082
1104
  }));
1083
1105
  }
1084
1106
 
@@ -28,8 +28,14 @@ export default class Time extends PureComponent {
28
28
  ampmSuggestions,
29
29
  onAmPmSelect,
30
30
  amPm,
31
- is24Hour
31
+ is24Hour,
32
+ customProps = {}
32
33
  } = this.props;
34
+ const {
35
+ HourSelectProps = {},
36
+ MinuteSelectProps = {},
37
+ AmPmSelectProps = {}
38
+ } = customProps;
33
39
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
34
40
  className: style.text
35
41
  }, timeText), /*#__PURE__*/React.createElement(Container, {
@@ -46,7 +52,8 @@ export default class Time extends PureComponent {
46
52
  onHourSelect: onHourSelect,
47
53
  hours: hours,
48
54
  needResponsive: needResponsive,
49
- hourEmptyText: hourEmptyText
55
+ hourEmptyText: hourEmptyText,
56
+ customProps: HourSelectProps
50
57
  })), /*#__PURE__*/React.createElement(Box, {
51
58
  flexible: true,
52
59
  className: style.dropDownContainer
@@ -55,7 +62,8 @@ export default class Time extends PureComponent {
55
62
  onMinutesSelect: onMinutesSelect,
56
63
  mins: mins,
57
64
  minuteEmptyText: minuteEmptyText,
58
- needResponsive: needResponsive
65
+ needResponsive: needResponsive,
66
+ customProps: MinuteSelectProps
59
67
  })), !is24Hour ? /*#__PURE__*/React.createElement(Box, {
60
68
  flexible: true,
61
69
  className: style.dropDownContainer
@@ -63,7 +71,8 @@ export default class Time extends PureComponent {
63
71
  ampmSuggestions: ampmSuggestions,
64
72
  onAmPmSelect: onAmPmSelect,
65
73
  amPm: amPm,
66
- needResponsive: needResponsive
74
+ needResponsive: needResponsive,
75
+ customProps: AmPmSelectProps
67
76
  })) : null));
68
77
  }
69
78
 
@@ -78,7 +87,8 @@ class Hour extends React.PureComponent {
78
87
  onHourSelect,
79
88
  hours,
80
89
  needResponsive,
81
- hourEmptyText
90
+ hourEmptyText,
91
+ customProps
82
92
  } = this.props;
83
93
  return /*#__PURE__*/React.createElement(Select, {
84
94
  options: hourSuggestions,
@@ -98,7 +108,8 @@ class Hour extends React.PureComponent {
98
108
  needResponsive: needResponsive,
99
109
  needListBorder: true,
100
110
  needTick: false,
101
- listItemSize: "small"
111
+ listItemSize: "small",
112
+ ...customProps
102
113
  });
103
114
  }
104
115
 
@@ -111,7 +122,8 @@ class Minute extends React.PureComponent {
111
122
  onMinutesSelect,
112
123
  mins,
113
124
  minuteEmptyText,
114
- needResponsive
125
+ needResponsive,
126
+ customProps
115
127
  } = this.props;
116
128
  return /*#__PURE__*/React.createElement(Select, {
117
129
  options: minSuggestions,
@@ -131,7 +143,8 @@ class Minute extends React.PureComponent {
131
143
  needResponsive: needResponsive,
132
144
  needListBorder: true,
133
145
  needTick: false,
134
- listItemSize: "small"
146
+ listItemSize: "small",
147
+ ...customProps
135
148
  });
136
149
  }
137
150
 
@@ -143,7 +156,8 @@ class AmPm extends React.PureComponent {
143
156
  ampmSuggestions,
144
157
  onAmPmSelect,
145
158
  amPm,
146
- needResponsive
159
+ needResponsive,
160
+ customProps
147
161
  } = this.props;
148
162
  return /*#__PURE__*/React.createElement(Select, {
149
163
  options: ampmSuggestions,
@@ -159,7 +173,8 @@ class AmPm extends React.PureComponent {
159
173
  needResponsive: needResponsive,
160
174
  needListBorder: true,
161
175
  needTick: false,
162
- listItemSize: "small"
176
+ listItemSize: "small",
177
+ ...customProps
163
178
  });
164
179
  }
165
180
 
@@ -20,7 +20,8 @@ export const DateTime_defaultProps = {
20
20
  i18nKeys: {},
21
21
  is24Hour: false,
22
22
  isDefaultPosition: false,
23
- customDateFormat: null
23
+ customDateFormat: null,
24
+ customProps: {}
24
25
  };
25
26
  export const DateWidget_defaultProps = {
26
27
  borderColor: 'default',
@@ -53,5 +54,6 @@ export const DateTimePopupFooter_defaultProps = {
53
54
  dataId: 'DateTimePopupFooter'
54
55
  };
55
56
  export const Time_defaultProps = {
56
- dataId: 'Time'
57
+ dataId: 'Time',
58
+ customProps: {}
57
59
  };
@@ -72,7 +72,8 @@ export const DateTime_propTypes = {
72
72
  positionsOffset: PropTypes.array,
73
73
  targetOffset: PropTypes.string,
74
74
  isRestrictScroll: PropTypes.bool,
75
- dropBoxPortalId: PropTypes.string
75
+ dropBoxPortalId: PropTypes.string,
76
+ customProps: PropTypes.object
76
77
  };
77
78
  export const DateWidget_propTypes = {
78
79
  borderColor: PropTypes.oneOf(['transparent', 'default']),
@@ -139,7 +140,9 @@ export const DateWidget_propTypes = {
139
140
  targetOffset: PropTypes.array,
140
141
  isRestrictScroll: PropTypes.bool,
141
142
  dropBoxPortalId: PropTypes.string,
142
- a11y: PropTypes.object
143
+ a11y: PropTypes.object,
144
+ getPopupProps: PropTypes.func,
145
+ customProps: PropTypes.object
143
146
  };
144
147
  export const YearView_propTypes = {
145
148
  onSelectMonth: PropTypes.func,
@@ -183,5 +186,6 @@ export const Time_propTypes = {
183
186
  ampmSuggestions: PropTypes.array,
184
187
  onAmPmSelect: PropTypes.func,
185
188
  amPm: PropTypes.string,
186
- is24Hour: PropTypes.bool
189
+ is24Hour: PropTypes.bool,
190
+ customProps: PropTypes.object
187
191
  };
@@ -651,8 +651,12 @@ export default class DateTime extends React.PureComponent {
651
651
  isRestrictScroll,
652
652
  dropBoxPortalId,
653
653
  startDate,
654
- endDate
654
+ endDate,
655
+ customProps = {}
655
656
  } = this.props;
657
+ const {
658
+ TimeProps = {}
659
+ } = customProps;
656
660
  const {
657
661
  timeText = 'Time',
658
662
  submitText = 'Set',
@@ -710,7 +714,8 @@ export default class DateTime extends React.PureComponent {
710
714
  ampmSuggestions: this.ampmSuggestions,
711
715
  onAmPmSelect: this.amPmSelect,
712
716
  amPm: amPm,
713
- is24Hour: is24Hour
717
+ is24Hour: is24Hour,
718
+ customProps: TimeProps
714
719
  }) : null, needAction ? /*#__PURE__*/React.createElement(DateTimePopupFooter, {
715
720
  submitText: submitText,
716
721
  onSubmit: this.handleSelect,
@@ -79,7 +79,9 @@ class DateWidgetComponent extends React.Component {
79
79
 
80
80
  componentDidMount() {
81
81
  const {
82
- validation
82
+ validation,
83
+ getPopupProps,
84
+ isPopupReady
83
85
  } = this.props;
84
86
  const {
85
87
  selected
@@ -98,6 +100,12 @@ class DateWidgetComponent extends React.Component {
98
100
  selected: newSelected
99
101
  });
100
102
  this.handleSelectionRangeDetails(this.props);
103
+
104
+ if (getPopupProps) {
105
+ getPopupProps({
106
+ isPopupReady
107
+ });
108
+ }
101
109
  }
102
110
 
103
111
  componentDidUpdate(prevProps, prevState) {
@@ -119,7 +127,8 @@ class DateWidgetComponent extends React.Component {
119
127
  isPopupReady,
120
128
  dateFormat = '',
121
129
  is24Hour,
122
- isHideCurrentYear
130
+ isHideCurrentYear,
131
+ getPopupProps
123
132
  } = this.props;
124
133
 
125
134
  if (validation && validation.validate) {
@@ -154,6 +163,12 @@ class DateWidgetComponent extends React.Component {
154
163
  if (isPopupReady) {
155
164
  this.resetLocalDate && this.resetLocalDate();
156
165
  }
166
+
167
+ if (getPopupProps) {
168
+ getPopupProps({
169
+ isPopupReady
170
+ });
171
+ }
157
172
  }
158
173
 
159
174
  const haveLocalValue = [day, month, year, hour, minute, noon].some(value => !getIsEmptyValue(value));
@@ -990,8 +1005,13 @@ class DateWidgetComponent extends React.Component {
990
1005
  boxSize,
991
1006
  onError,
992
1007
  startDate,
993
- endDate
1008
+ endDate,
1009
+ customProps = {}
994
1010
  } = this.props;
1011
+ const {
1012
+ DateTimeProps = {},
1013
+ TextBoxProps = {}
1014
+ } = customProps;
995
1015
  const {
996
1016
  selected: value = '',
997
1017
  isError,
@@ -1043,7 +1063,8 @@ class DateWidgetComponent extends React.Component {
1043
1063
  iconOnHover: iconOnHover,
1044
1064
  isFocus: isPopupReady,
1045
1065
  autoComplete: false,
1046
- a11y: a11y
1066
+ a11y: a11y,
1067
+ customProps: TextBoxProps
1047
1068
  }, /*#__PURE__*/React.createElement(Container, {
1048
1069
  align: "both",
1049
1070
  onClick: isDisabled || isReadOnly ? null : this.handleDateIconClick
@@ -1082,7 +1103,8 @@ class DateWidgetComponent extends React.Component {
1082
1103
  boxSize: boxSize,
1083
1104
  onError: onError,
1084
1105
  startDate: startDate,
1085
- endDate: endDate
1106
+ endDate: endDate,
1107
+ customProps: DateTimeProps
1086
1108
  }));
1087
1109
  }
1088
1110
 
@@ -28,8 +28,14 @@ export default class Time extends PureComponent {
28
28
  ampmSuggestions,
29
29
  onAmPmSelect,
30
30
  amPm,
31
- is24Hour
31
+ is24Hour,
32
+ customProps = {}
32
33
  } = this.props;
34
+ const {
35
+ HourSelectProps = {},
36
+ MinuteSelectProps = {},
37
+ AmPmSelectProps = {}
38
+ } = customProps;
33
39
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
34
40
  className: style.text
35
41
  }, timeText), /*#__PURE__*/React.createElement(Container, {
@@ -46,7 +52,8 @@ export default class Time extends PureComponent {
46
52
  onHourSelect: onHourSelect,
47
53
  hours: hours,
48
54
  needResponsive: needResponsive,
49
- hourEmptyText: hourEmptyText
55
+ hourEmptyText: hourEmptyText,
56
+ customProps: HourSelectProps
50
57
  })), /*#__PURE__*/React.createElement(Box, {
51
58
  flexible: true,
52
59
  className: style.dropDownContainer
@@ -55,7 +62,8 @@ export default class Time extends PureComponent {
55
62
  onMinutesSelect: onMinutesSelect,
56
63
  mins: mins,
57
64
  minuteEmptyText: minuteEmptyText,
58
- needResponsive: needResponsive
65
+ needResponsive: needResponsive,
66
+ customProps: MinuteSelectProps
59
67
  })), !is24Hour ? /*#__PURE__*/React.createElement(Box, {
60
68
  flexible: true,
61
69
  className: style.dropDownContainer
@@ -63,7 +71,8 @@ export default class Time extends PureComponent {
63
71
  ampmSuggestions: ampmSuggestions,
64
72
  onAmPmSelect: onAmPmSelect,
65
73
  amPm: amPm,
66
- needResponsive: needResponsive
74
+ needResponsive: needResponsive,
75
+ customProps: AmPmSelectProps
67
76
  })) : null));
68
77
  }
69
78
 
@@ -78,7 +87,8 @@ class Hour extends React.PureComponent {
78
87
  onHourSelect,
79
88
  hours,
80
89
  needResponsive,
81
- hourEmptyText
90
+ hourEmptyText,
91
+ customProps
82
92
  } = this.props;
83
93
  return /*#__PURE__*/React.createElement(Select, {
84
94
  options: hourSuggestions,
@@ -98,7 +108,8 @@ class Hour extends React.PureComponent {
98
108
  needResponsive: needResponsive,
99
109
  needListBorder: true,
100
110
  needTick: false,
101
- listItemSize: "small"
111
+ listItemSize: "small",
112
+ ...customProps
102
113
  });
103
114
  }
104
115
 
@@ -111,7 +122,8 @@ class Minute extends React.PureComponent {
111
122
  onMinutesSelect,
112
123
  mins,
113
124
  minuteEmptyText,
114
- needResponsive
125
+ needResponsive,
126
+ customProps
115
127
  } = this.props;
116
128
  return /*#__PURE__*/React.createElement(Select, {
117
129
  options: minSuggestions,
@@ -131,7 +143,8 @@ class Minute extends React.PureComponent {
131
143
  needResponsive: needResponsive,
132
144
  needListBorder: true,
133
145
  needTick: false,
134
- listItemSize: "small"
146
+ listItemSize: "small",
147
+ ...customProps
135
148
  });
136
149
  }
137
150
 
@@ -143,7 +156,8 @@ class AmPm extends React.PureComponent {
143
156
  ampmSuggestions,
144
157
  onAmPmSelect,
145
158
  amPm,
146
- needResponsive
159
+ needResponsive,
160
+ customProps
147
161
  } = this.props;
148
162
  return /*#__PURE__*/React.createElement(Select, {
149
163
  options: ampmSuggestions,
@@ -159,7 +173,8 @@ class AmPm extends React.PureComponent {
159
173
  needResponsive: needResponsive,
160
174
  needListBorder: true,
161
175
  needTick: false,
162
- listItemSize: "small"
176
+ listItemSize: "small",
177
+ ...customProps
163
178
  });
164
179
  }
165
180
 
@@ -78,7 +78,8 @@ export const DateTime_propTypes = {
78
78
  isRestrictScroll: PropTypes.bool,
79
79
  dropBoxPortalId: PropTypes.string,
80
80
  startDate: PropTypes.string,
81
- endDate: PropTypes.string
81
+ endDate: PropTypes.string,
82
+ customProps: PropTypes.object
82
83
  };
83
84
  export const DateWidget_propTypes = {
84
85
  borderColor: PropTypes.oneOf(['transparent', 'default']),
@@ -147,7 +148,9 @@ export const DateWidget_propTypes = {
147
148
  dropBoxPortalId: PropTypes.string,
148
149
  a11y: PropTypes.object,
149
150
  startDate: PropTypes.string,
150
- endDate: PropTypes.string
151
+ endDate: PropTypes.string,
152
+ getPopupProps: PropTypes.func,
153
+ customProps: PropTypes.object
151
154
  };
152
155
  export const YearView_propTypes = {
153
156
  onSelectMonth: PropTypes.func,
@@ -191,5 +194,6 @@ export const Time_propTypes = {
191
194
  ampmSuggestions: PropTypes.array,
192
195
  onAmPmSelect: PropTypes.func,
193
196
  amPm: PropTypes.string,
194
- is24Hour: PropTypes.bool
197
+ is24Hour: PropTypes.bool,
198
+ customProps: PropTypes.object
195
199
  };
@@ -724,7 +724,11 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
724
724
  positionsOffset = _this$props7.positionsOffset,
725
725
  targetOffset = _this$props7.targetOffset,
726
726
  isRestrictScroll = _this$props7.isRestrictScroll,
727
- dropBoxPortalId = _this$props7.dropBoxPortalId;
727
+ dropBoxPortalId = _this$props7.dropBoxPortalId,
728
+ _this$props7$customPr = _this$props7.customProps,
729
+ customProps = _this$props7$customPr === void 0 ? {} : _this$props7$customPr;
730
+ var _customProps$TimeProp = customProps.TimeProps,
731
+ TimeProps = _customProps$TimeProp === void 0 ? {} : _customProps$TimeProp;
728
732
  var _i18nKeys$timeText = i18nKeys.timeText,
729
733
  timeText = _i18nKeys$timeText === void 0 ? 'Time' : _i18nKeys$timeText,
730
734
  _i18nKeys$submitText = i18nKeys.submitText,
@@ -790,7 +794,8 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
790
794
  ampmSuggestions: this.ampmSuggestions,
791
795
  onAmPmSelect: this.amPmSelect,
792
796
  amPm: amPm,
793
- is24Hour: is24Hour
797
+ is24Hour: is24Hour,
798
+ customProps: TimeProps
794
799
  }) : null, needAction ? /*#__PURE__*/_react["default"].createElement(_DateTimePopupFooter["default"], {
795
800
  submitText: submitText,
796
801
  onSubmit: this.handleSelect,