native-pytech 1.0.90 → 1.0.92

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, ...props }: Props) => React.JSX.Element>;
4
4
  export default _default;
@@ -1,8 +1,7 @@
1
- import { Stack, useRouter } from "expo-router";
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', ...props }) => {
6
5
  const _onSelectionChange = async (selection) => {
7
6
  await onSelectionChange?.(selection);
8
7
  router.back();
@@ -14,7 +13,7 @@ export default memo(({ children, onChangeSearchText, onSelectionChange, ...props
14
13
  </Stack.Toolbar.Button>
15
14
  </Stack.Toolbar>
16
15
 
17
- <Stack.SearchBar placeholder="Buscar usuario" onChangeText={(e) => onChangeSearchText(e.nativeEvent.text)}/>
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,11 @@ 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;
18
23
  /**
19
24
  Adjusts the row insets on ios.
20
25
  Is is useful when uses items with gradients.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",