react-ui-basics 0.0.201 → 0.0.203

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-ui-basics",
3
- "version": "0.0.201",
3
+ "version": "0.0.203",
4
4
  "description": "",
5
5
  "module": "index.js",
6
6
  "_main": "index.cjs.js",
@@ -79,7 +79,7 @@ class AutocompleteSelect extends PureComponent {
79
79
 
80
80
  static propTypes = {
81
81
  mode: PropTypes.oneOf([MODE_DEFAULT, MODE_INLINE, MODE_MULTIPLE, MODE_MULTIPLE_AUTO, MODE_MULTIPLE_MINI, MODE_MULTIPLE_MINI_INLINE, MODE_INLINE_MULTIPLE, MODE_MINI]),
82
- listPortalPosition: PropTypes.oneOf('left', 'right'),
82
+ listPortalPosition: PropTypes.oneOf(['left', 'right']),
83
83
  };
84
84
 
85
85
  constructor(props) {
@@ -33,6 +33,7 @@ const DayRenderer = ({day, selected, minDate, onClick}: {
33
33
  export interface DatePickerProps {
34
34
  id?: number | string
35
35
  name?: string
36
+ className?: string
36
37
  open?: boolean
37
38
  onClose?: () => void
38
39
  renderInput?: () => JSX.Element
@@ -139,6 +140,14 @@ class DatePicker extends React.Component<DatePickerProps, DatePickerState> {
139
140
  return true;
140
141
  }
141
142
 
143
+ if (this.props.className !== nextProps.className) {
144
+ return true;
145
+ }
146
+
147
+ if (this.props.renderInput !== nextProps.renderInput) {
148
+ return true;
149
+ }
150
+
142
151
  if (this.state.text !== nextState.text) {
143
152
  return true;
144
153
  }
@@ -163,10 +172,10 @@ class DatePicker extends React.Component<DatePickerProps, DatePickerState> {
163
172
  };
164
173
 
165
174
  render() {
166
- const {minDate, formatter, parser, dayOfWeekToString, monthToString, renderInput, portal} = this.props;
175
+ const {minDate, formatter, parser, dayOfWeekToString, monthToString, className, renderInput, portal} = this.props;
167
176
  const {value, text, focused, selectedMonth, popupStyles} = this.state;
168
177
 
169
- let popup = <div className={classNames('calendar', focused && 'focused', portal && 'portal')}
178
+ let popup = <div className={classNames('calendar', focused && 'focused', portal && 'portal', className)}
170
179
  ref={ref('popup', this)}
171
180
  style={popupStyles}>
172
181
  <div className={'row monthSelect'}>
package/src/Tools.ts CHANGED
@@ -74,16 +74,15 @@ const isArrayShallowEqual = (a, b) => {
74
74
  return result;
75
75
  }
76
76
 
77
- export const debounce = (func, delay) => {
78
- let inDebounce;
79
- return function () {
80
- const context = this;
81
- const args = arguments;
82
- clearTimeout(inDebounce);
83
- inDebounce = setTimeout(() => {
84
- func.apply(context, args);
85
- }, delay)
86
- }
77
+ export const debounce = (func: (...args: any[]) => void, delay: number): (...args: any[]) => void => {
78
+ let inDebounce: NodeJS.Timeout | undefined;
79
+ return function (...args: any[]): void {
80
+ const context = this;
81
+ clearTimeout(inDebounce);
82
+ inDebounce = setTimeout(() => {
83
+ func.apply(context, args);
84
+ }, delay);
85
+ };
87
86
  };
88
87
 
89
88
  export const memo = (func) => {