85 lines
2.7 KiB
JavaScript
85 lines
2.7 KiB
JavaScript
// Metro module 8258 (f8259).
|
|
import Module19, { useCallback, useEffect, useRef } from "react";
|
|
import { NativeEventEmitter } from "react-native";
|
|
import { jsx } from "react/jsx-runtime";
|
|
import { getNativeComponent, getNativeModule } from "./Module8259";
|
|
import { useModal } from "./Module8261";
|
|
let getStyle, getTimezoneOffsetInMinutes, toIsoWithTimeZoneOffset, fromIsoWithTimeZoneOffset;
|
|
const nativeComponent = getNativeComponent();
|
|
const nativeModule = getNativeModule();
|
|
const r35 = Module19.memo((a0) => {
|
|
let callback2;
|
|
let c16418_0 = a0;
|
|
const current = useRef(Math.random().toString()).current;
|
|
const callback = useCallback((a0) => {
|
|
let nativeEvent = a0.nativeEvent;
|
|
if (nativeEvent == null) {
|
|
nativeEvent = a0;
|
|
}
|
|
const { date, id, dateString } = nativeEvent;
|
|
if (!(id !== null && id !== current)) {
|
|
const date2 = new Date(date);
|
|
if (c16418_0.onDateChange) {
|
|
c16418_0.onDateChange(date2);
|
|
}
|
|
if (c16418_0.onDateStringChange) {
|
|
c16418_0.onDateStringChange(dateString);
|
|
}
|
|
}
|
|
}, [a0, current]);
|
|
callback2 = useCallback((a0) => {
|
|
let nativeEvent = a0.nativeEvent;
|
|
if (nativeEvent == null) {
|
|
nativeEvent = a0;
|
|
}
|
|
const { spinnerState, id } = nativeEvent;
|
|
if (!(id !== null && id !== current)) {
|
|
if (c16418_0.onStateChange) {
|
|
c16418_0.onStateChange(spinnerState);
|
|
}
|
|
}
|
|
}, [a0, current]);
|
|
useEffect(() => {
|
|
const nativeEventEmitter = new NativeEventEmitter(nativeModule);
|
|
let c26160_0 = nativeEventEmitter;
|
|
nativeEventEmitter.addListener("dateChange", callback);
|
|
nativeEventEmitter.addListener("spinnerStateChange", callback2);
|
|
return () => {
|
|
c26160_0.removeAllListeners("dateChange");
|
|
c26160_0.removeAllListeners("spinnerStateChange");
|
|
};
|
|
}, [callback, callback2]);
|
|
const date = a0.date;
|
|
const date2 = date ? date.toISOString() : void 0;
|
|
const minimumDate = a0.minimumDate;
|
|
const minimumDate2 = minimumDate ? minimumDate.toISOString() : void 0;
|
|
const maximumDate = a0.maximumDate;
|
|
const props = {
|
|
...a0,
|
|
date: date2,
|
|
id: current,
|
|
minimumDate: minimumDate2,
|
|
maximumDate: maximumDate ? maximumDate.toISOString() : void 0,
|
|
timezoneOffsetInMinutes: a0.timeZoneOffsetInMinutes != null ? a0.timeZoneOffsetInMinutes : void 0,
|
|
style: [{
|
|
width: a0.mode === "time" ? 240 : 310,
|
|
height: 180
|
|
}, a0.style],
|
|
onChange: callback,
|
|
onStateChange: callback2
|
|
};
|
|
useModal({
|
|
props,
|
|
id: current
|
|
});
|
|
return a0.modal ? null : jsx(nativeComponent, {
|
|
...props
|
|
});
|
|
});
|
|
getStyle = (a0) => {};
|
|
getTimezoneOffsetInMinutes = (a0) => {};
|
|
toIsoWithTimeZoneOffset = (a0) => {};
|
|
fromIsoWithTimeZoneOffset = (a0) => {};
|
|
export default r35;
|
|
export { r35 as DatePickerAndroid };
|