@wavemaker/app-rn-runtime 11.14.1-rc.6286 → 11.14.1-rc.6301

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.
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","testID","style","backgroundColor","color","width","marginHorizontal","height","opacity","WMTextInput","forwardRef","ref","_props$customDisplayV","_props$floatingLabel","selectRange","setSelectRange","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","text","_value","substring","slice","formattedValue","replace","valueExpr","opts","customDisplayValue","textStyle","Object","assign","hideInput","Fragment","background","floatingLabel","moveUp","isInputFocused","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","editable","_extends","borderColor","zIndex","autoCapitalize","textTransform","placeholderTextColor","selectable","disabled","multiline","numberOfLines","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","toUpperCase","selectionColor","cursorColor","onChange","contextMenuHidden","onLayout","handleLayout","display","flexDirection","alignItems","marginTop","minHeight","undefined","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View, ViewStyle } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View \n testID=\"wm-custom-cursor\"\n style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle & ViewStyle,\n activeFloatingLabelStyle: TextStyle & ViewStyle,\n customDisplayValue?: string,\n isInputFocused: boolean,\n autoCapitalize?: string,\n background?: React.ReactNode,\n handleLayout?: any,\n style?: ViewStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (defaultValue && !value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = props.customDisplayValue ?? value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.background}\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || props.isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(props.isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n {(Platform.OS === 'android' && !props.editable) ? (\n <Text \n style={[\n props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {},\n props.autoCapitalize ? {textTransform: 'capitalize'} : {},\n (!props.defaultValue && props.placeholder) ? { color: props.placeholderTextColor} : {}\n ]}\n selectable={false}\n disabled={true}\n {...(props.multiline) ? {numberOfLines: props.numberOfLines} : {}}\n >{props.defaultValue || props.placeholder}</Text>\n ) :\n (<TextInput\n {...props}\n {...hideInput || props.customDisplayValue ? opts: {}}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n if(props.autoCapitalize && props.autoCapitalize === 'characters') {\n onChangeText(text.toUpperCase());\n return;\n }\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n autoCapitalize={props.autoCapitalize}\n onLayout={props.handleLayout}\n numberOfLines={1}\n >\n </TextInput>)\n }\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n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C5B,KAAK,CAACoC,aAAa,gBAAInD,KAAK,CAACyB,aAAa,CAACZ,QAAQ,EAAE;IACtEgB,KAAK,EAAEqD,SAAS,CAACrD,KAAK,IAAI,SAAS;IACnCG,MAAM,EAAEkD,SAAS,CAAC8C,QAAQ,IAAI;EAChC,CAAC,CAAC,GAAG,IAEH,CAAC,GACL,IAEN,CAAC;AAET,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","testID","style","backgroundColor","color","width","marginHorizontal","height","opacity","WMTextInput","forwardRef","ref","_props$customDisplayV","_props$floatingLabel","selectRange","setSelectRange","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","text","_value","substring","slice","formattedValue","replace","valueExpr","opts","customDisplayValue","textStyle","Object","assign","hideInput","Fragment","background","floatingLabel","moveUp","isInputFocused","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","editable","_extends","borderColor","zIndex","autoCapitalize","textTransform","placeholderTextColor","selectable","disabled","multiline","numberOfLines","maxLength","undefined","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","toUpperCase","selectionColor","cursorColor","onChange","contextMenuHidden","onLayout","handleLayout","display","flexDirection","alignItems","marginTop","minHeight","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View, ViewStyle } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View \n testID=\"wm-custom-cursor\"\n style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle & ViewStyle,\n activeFloatingLabelStyle: TextStyle & ViewStyle,\n customDisplayValue?: string,\n isInputFocused: boolean,\n autoCapitalize?: string,\n background?: React.ReactNode,\n handleLayout?: any,\n style?: ViewStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (defaultValue && !value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = props.customDisplayValue ?? value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.background}\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || props.isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(props.isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n {(Platform.OS === 'android' && !props.editable) ? (\n <Text \n style={[\n props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {},\n props.autoCapitalize ? {textTransform: 'capitalize'} : {},\n (!props.defaultValue && props.placeholder) ? { color: props.placeholderTextColor} : {}\n ]}\n selectable={false}\n disabled={true}\n {...(props.multiline) ? {numberOfLines: props.numberOfLines} : {}}\n >{props.defaultValue || props.placeholder}</Text>\n ) :\n (<TextInput\n {...props}\n {...hideInput || props.customDisplayValue ? opts: {}}\n {...((props.maxLength !== null) ? { maxLength: props.maxLength } : { maxLength: undefined })}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n if(props.autoCapitalize && props.autoCapitalize === 'characters') {\n onChangeText(text.toUpperCase());\n return;\n }\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n autoCapitalize={props.autoCapitalize}\n onLayout={props.handleLayout}\n numberOfLines={1}\n >\n </TextInput>)\n }\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n </View>\n ) : null\n }\n </>\n );\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrF,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAA6BC,IAAI,QAAmB,cAAc;AAC9G,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,2BAA2B;AAOzD,MAAMC,QAAQ,gBAAGb,KAAK,CAACc,IAAI,CAAEC,KAG5B,IAAK;EACJ,MAAMC,gBAAgB,GAAGb,MAAM,CAAC,IAAIE,QAAQ,CAACY,KAAK,CAAC,GAAG,CAAC,CAAC,CAACC,OAAO;EAChE,MAAMC,YAAY,GAAGlB,WAAW,CAAC,MAAM;IACrCI,QAAQ,CAACe,MAAM,CAACJ,gBAAgB,EAAE;MAChCK,OAAO,EAAE,GAAG;MACZC,QAAQ,EAAE,GAAG;MACbC,eAAe,EAAE;IACnB,CAAC,CAAC,CAACC,KAAK,CAAC,MAAM;MACbnB,QAAQ,CAACe,MAAM,CAACJ,gBAAgB,EAAE;QAChCK,OAAO,EAAE,GAAG;QACZC,QAAQ,EAAE,GAAG;QACbC,eAAe,EAAE;MACnB,CAAC,CAAC,CAACC,KAAK,CAACL,YAAY,CAAC;IACxB,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EACNjB,SAAS,CAAC,MAAM;IACdiB,YAAY,CAAC,CAAC;EAChB,CAAC,EAAE,EAAE,CAAC;EACN,oBACEnB,KAAA,CAAAyB,aAAA,CAACpB,QAAQ,CAACI,IAAI;IACdiB,MAAM,EAAC,kB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E,aAAa;MAC9BqE,WAAW,EAAE,aAAa;MAC1B8B,OAAO,EAAE,CAAC;MACVL,OAAO,EAAE,MAAM;MACf7F,KAAK,EAAEqD,SAAS,CAACrD,KAAK;MACtBmG,UAAU,EAAE9C,SAAS,CAAC8C,UAAU;MAChCC,QAAQ,EAAE/C,SAAS,CAAC+C,QAAQ;MAC5BC,UAAU,EAAEhD,SAAS,CAACgD;IACtB;EAAE,GACDlF,YACG,CAAC,EAEJL,aAAa,IAAI,CAAC5B,KAAK,CAACoC,aAAa,gBAAInD,KAAK,CAACyB,aAAa,CAACZ,QAAQ,EAAE;IACtEgB,KAAK,EAAEqD,SAAS,CAACrD,KAAK,IAAI,SAAS;IACnCG,MAAM,EAAEkD,SAAS,CAAC+C,QAAQ,IAAI;EAChC,CAAC,CAAC,GAAG,IAEH,CAAC,GACL,IAEN,CAAC;AAET,CAAC,CAAC","ignoreList":[]}
@@ -2,7 +2,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import React from "react";
5
- import { View, Animated } from "react-native";
5
+ import { View, Animated, Keyboard, TextInput, findNodeHandle } from "react-native";
6
6
  import { ThemeProvider } from "../styles/theme";
