native-pytech 1.0.90 → 1.0.91
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.
|
@@ -51,34 +51,34 @@ function Component({ data = [], renderItem, onSave, }) {
|
|
|
51
51
|
isUniqueItem: (data?.length ?? 0) === 1,
|
|
52
52
|
textFieldsRefs
|
|
53
53
|
}), []);
|
|
54
|
-
return (<>
|
|
55
|
-
<Stack.Toolbar placement="left">
|
|
56
|
-
<Stack.Toolbar.Button onPress={() => router.back()}>
|
|
57
|
-
<Stack.Toolbar.Icon sf="xmark"/>
|
|
58
|
-
</Stack.Toolbar.Button>
|
|
59
|
-
</Stack.Toolbar>
|
|
60
|
-
|
|
61
|
-
<Stack.Toolbar placement="right">
|
|
62
|
-
<Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
|
|
63
|
-
<Stack.Toolbar.Icon sf="checkmark"/>
|
|
64
|
-
</Stack.Toolbar.Button>
|
|
65
|
-
</Stack.Toolbar>
|
|
66
|
-
|
|
67
|
-
<Host style={{ flex: 1 }}>
|
|
68
|
-
<List>
|
|
69
|
-
<Section>
|
|
70
|
-
<Provider value={value}>
|
|
54
|
+
return (<>
|
|
55
|
+
<Stack.Toolbar placement="left">
|
|
56
|
+
<Stack.Toolbar.Button onPress={() => router.back()}>
|
|
57
|
+
<Stack.Toolbar.Icon sf="xmark"/>
|
|
58
|
+
</Stack.Toolbar.Button>
|
|
59
|
+
</Stack.Toolbar>
|
|
60
|
+
|
|
61
|
+
<Stack.Toolbar placement="right">
|
|
62
|
+
<Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
|
|
63
|
+
<Stack.Toolbar.Icon sf="checkmark"/>
|
|
64
|
+
</Stack.Toolbar.Button>
|
|
65
|
+
</Stack.Toolbar>
|
|
66
|
+
|
|
67
|
+
<Host style={{ flex: 1 }}>
|
|
68
|
+
<List>
|
|
69
|
+
<Section>
|
|
70
|
+
<Provider value={value}>
|
|
71
71
|
{data.map((item, index) => {
|
|
72
72
|
const nextIndex = index + 1;
|
|
73
73
|
const value = { index, nextIndex: nextIndex < data.length ? nextIndex : undefined };
|
|
74
|
-
return (<ItemProvider key={index} value={value}>
|
|
75
|
-
{renderItem?.(item)}
|
|
74
|
+
return (<ItemProvider key={index} value={value}>
|
|
75
|
+
{renderItem?.(item)}
|
|
76
76
|
</ItemProvider>);
|
|
77
|
-
})}
|
|
78
|
-
</Provider>
|
|
79
|
-
</Section>
|
|
80
|
-
</List>
|
|
81
|
-
</Host>
|
|
77
|
+
})}
|
|
78
|
+
</Provider>
|
|
79
|
+
</Section>
|
|
80
|
+
</List>
|
|
81
|
+
</Host>
|
|
82
82
|
</>);
|
|
83
83
|
}
|
|
84
84
|
export default memo(Component);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type Props from './types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ children, onChangeSearchText, onSelectionChange, ...props }: Props) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ children, onChangeSearchText, onSelectionChange, placeholderSearchBar, onPressHeaderCancel, ...props }: Props) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { Stack,
|
|
1
|
+
import { Stack, router } from "expo-router";
|
|
2
2
|
import React, { memo } from "react";
|
|
3
3
|
import Content from '../Content';
|
|
4
|
-
export default memo(({ children, onChangeSearchText, onSelectionChange, ...props }) => {
|
|
5
|
-
const router = useRouter();
|
|
4
|
+
export default memo(({ children, onChangeSearchText, onSelectionChange, placeholderSearchBar = 'Buscar', onPressHeaderCancel = () => router.back(), ...props }) => {
|
|
6
5
|
const _onSelectionChange = async (selection) => {
|
|
7
6
|
await onSelectionChange?.(selection);
|
|
8
7
|
router.back();
|
|
9
8
|
};
|
|
10
9
|
return (<>
|
|
11
10
|
<Stack.Toolbar placement="right">
|
|
12
|
-
<Stack.Toolbar.Button onPress={
|
|
11
|
+
<Stack.Toolbar.Button onPress={onPressHeaderCancel}>
|
|
13
12
|
<Stack.Toolbar.Icon sf="xmark"/>
|
|
14
13
|
</Stack.Toolbar.Button>
|
|
15
14
|
</Stack.Toolbar>
|
|
16
15
|
|
|
17
|
-
<Stack.SearchBar placeholder=
|
|
16
|
+
<Stack.SearchBar placeholder={placeholderSearchBar} onChangeText={(e) => onChangeSearchText(e.nativeEvent.text)}/>
|
|
18
17
|
|
|
19
18
|
<Content onSelectionChange={_onSelectionChange} {...props}>
|
|
20
19
|
{children}
|
|
@@ -15,6 +15,16 @@ type Props = {
|
|
|
15
15
|
Function to be called when the user selects a selection.
|
|
16
16
|
*/
|
|
17
17
|
onSelectionChange?: (selection: string) => void | Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
Placeholder for the search bar.
|
|
20
|
+
@default 'Buscar'
|
|
21
|
+
*/
|
|
22
|
+
placeholderSearchBar?: string;
|
|
23
|
+
/**
|
|
24
|
+
Function to be called when the user press the cancel button on the header.
|
|
25
|
+
@default () => router.back()
|
|
26
|
+
*/
|
|
27
|
+
onPressHeaderCancel?: () => void;
|
|
18
28
|
/**
|
|
19
29
|
Adjusts the row insets on ios.
|
|
20
30
|
Is is useful when uses items with gradients.
|