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/AutocompleteSelect.js +1 -1
- package/AutocompleteSelect.js.map +1 -1
- package/DatePicker.d.ts +1 -0
- package/DatePicker.js +8 -2
- package/DatePicker.js.map +1 -1
- package/Tools.d.ts +1 -1
- package/Tools.js +1 -2
- package/Tools.js.map +1 -1
- package/bundle.css +861 -861
- package/package.json +1 -1
- package/src/AutocompleteSelect.js +1 -1
- package/src/DatePicker.tsx +11 -2
- package/src/Tools.ts +9 -10
package/package.json
CHANGED
|
@@ -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) {
|
package/src/DatePicker.tsx
CHANGED
|
@@ -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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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) => {
|