7
7
  const FixedViewContext = /*#__PURE__*/React.createContext(null);
8
8
  export class FixedView extends React.Component {
@@ -11,6 +11,22 @@ export class FixedView extends React.Component {
11
11
  _defineProperty(this, "container", null);
12
12
  _defineProperty(this, "cachedComponent", void 0);
13
13
  _defineProperty(this, "id", FixedView.counter++);
14
+ /**
15
+ *
16
+ * Capture the touch before it reaches child Touchables
17
+ */
18
+ _defineProperty(this, "handleStartShouldSetResponderCapture", event => {
19
+ var _event$nativeEvent;
20
+ const textInputState = TextInput.State;
21
+ const focusedInput = textInputState !== null && textInputState !== void 0 && textInputState.currentlyFocusedInput ? textInputState.currentlyFocusedInput() : null;
22
+ const focusedHandle = focusedInput ? findNodeHandle(focusedInput) : textInputState !== null && textInputState !== void 0 && textInputState.currentlyFocusedInput ? textInputState.currentlyFocusedInput() : null;
23
+ if (focusedHandle && (event === null || event === void 0 || (_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 ? void 0 : _event$nativeEvent.target) === focusedHandle) {
24
+ // Should not dismiss keyboard if the user presses on the same text input that is already focused
25
+ return false;
26
+ }
27
+ Keyboard.dismiss();
28
+ return false; // let the touch reach the child Touchables
29
+ });
14
30
  }
15
31
  componentWillUnmount() {
16
32
  this.container.remove(this);
@@ -27,7 +43,8 @@ export class FixedView extends React.Component {
27
43
  style: [{
28
44
  position: 'absolute'
29
45
  }, this.props.style],
30
- testID: `${this.props.name}-fixed-view`
46
+ testID: `${this.props.name}-fixed-view`,
47
+ onStartShouldSetResponderCapture: this.handleStartShouldSetResponderCapture
31
48
  }, this.props.children)));
