Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
376 lines
13 KiB
JavaScript
376 lines
13 KiB
JavaScript
// Module ID: 428
|
|
// Function ID: 429
|
|
// Dependencies: [109, 41, 42, 93, 95, 98, 19, 21, 292, 273, 108, 254]
|
|
|
|
// Module 428
|
|
import _objectWithoutProperties from "_objectWithoutProperties" /* 109 */;
|
|
import _classCallCheck from "_classCallCheck" /* 41 */;
|
|
import _createClass from "_createClass" /* 42 */;
|
|
import hasOwnProperty from "_possibleConstructorReturn" /* 93 */;
|
|
import _getPrototypeOf from "_getPrototypeOf" /* 95 */;
|
|
import _inherits from "_inherits" /* 98 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const TouchableHighlightImpl = importDefault;
|
|
function _isNativeReflectConstruct() {
|
|
try {
|
|
const _Boolean = Boolean;
|
|
const call = valueOf.call;
|
|
const _Reflect = Reflect;
|
|
const _Boolean2 = Boolean;
|
|
if (typeof call === "unknown") {
|
|
let callResult = valueOf();
|
|
} else {
|
|
callResult = call(constructResult);
|
|
}
|
|
closure_0 = !callResult;
|
|
_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
return closure_0;
|
|
};
|
|
return _isNativeReflectConstruct();
|
|
} catch (err) {
|
|
}
|
|
}
|
|
let closure_2 = ["onBlur", "onFocus"];
|
|
const cloneElement = fn(19).cloneElement;
|
|
const jsxProd = fn(21);
|
|
({ jsx: closure_9, jsxs: c10 } = jsxProd);
|
|
class TouchableHighlightImpl {
|
|
constructor() {
|
|
self = this;
|
|
items = [...arguments];
|
|
tmp = closure_4(this, TouchableHighlightImpl);
|
|
items1 = [...items];
|
|
tmp2 = metroRequire;
|
|
obj = metroRequire(TouchableHighlightImpl);
|
|
tmp3 = hasOwnProperty;
|
|
if (closure_11()) {
|
|
tmp5 = globalThis;
|
|
_Reflect = Reflect;
|
|
constructResult = Reflect.construct(obj, items1, tmp2(self).constructor);
|
|
} else {
|
|
constructResult = obj.apply(self, items1);
|
|
}
|
|
tmp3Result = tmp3(self, constructResult);
|
|
tmp3Result._isMounted = false;
|
|
obj1 = { pressability: null, extraStyles: null };
|
|
tmp6 = closure_0(closure_1[8]);
|
|
tmp61 = new tmp6(tmp3Result._createPressabilityConfig());
|
|
obj1.pressability = tmp61;
|
|
_createExtraStylesResult = null;
|
|
if (true === tmp3Result.props.testOnly_pressed) {
|
|
_createExtraStylesResult = tmp3Result._createExtraStyles();
|
|
}
|
|
obj1.extraStyles = _createExtraStylesResult;
|
|
tmp3Result.state = obj1;
|
|
return tmp3Result;
|
|
}
|
|
}
|
|
_inherits(TouchableHighlightImpl, noop.Component);
|
|
const entry = {
|
|
key: "_createPressabilityConfig",
|
|
value: function _createPressabilityConfig() {
|
|
const self = this;
|
|
const obj = { cancelable: !this.props.rejectResponderTermination, disabled: null, hitSlop: null, delayLongPress: null, delayPressIn: null, delayPressOut: null, minPressDuration: 0, pressRectOffset: null, android_disableSound: null, onBlur: null, onFocus: null, onLongPress: null, onPress: null, onPressIn: null, onPressOut: null };
|
|
if (null != this.props.disabled) {
|
|
let disabled = self.props.disabled;
|
|
} else {
|
|
const accessibilityState = self.props.accessibilityState;
|
|
if (accessibilityState != null) {
|
|
disabled = accessibilityState.disabled;
|
|
}
|
|
}
|
|
obj.disabled = disabled;
|
|
obj.hitSlop = self.props.hitSlop;
|
|
obj.delayLongPress = self.props.delayLongPress;
|
|
obj.delayPressIn = self.props.delayPressIn;
|
|
obj.delayPressOut = self.props.delayPressOut;
|
|
obj.pressRectOffset = self.props.pressRetentionOffset;
|
|
obj.android_disableSound = self.props.touchSoundDisabled;
|
|
obj.onBlur = function onBlur(arg0) {
|
|
if (TouchableHighlightImpl(273).isTV) {
|
|
self._hideUnderlay();
|
|
}
|
|
if (null != self.props.onBlur) {
|
|
const props = tmp3.props;
|
|
props.onBlur(arg0);
|
|
}
|
|
};
|
|
obj.onFocus = function onFocus(arg0) {
|
|
if (TouchableHighlightImpl(273).isTV) {
|
|
self._showUnderlay();
|
|
}
|
|
if (null != self.props.onFocus) {
|
|
const props = tmp3.props;
|
|
props.onFocus(arg0);
|
|
}
|
|
};
|
|
obj.onLongPress = self.props.onLongPress;
|
|
obj.onPress = function onPress(arg0) {
|
|
if (null != self._hideTimeout) {
|
|
const _clearTimeout = clearTimeout;
|
|
clearTimeout(obj._hideTimeout);
|
|
}
|
|
if (!TouchableHighlightImpl(273).isTV) {
|
|
obj._showUnderlay();
|
|
let num = obj.props.delayPressOut;
|
|
if (num == null) {
|
|
num = 0;
|
|
}
|
|
obj._hideTimeout = setTimeout(() => {
|
|
self._hideUnderlay();
|
|
}, num);
|
|
}
|
|
if (null != self.props.onPress) {
|
|
const props = obj.props;
|
|
props.onPress(arg0);
|
|
}
|
|
};
|
|
obj.onPressIn = function onPressIn(arg0) {
|
|
if (null != self._hideTimeout) {
|
|
const _clearTimeout = clearTimeout;
|
|
clearTimeout(obj._hideTimeout);
|
|
obj._hideTimeout = null;
|
|
}
|
|
self._showUnderlay();
|
|
if (null != self.props.onPressIn) {
|
|
const props = obj.props;
|
|
props.onPressIn(arg0);
|
|
}
|
|
};
|
|
obj.onPressOut = function onPressOut(arg0) {
|
|
if (null == self._hideTimeout) {
|
|
obj._hideUnderlay();
|
|
}
|
|
if (null != self.props.onPressOut) {
|
|
const props = obj.props;
|
|
props.onPressOut(arg0);
|
|
}
|
|
};
|
|
return obj;
|
|
}
|
|
};
|
|
let items = [
|
|
entry,
|
|
{
|
|
key: "_createExtraStyles",
|
|
value: function _createExtraStyles() {
|
|
const self = this;
|
|
let num = this.props.activeOpacity;
|
|
if (num == null) {
|
|
num = 0.85;
|
|
}
|
|
const obj = { child: { opacity: num }, underlay: null };
|
|
let str = "black";
|
|
if (undefined !== self.props.underlayColor) {
|
|
str = self.props.underlayColor;
|
|
}
|
|
obj.underlay = { backgroundColor: str };
|
|
return obj;
|
|
}
|
|
},
|
|
{
|
|
key: "_showUnderlay",
|
|
value: function _showUnderlay() {
|
|
const self = this;
|
|
if (tmp) {
|
|
const obj = { extraStyles: self._createExtraStyles() };
|
|
self.setState(obj);
|
|
if (null != self.props.onShowUnderlay) {
|
|
const props = self.props;
|
|
props.onShowUnderlay();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
key: "_hideUnderlay",
|
|
value: function _hideUnderlay() {
|
|
const self = this;
|
|
if (null != this._hideTimeout) {
|
|
const _clearTimeout = clearTimeout;
|
|
clearTimeout(self._hideTimeout);
|
|
self._hideTimeout = null;
|
|
}
|
|
if (tmp3) {
|
|
self.setState({ extraStyles: null });
|
|
if (null != self.props.onHideUnderlay) {
|
|
const props = self.props;
|
|
props.onHideUnderlay();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
key: "_hasPressHandler",
|
|
value: function _hasPressHandler() {
|
|
const self = this;
|
|
return null != this.props.onPress || null != self.props.onPressIn || null != self.props.onPressOut || null != self.props.onLongPress;
|
|
}
|
|
},
|
|
{
|
|
key: "render",
|
|
value: function render() {
|
|
const self = this;
|
|
const Children = noop.Children;
|
|
const onlyResult = Children.only(this.props.children);
|
|
const pressability = this.state.pressability;
|
|
const eventHandlers = pressability.getEventHandlers();
|
|
({ onBlur, onFocus } = eventHandlers);
|
|
if (null != this.props.disabled) {
|
|
const obj = {};
|
|
const merged = Object.assign(self.props.accessibilityState);
|
|
obj.disabled = self.props.disabled;
|
|
let accessibilityState = obj;
|
|
} else {
|
|
accessibilityState = self.props.accessibilityState;
|
|
}
|
|
let prop = self.props["aria-valuemax"];
|
|
if (prop == null) {
|
|
const accessibilityValue = self.props.accessibilityValue;
|
|
let max;
|
|
if (accessibilityValue != null) {
|
|
max = accessibilityValue.max;
|
|
}
|
|
prop = max;
|
|
}
|
|
const range = { max: prop, min: null, now: null, text: null };
|
|
let prop1 = self.props["aria-valuemin"];
|
|
if (prop1 == null) {
|
|
const accessibilityValue2 = self.props.accessibilityValue;
|
|
let min;
|
|
if (accessibilityValue2 != null) {
|
|
min = accessibilityValue2.min;
|
|
}
|
|
prop1 = min;
|
|
}
|
|
range.min = prop1;
|
|
let prop2 = self.props["aria-valuenow"];
|
|
if (prop2 == null) {
|
|
const accessibilityValue3 = self.props.accessibilityValue;
|
|
let now;
|
|
if (accessibilityValue3 != null) {
|
|
now = accessibilityValue3.now;
|
|
}
|
|
prop2 = now;
|
|
}
|
|
range.now = prop2;
|
|
let prop3 = self.props["aria-valuetext"];
|
|
if (prop3 == null) {
|
|
const accessibilityValue4 = self.props.accessibilityValue;
|
|
let text;
|
|
if (accessibilityValue4 != null) {
|
|
text = accessibilityValue4.text;
|
|
}
|
|
prop3 = text;
|
|
}
|
|
range.text = prop3;
|
|
let str = "none";
|
|
if ("off" !== self.props["aria-live"]) {
|
|
let accessibilityLiveRegion = self.props["aria-live"];
|
|
if (accessibilityLiveRegion == null) {
|
|
accessibilityLiveRegion = self.props.accessibilityLiveRegion;
|
|
}
|
|
str = accessibilityLiveRegion;
|
|
}
|
|
let accessibilityLabel = self.props["aria-label"];
|
|
if (accessibilityLabel == null) {
|
|
accessibilityLabel = self.props.accessibilityLabel;
|
|
}
|
|
const obj2 = { accessible: false !== self.props.accessible, accessibilityLabel, accessibilityHint: self.props.accessibilityHint, accessibilityLanguage: self.props.accessibilityLanguage, accessibilityRole: self.props.accessibilityRole, accessibilityState, accessibilityValue: range, accessibilityActions: self.props.accessibilityActions, onAccessibilityAction: self.props.onAccessibilityAction, importantForAccessibility: null, accessibilityViewIsModal: null, accessibilityLiveRegion: null, accessibilityElementsHidden: null, style: null, onLayout: null, hitSlop: null, hasTVPreferredFocus: null, nextFocusDown: null, nextFocusForward: null, nextFocusLeft: null, nextFocusRight: null, nextFocusUp: null, focusable: null, nativeID: null, testID: null, ref: null };
|
|
let str2 = "no-hide-descendants";
|
|
const tmp14 = closure_1_10;
|
|
const tmp3 = _objectWithoutProperties(eventHandlers, closure_2);
|
|
if (true !== self.props["aria-hidden"]) {
|
|
str2 = self.props.importantForAccessibility;
|
|
}
|
|
obj2.importantForAccessibility = str2;
|
|
let accessibilityViewIsModal = self.props["aria-modal"];
|
|
if (accessibilityViewIsModal == null) {
|
|
accessibilityViewIsModal = self.props.accessibilityViewIsModal;
|
|
}
|
|
obj2.accessibilityViewIsModal = accessibilityViewIsModal;
|
|
obj2.accessibilityLiveRegion = str;
|
|
let accessibilityElementsHidden = self.props["aria-hidden"];
|
|
if (accessibilityElementsHidden == null) {
|
|
accessibilityElementsHidden = self.props.accessibilityElementsHidden;
|
|
}
|
|
obj2.accessibilityElementsHidden = accessibilityElementsHidden;
|
|
const tmp17 = TouchableHighlightImpl(108);
|
|
const extraStyles = self.state.extraStyles;
|
|
let underlay;
|
|
if (extraStyles != null) {
|
|
underlay = extraStyles.underlay;
|
|
}
|
|
obj2.style = TouchableHighlightImpl(254).compose(self.props.style, underlay);
|
|
obj2.onLayout = self.props.onLayout;
|
|
obj2.hitSlop = self.props.hitSlop;
|
|
obj2.hasTVPreferredFocus = self.props.hasTVPreferredFocus;
|
|
obj2.nextFocusDown = self.props.nextFocusDown;
|
|
obj2.nextFocusForward = self.props.nextFocusForward;
|
|
obj2.nextFocusLeft = self.props.nextFocusLeft;
|
|
obj2.nextFocusRight = self.props.nextFocusRight;
|
|
obj2.nextFocusUp = self.props.nextFocusUp;
|
|
obj2.focusable = false !== self.props.focusable && undefined !== self.props.onPress && !self.props.disabled;
|
|
let nativeID = self.props.id;
|
|
if (nativeID == null) {
|
|
nativeID = self.props.nativeID;
|
|
}
|
|
obj2.nativeID = nativeID;
|
|
obj2.testID = self.props.testID;
|
|
obj2.ref = self.props.hostRef;
|
|
const merged1 = Object.assign(tmp3);
|
|
const tmp15Result = TouchableHighlightImpl(254);
|
|
const tmp20 = cloneElement;
|
|
const extraStyles2 = self.state.extraStyles;
|
|
let child;
|
|
if (extraStyles2 != null) {
|
|
child = extraStyles2.child;
|
|
}
|
|
const tmp15Result2 = TouchableHighlightImpl(254);
|
|
const items = [tmp20(onlyResult, { style: TouchableHighlightImpl(254).compose(onlyResult.props.style, child) }), null];
|
|
obj2.children = items;
|
|
return tmp14(tmp17, obj2);
|
|
}
|
|
},
|
|
{
|
|
key: "componentDidMount",
|
|
value: function componentDidMount() {
|
|
this._isMounted = true;
|
|
const pressability = this.state.pressability;
|
|
pressability.configure(this._createPressabilityConfig());
|
|
}
|
|
},
|
|
{
|
|
key: "componentDidUpdate",
|
|
value: function componentDidUpdate(arg0, arg1) {
|
|
const pressability = this.state.pressability;
|
|
pressability.configure(this._createPressabilityConfig());
|
|
}
|
|
},
|
|
{
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
const self = this;
|
|
this._isMounted = false;
|
|
if (null != this._hideTimeout) {
|
|
const _clearTimeout = clearTimeout;
|
|
clearTimeout(self._hideTimeout);
|
|
}
|
|
const pressability = self.state.pressability;
|
|
pressability.reset();
|
|
}
|
|
}
|
|
];
|
|
let closure_12 = _createClass(TouchableHighlightImpl, items);
|
|
class TouchableHighlight {
|
|
constructor(arg0) {
|
|
obj = {};
|
|
merged = Object.assign(Object.assign(global, Object.assign({ ref: 0 })));
|
|
obj.hostRef = global.ref;
|
|
return jsx(closure_12, obj);
|
|
}
|
|
}
|
|
TouchableHighlight.displayName = "TouchableHighlight";
|
|
|
|
export default TouchableHighlight;
|