secullum-react-native-ui 4.16.2-beta.4 → 4.16.2-beta.6
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.
|
@@ -20,7 +20,7 @@ export interface RangeDatePickerState {
|
|
|
20
20
|
export declare class RangeDatePicker extends React.Component<RangeDatePickerProperties, RangeDatePickerState> {
|
|
21
21
|
state: RangeDatePickerState;
|
|
22
22
|
private calendarRef;
|
|
23
|
-
|
|
23
|
+
componentDidMount(): void;
|
|
24
24
|
componentWillUnmount(): void;
|
|
25
25
|
handleClick: (event: MouseEvent) => void;
|
|
26
26
|
handleDatePickerPress: () => void;
|
|
@@ -11,26 +11,7 @@ const layout_1 = require("../modules/layout");
|
|
|
11
11
|
require("react-date-range/dist/styles.css");
|
|
12
12
|
const react_native_1 = require("react-native");
|
|
13
13
|
require("../../styles/RangeDatePicker.css");
|
|
14
|
-
|
|
15
|
-
if (date1 instanceof Date && date2 instanceof Date) {
|
|
16
|
-
return date1.getTime() === date2.getTime();
|
|
17
|
-
}
|
|
18
|
-
return date1 === date2;
|
|
19
|
-
}
|
|
20
|
-
class PureDateRange extends React.Component {
|
|
21
|
-
// Without this check, every time the parent re-renders it would
|
|
22
|
-
// recreate the DateRange with the initial startDate value,
|
|
23
|
-
// even if the date hasn't actually changed.
|
|
24
|
-
// This causes the calendar to reset and the user loses the current
|
|
25
|
-
// selection while interacting.
|
|
26
|
-
// Related issue on GitLab 12293
|
|
27
|
-
shouldComponentUpdate(nextProps) {
|
|
28
|
-
if (nextProps.onChange !== this.props.onChange) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return (!compareDates(nextProps.startDate, this.props.startDate) ||
|
|
32
|
-
!compareDates(nextProps.endDate, this.props.endDate));
|
|
33
|
-
}
|
|
14
|
+
class PureDateRange extends React.PureComponent {
|
|
34
15
|
render() {
|
|
35
16
|
const { startDate, endDate, onChange } = this.props;
|
|
36
17
|
const theme = (0, theme_1.getTheme)();
|
|
@@ -111,7 +92,7 @@ class RangeDatePicker extends React.Component {
|
|
|
111
92
|
return styles;
|
|
112
93
|
};
|
|
113
94
|
}
|
|
114
|
-
|
|
95
|
+
componentDidMount() {
|
|
115
96
|
document.addEventListener('mousedown', this.handleClick, false);
|
|
116
97
|
}
|
|
117
98
|
componentWillUnmount() {
|