304 lines
11 KiB
TypeScript
304 lines
11 KiB
TypeScript
// Module ID: 9717
|
|
// Function ID: 9718
|
|
// Name: ActionSheetHeader
|
|
// Dependencies: [32, 19, 17, 21, 4560, 576, 4527, 1115, 7149, 7199, 9718, 1114, 4971, 4296, 1178, 4561, 4556, 4976, 4495, 6964, 4153, 7150, 9719, 4411, 2]
|
|
// Exports: default
|
|
|
|
// Module 9717 (ActionSheetHeader)
|
|
import ThemesDefault from "Themes" /* 576 */;
|
|
import set from "set" /* 1115 */;
|
|
import RedesignBottomSheetTitleHeaderBase from "RedesignBottomSheetTitleHeaderBase" /* 7149 */;
|
|
import closure_3 from "_slicedToArray" /* 32 */;
|
|
import closure_4 from "noop" /* 19 */;
|
|
import { View } from "get ActivityIndicator" /* 17 */;
|
|
import jsxProd from "jsxProd" /* 21 */;
|
|
import createCacheKey from "createCacheKey" /* 4560 */;
|
|
|
|
require = arg1;
|
|
function ActionSheetHeader(handleSubmit) {
|
|
({ title, handleCancel } = handleSubmit);
|
|
let obj = set;
|
|
const BottomSheetTitleHeader = RedesignBottomSheetTitleHeaderBase.BottomSheetTitleHeader;
|
|
if (isAndroidResult) {
|
|
obj = { title: null, trailing: null };
|
|
obj[0] = title;
|
|
obj = { onPress: null };
|
|
obj[0] = handleCancel;
|
|
obj[1] = tmp4(tmp(7199).ActionSheetCloseButton, obj);
|
|
let tmp4Result = tmp4(BottomSheetTitleHeader, obj);
|
|
} else {
|
|
obj1 = { title: null, leading: null, trailing: null };
|
|
obj1[0] = title;
|
|
const obj2 = { onPress: null, label: null };
|
|
obj2[0] = handleCancel;
|
|
const intl = tmp(1114).intl;
|
|
obj2[1] = intl.string(tmp(1114).t["ETE/oC"]);
|
|
obj1[1] = tmp4(tmp(9718).ActionSheetHeaderPressableText, obj2);
|
|
const obj3 = { onPress: null, label: null };
|
|
obj3[0] = handleSubmit.handleSubmit;
|
|
const intl2 = tmp(1114).intl;
|
|
obj3[1] = intl2.string(tmp(1114).t["R3BPH+"]);
|
|
obj1[2] = tmp4(tmp(9718).ActionSheetHeaderPressableText, obj3);
|
|
tmp4Result = tmp4(BottomSheetTitleHeader, obj1);
|
|
}
|
|
return tmp4Result;
|
|
}
|
|
function DateRangeError(children) {
|
|
const show = children.show;
|
|
let ref;
|
|
const tmp = callback3();
|
|
ref = React.useRef(null);
|
|
const items = [show];
|
|
const effect = React.useEffect(() => {
|
|
let obj = show(closure_1_2[12]);
|
|
obj = { ref, delay: 200 };
|
|
const result = obj.setAccessibilityFocus(obj);
|
|
}, items);
|
|
let obj = show(4296);
|
|
class A {
|
|
constructor() {
|
|
obj = { easing: show(closure_1_2[14]).STANDARD_EASING, duration: null };
|
|
tmp = show;
|
|
tmp2 = closure_1_2;
|
|
tmp3 = show;
|
|
num = 150;
|
|
if (show) {
|
|
num = 200;
|
|
}
|
|
obj[1] = num;
|
|
tmpResult = tmp(tmp2[15]);
|
|
num2 = 0;
|
|
if (tmp3) {
|
|
num2 = 1;
|
|
}
|
|
obj = { opacity: tmpResult.withTiming(num2, obj), maxHeight: null, paddingVertical: null };
|
|
tmpResult1 = tmp(tmp2[15]);
|
|
num3 = 0;
|
|
if (tmp3) {
|
|
num3 = 500;
|
|
}
|
|
obj[1] = tmpResult1.withTiming(num3, obj);
|
|
tmpResult2 = tmp(tmp2[15]);
|
|
num4 = 0;
|
|
if (tmp3) {
|
|
num4 = 12;
|
|
}
|
|
obj[2] = tmpResult2.withTiming(num4, obj);
|
|
return obj;
|
|
}
|
|
}
|
|
obj = { STANDARD_EASING: show(1178).STANDARD_EASING, show, withTiming: show(4561).withTiming };
|
|
A.__closure = obj;
|
|
A.__workletHash = 11991491746736;
|
|
A.__initData = closure_11;
|
|
const animatedStyle = obj.useAnimatedStyle(A);
|
|
obj = { style: items1, accessibilityElementsHidden: !show, importantForAccessibility: null, children: null };
|
|
items1 = [tmp.rangeErrorContainer, animatedStyle];
|
|
let str = "no-hide-descendants";
|
|
if (show) {
|
|
str = "auto";
|
|
}
|
|
obj[2] = str;
|
|
obj[3] = closure_6(View, { ref, accessible: true, accessibilityRole: "alert", style: tmp.rangeError, children: closure_6(show(4556).Text, { variant: "text-md/medium", color: "text-feedback-critical", children: children.errorText }) });
|
|
return closure_6(ref(4296).View, obj);
|
|
}
|
|
function ActionSheetFooter(arg0) {
|
|
({ handleCancel, handleSubmit, canSubmit } = arg0);
|
|
const tmp = callback4();
|
|
let obj = set;
|
|
let tmp4 = null;
|
|
if (obj.isAndroid()) {
|
|
obj = { style: null, children: null };
|
|
obj[0] = tmp.footer;
|
|
obj = { shrink: true, size: "md", variant: "secondary", textElement: null, accessibilityLabel: null, style: null, onPress: null };
|
|
obj1 = { variant: "text-md/semibold", children: null };
|
|
const intl = tmp2(1114).intl;
|
|
obj1[1] = intl.string(tmp2(1114).t["ETE/oC"]);
|
|
obj[3] = callback(tmp2(4556).Text, obj1);
|
|
const intl2 = tmp2(1114).intl;
|
|
obj[4] = intl2.string(tmp2(1114).t["ETE/oC"]);
|
|
obj[5] = tmp.actionButton;
|
|
obj[6] = handleCancel;
|
|
const items = [callback(tmp2(4976).BaseTextButton, obj), ];
|
|
const obj2 = { shrink: true, disabled: null, size: "md", variant: "secondary", textElement: null, accessibilityLabel: null, style: null, onPress: null };
|
|
obj2[1] = !canSubmit;
|
|
const obj3 = { variant: "text-md/semibold", children: null };
|
|
const intl3 = tmp2(1114).intl;
|
|
obj3[1] = intl3.string(tmp2(1114).t["cY+Oob"]);
|
|
obj2[4] = callback(tmp2(4556).Text, obj3);
|
|
const intl4 = tmp2(1114).intl;
|
|
obj2[5] = intl4.string(tmp2(1114).t["cY+Oob"]);
|
|
obj2[6] = tmp.actionButton;
|
|
obj2[7] = handleSubmit;
|
|
items[1] = callback(tmp2(4976).BaseTextButton, obj2);
|
|
obj[1] = items;
|
|
tmp4 = callback2(View, obj);
|
|
}
|
|
return tmp4;
|
|
}
|
|
({ jsx: closure_6, jsxs: error } = jsxProd);
|
|
createCacheKey = { rangeErrorContainer: { justifyContent: "flex-start" }, rangeError: null, datetimePickerContainer: null };
|
|
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_FEEDBACK_CRITICAL, padding: 12, marginHorizontal: 12, borderRadius: ThemesDefault.radii.sm };
|
|
createCacheKey[1] = createCacheKey;
|
|
createCacheKey[2] = { display: "flex", alignItems: "center" };
|
|
let closure_8 = createCacheKey.createStyles(createCacheKey);
|
|
let closure_9 = createCacheKey.createStyles({ footer: { marginVertical: 6, paddingHorizontal: 12, display: "flex", flexDirection: "row", justifyContent: "flex-end" }, actionButton: { marginLeft: 24 } });
|
|
let closure_11 = { code: "function DatePickerActionSheetTsx1(){const{STANDARD_EASING,show,withTiming}=this.__closure;const animationSettings={easing:STANDARD_EASING,duration:show?200:150};return{opacity:withTiming(show?1:0,animationSettings),maxHeight:withTiming(show?500:0,animationSettings),paddingVertical:withTiming(show?12:0,animationSettings)};}" };
|
|
let result = require("set").fileFinishedImporting("components_native/DatePickerActionSheet.tsx");
|
|
|
|
export default function DatePickerActionSheet(mode) {
|
|
let str = mode.mode;
|
|
if (str === undefined) {
|
|
str = "date";
|
|
}
|
|
let title = mode.title;
|
|
if (title === undefined) {
|
|
const intl = maximumDate(1114).intl;
|
|
title = intl.string(maximumDate(1114).t.epc9sr);
|
|
}
|
|
({ startDate, maximumDate } = mode);
|
|
const minimumDate = mode.minimumDate;
|
|
({ onSubmit: dependencyMap, onCancel } = mode);
|
|
startDate = undefined;
|
|
let first;
|
|
let callback;
|
|
let first1;
|
|
let callback3;
|
|
c9 = undefined;
|
|
c10 = undefined;
|
|
c11 = undefined;
|
|
closure_12 = undefined;
|
|
if (startDate == null) {
|
|
const _Date = Date;
|
|
startDate = new Date();
|
|
}
|
|
let obj = startDate;
|
|
const tmp7 = onCancel(startDate.useState(startDate), 2);
|
|
first = tmp7[0];
|
|
callback = tmp7[1];
|
|
const tmp8 = onCancel(startDate.useState(!mode.requireDateChanged), 2);
|
|
first1 = tmp8[0];
|
|
callback3 = tmp8[1];
|
|
let tmp3 = callback3();
|
|
[c9, c10] = onCancel(startDate.useState(true), 2);
|
|
const tmp10 = onCancel(startDate.useState(true), 2);
|
|
[tmp12, c11] = onCancel(startDate.useState(false), 2);
|
|
const tmp11 = onCancel(startDate.useState(false), 2);
|
|
closure_12 = startDate.useRef(first);
|
|
let date;
|
|
if (null != maximumDate) {
|
|
const _Date2 = Date;
|
|
date = new Date(maximumDate.getFullYear() + 1, 0, 1, 0, -1);
|
|
}
|
|
let date1;
|
|
if (null != minimumDate) {
|
|
const _Date3 = Date;
|
|
date1 = new Date(minimumDate.getFullYear(), 0, 1, 0);
|
|
}
|
|
const items = [first];
|
|
const effect = obj.useEffect(() => {
|
|
closure_12.current = first;
|
|
}, items);
|
|
const tmp25 = minimumDate(6964)(() => {
|
|
closure_12.current = startDate;
|
|
if (onCancel != null) {
|
|
tmp();
|
|
}
|
|
minimumDate(closure_1_2[6]).hideActionSheet();
|
|
});
|
|
const tmp26 = minimumDate(6964)(() => {
|
|
let tmp = first1;
|
|
if (first1) {
|
|
tmp = c9;
|
|
}
|
|
if (tmp) {
|
|
callback(minimumDate(closure_1_2[20])(ref.current));
|
|
}
|
|
if (c9) {
|
|
minimumDate(closure_1_2[6]).hideActionSheet();
|
|
const obj = minimumDate(closure_1_2[6]);
|
|
} else {
|
|
_undefined(true);
|
|
}
|
|
});
|
|
const tmp15 = minimumDate(4495)();
|
|
obj = { onDismiss: onCancel, header: callback(c10, { title, handleCancel: tmp25, handleSubmit: tmp26 }), children: null };
|
|
let tmp32 = tmp12;
|
|
if (tmp12) {
|
|
let tmp33 = null == minimumDate;
|
|
if (!tmp33) {
|
|
let time = first.getTime();
|
|
tmp33 = time >= minimumDate.getTime();
|
|
}
|
|
tmp32 = !tmp33;
|
|
}
|
|
obj = { show: tmp32, errorText: null };
|
|
const intl2 = tmp29(1114).intl;
|
|
let obj4 = tmp13(4153)(minimumDate);
|
|
let str2 = "lll";
|
|
let str3 = "lll";
|
|
if ("date" === str) {
|
|
str3 = "L";
|
|
}
|
|
const tmp27 = minimumDate(6964)((getTime) => {
|
|
if (null != getTime) {
|
|
let tmp2 = null == minimumDate;
|
|
if (tmp2) {
|
|
tmp2 = null == maximumDate;
|
|
}
|
|
if (!tmp2) {
|
|
let tmp4 = null == obj2;
|
|
if (!tmp4) {
|
|
const time = getTime.getTime();
|
|
tmp4 = time >= obj2.getTime();
|
|
}
|
|
if (tmp4) {
|
|
let tmp6 = null == maximumDate;
|
|
if (!tmp6) {
|
|
const time1 = getTime.getTime();
|
|
tmp6 = time1 <= obj.getTime();
|
|
}
|
|
tmp4 = tmp6;
|
|
obj = maximumDate;
|
|
}
|
|
c10(tmp4);
|
|
const tmp3 = c10;
|
|
}
|
|
_undefined(false);
|
|
callback3(true);
|
|
callback2(getTime);
|
|
}
|
|
});
|
|
const tmp28 = first1;
|
|
obj[1] = intl2.formatToPlainString(maximumDate(1114).t.FsJO55, { minDate: obj4.format(str3) });
|
|
const items1 = [callback(closure_12, obj), , , ];
|
|
if (tmp12) {
|
|
let tmp36 = null == maximumDate;
|
|
if (!tmp36) {
|
|
let time1 = first.getTime();
|
|
tmp36 = time1 <= maximumDate.getTime();
|
|
}
|
|
}
|
|
const obj2 = { show: tmp12, errorText: null };
|
|
const intl3 = tmp29(1114).intl;
|
|
obj1 = { minDate: obj4.format(str3) };
|
|
if ("date" === str) {
|
|
str2 = "L";
|
|
}
|
|
const obj8 = minimumDate(4153)(maximumDate);
|
|
obj2[1] = intl3.formatToPlainString(maximumDate(1114).t.R7r9VN, { maxDate: minimumDate(4153)(maximumDate).format(str2) });
|
|
items1[1] = callback(closure_12, obj2);
|
|
obj4 = { style: tmp3.datetimePickerContainer, children: null };
|
|
const obj3 = { maxDate: minimumDate(4153)(maximumDate).format(str2) };
|
|
const tmp38 = first;
|
|
const tmp13Result = minimumDate(9719);
|
|
let str4 = "dark";
|
|
if (tmp29Result.isThemeLight(tmp15)) {
|
|
str4 = "light";
|
|
}
|
|
obj4[1] = callback(tmp13Result, { theme: str4, date: first, onDateChange: tmp27, maximumDate: date, minimumDate: date1, mode: str });
|
|
items1[2] = callback(tmp38, obj4);
|
|
items1[3] = callback(ActionSheetFooter, { handleCancel: tmp25, handleSubmit: tmp26, canSubmit: first1 });
|
|
obj[2] = items1;
|
|
return tmp28(maximumDate(7150).BottomSheet, obj);
|
|
};
|