32
49
  } else {
33
50
  container.remove(this);
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Animated","ThemeProvider","FixedViewContext","createContext","FixedView","Component","constructor","props","_defineProperty","counter","componentWillUnmount","container","remove","render","WrapperView","animated","cachedComponent","usememo","createElement","Consumer","show","add","value","theme","key","id","style","position","testID","name","children","Fragment","Date","now","FixedViewContainer","args","Map","c","n","set","setTimeout","setState","delete","Provider","Array","from","values"],"sources":["fixed-view.component.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { View, ViewStyle, Animated } from \"react-native\";\nimport { Theme, ThemeProvider } from \"../styles/theme\";\n\nconst FixedViewContext = React.createContext<FixedViewContainer>(null as any);\n\nexport interface FixedViewProps {\n name?: string;\n style?: ViewStyle,\n show?: boolean;\n theme: Theme;\n usememo?: boolean;\n children?: any;\n animated?: boolean;\n}\n\nexport class FixedView extends React.Component<FixedViewProps> {\n static defaultProps = {\n show: true, \n animated: false\n };\n static counter = Date.now();\n container: FixedViewContainer = null as any;\n cachedComponent: React.ReactNode;\n id = FixedView.counter++;\n\n constructor(props: FixedViewProps) {\n super(props);\n }\n\n componentWillUnmount() {\n this.container.remove(this);\n }\n\n render() {\n const WrapperView = this.props.animated ? Animated.View : View\n this.cachedComponent = (this.props.usememo === true && this.cachedComponent ) || (<FixedViewContext.Consumer>\n {(container) => {\n this.container = container;\n if (this.props.show) {\n container.add(this, (\n <ThemeProvider value={this.props.theme} key={this.id}>\n <WrapperView style={[\n {position: 'absolute'},\n this.props.style]}\n testID={`${this.props.name}-fixed-view`}\n >\n {this.props.children}\n </WrapperView>\n </ThemeProvider>\n ));\n } else {\n container.remove(this);\n }\n return <></>;\n }}\n </FixedViewContext.Consumer>);\n return this.cachedComponent;\n }\n}\n\nexport class FixedViewContainer extends React.Component {\n children: Map<FixedView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: FixedView, n : React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n remove(c: FixedView) {\n this.children.delete(c);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n render() {\n return (\n <FixedViewContext.Provider value={this}>\n {(this.props as any).children}\n {Array.from(this.children.values())}\n </FixedViewContext.Provider>\n ) ;\n }\n};"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAaC,QAAQ,QAAQ,cAAc;AACxD,SAAgBC,aAAa,QAAQ,iBAAiB;AAEtD,MAAMC,gBAAgB,gBAAGJ,KAAK,CAACK,aAAa,CAAqB,IAAW,CAAC;AAY7E,OAAO,MAAMC,SAAS,SAASN,KAAK,CAACO,SAAS,CAAiB;EAU3DC,WAAWA,CAACC,KAAqB,EAAE;IAC/B,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBALe,IAAI;IAAAA,eAAA;IAAAA,eAAA,aAE/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AC;AAAAP,eAAA,CAJQJ,SAAS,aAKD4B,IAAI,CAACC,GAAG,CAAC,CAAC;AAwC/B,OAAO,MAAMC,kBAAkB,SAASpC,KAAK,CAACO,SAAS,CAAC;EAAAC,YAAA,GAAA6B,IAAA;IAAA,SAAAA,IAAA;IAAA3B,eAAA,mBACR,IAAI4B,GAAG,CAAC,CAAC;IAAA5B,eAAA,aAChD,CAAC;EAAA;EAENa,GAAGA,CAACgB,CAAY,EAAEC,CAAmB,EAAE;IACnC,IAAI,CAACR,QAAQ,CAACS,GAAG,CAACF,CAAC,EAAEC,CAAC,CAAC;IACvBE,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,CAAC;MAAChB,EAAE,EAAE,EAAE,IAAI,CAACA;IAAE,CAAC,CAAC,CAAC;EACpD;EAEAb,MAAMA,CAACyB,CAAY,EAAE;IACjB,IAAI,CAACP,QAAQ,CAACY,MAAM,CAACL,CAAC,CAAC;IACvBG,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,CAAC;MAAChB,EAAE,EAAE,EAAE,IAAI,CAACA;IAAE,CAAC,CAAC,CAAC;EACpD;EAEAZ,MAAMA,CAAA,EAAG;IACL,oBACIf,KAAA,CAAAoB,aAAA,CAAChB,gBAAgB,CAACyC,QAAQ;MAACrB,KAAK,EAAE;IAAK,GACjC,IAAI,CAACf,KAAK,CAASuB,QAAQ,EAC5Bc,KAAK,CAACC,IAAI,CAAC,IAAI,CAACf,QAAQ,CAACgB,MAAM,CAAC,CAAC,CACX,CAAC;EAEpC;AACJ;AAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Animated","Keyboard","TextInput","findNodeHandle","ThemeProvider","FixedViewContext","createContext","FixedView","Component","constructor","props","_defineProperty","counter","event","_event$nativeEvent","textInputState","State","focusedInput","currentlyFocusedInput","focusedHandle","nativeEvent","target","dismiss","componentWillUnmount","container","remove","render","WrapperView","animated","cachedComponent","usememo","createElement","Consumer","show","add","value","theme","key","id","style","position","testID","name","onStartShouldSetResponderCapture","handleStartShouldSetResponderCapture","children","Fragment","Date","now","FixedViewContainer","args","Map","c","n","set","setTimeout","setState","delete","Provider","Array","from","values"],"sources":["fixed-view.component.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { View, ViewStyle, Animated, Keyboard, TextInput, findNodeHandle, GestureResponderEvent } from \"react-native\";\nimport { Theme, ThemeProvider } from \"../styles/theme\";\n\nconst FixedViewContext = React.createContext<FixedViewContainer>(null as any);\n\nexport interface FixedViewProps {\n name?: string;\n style?: ViewStyle,\n show?: boolean;\n theme: Theme;\n usememo?: boolean;\n children?: any;\n animated?: boolean;\n}\n\nexport class FixedView extends React.Component<FixedViewProps> {\n static defaultProps = {\n show: true, \n animated: false\n };\n static counter = Date.now();\n container: FixedViewContainer = null as any;\n cachedComponent: React.ReactNode;\n id = FixedView.counter++;\n\n constructor(props: FixedViewProps) {\n super(props);\n }\n\n /**\n * \n * Capture the touch before it reaches child Touchables\n */\n handleStartShouldSetResponderCapture = (event: GestureResponderEvent) => {\n const textInputState = TextInput.State as any;\n const focusedInput = textInputState?.currentlyFocusedInput ? textInputState.currentlyFocusedInput() : null;\n const focusedHandle = focusedInput\n ? findNodeHandle(focusedInput)\n : textInputState?.currentlyFocusedInput\n ? textInputState.currentlyFocusedInput()\n : null;\n\n if (focusedHandle && event?.nativeEvent?.target === focusedHandle) {\n // Should not dismiss keyboard if the user presses on the same text input that is already focused\n return false;\n }\n\n Keyboard.dismiss();\n return false; // let the touch reach the child Touchables\n };\n\n componentWillUnmount() {\n this.container.remove(this);\n }\n\n render() {\n const WrapperView = this.props.animated ? Animated.View : View\n this.cachedComponent = (this.props.usememo === true && this.cachedComponent ) || (<FixedViewContext.Consumer>\n {(container) => {\n this.container = container;\n if (this.props.show) {\n container.add(this, (\n <ThemeProvider value={this.props.theme} key={this.id}>\n <WrapperView style={[\n {position: 'absolute'},\n this.props.style]}\n testID={`${this.props.name}-fixed-view`}\n onStartShouldSetResponderCapture={this.handleStartShouldSetResponderCapture}\n >\n {this.props.children}\n </WrapperView>\n </ThemeProvider>\n ));\n } else {\n container.remove(this);\n }\n return <></>;\n }}\n </FixedViewContext.Consumer>);\n return this.cachedComponent;\n }\n}\n\nexport class FixedViewContainer extends React.Component {\n children: Map<FixedView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: FixedView, n : React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n remove(c: FixedView) {\n this.children.delete(c);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n render() {\n return (\n <FixedViewContext.Provider value={this}>\n {(this.props as any).children}\n {Array.from(this.children.values())}\n </FixedViewContext.Provider>\n ) ;\n }\n};"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAaC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,cAAc,QAA+B,cAAc;AACpH,SAAgBC,aAAa,QAAQ,iBAAiB;AAEtD,MAAMC,gBAAgB,gBAAGP,KAAK,CAACQ,aAAa,CAAqB,IAAW,CAAC;AAY7E,OAAO,MAAMC,SAAS,SAAST,KAAK,CAACU,SAAS,CAAiB;EAU3DC,WAAWA,CAACC,KAAqB,EAAE;IAC/B,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBALe,IAAI;IAAAA,eAAA;IAAAA,eAAA,aAE/BJ,SAAS,CAACK,OAAO,EAAE;IAMxB;AACJ;AACA;AACA;IAHID,eAAA,+CAIwCE,KAA4B,IAAK;MAAA,IAAAC,kBAAA;MACrE,MAAMC,cAAc,GAAGb,SAAS,CAACc,KAAY;MAC7C,MAAMC,YAAY,GAAGF,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAEG,qBAAqB,GAAGH,cAAc,CAACG,qBAAqB,CAAC,CAAC,GAAG,IAAI;MAC1G,MAAMC,aAAa,GAAGF,YAAY,GAC5Bd,cAAc,CAACc,YAAY,CAAC,GAC5BF,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAE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