native-pytech 1.0.126 → 1.0.130

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.
Files changed (25) hide show
  1. package/dist/libs/pickerPage/index.d.ts +2 -2
  2. package/dist/libs/pickerPage/index.js +2 -2
  3. package/dist/libs/pickerPage/src/components/Content/index.d.ts +4 -0
  4. package/dist/libs/pickerPage/src/{Content → components/Content}/index.ios.js +1 -1
  5. package/dist/libs/pickerPage/src/components/Content/index.js +14 -0
  6. package/dist/libs/pickerPage/src/components/Item/index.d.ts +4 -0
  7. package/dist/libs/pickerPage/src/{Item → components/Item}/index.ios.d.ts +1 -1
  8. package/dist/libs/pickerPage/src/{Item → components/Item}/index.ios.js +1 -1
  9. package/dist/libs/pickerPage/src/components/Item/index.js +14 -0
  10. package/dist/libs/pickerPage/src/{Item → components/Item}/types.d.ts +5 -0
  11. package/dist/libs/pickerPage/src/{Page → components/Page}/index.js +1 -1
  12. package/dist/libs/pickerPage/src/{Page → components/Page}/types.d.ts +4 -4
  13. package/dist/libs/pickerPage/src/context/page.d.ts +7 -0
  14. package/dist/libs/pickerPage/src/context/page.js +2 -0
  15. package/package.json +1 -1
  16. package/dist/libs/pickerPage/src/Content/index.d.ts +0 -3
  17. package/dist/libs/pickerPage/src/Content/index.js +0 -1
  18. package/dist/libs/pickerPage/src/Item/index.d.ts +0 -3
  19. package/dist/libs/pickerPage/src/Item/index.js +0 -1
  20. /package/dist/libs/pickerPage/src/{Content → components/Content}/index.ios.d.ts +0 -0
  21. /package/dist/libs/pickerPage/src/{Content → components/Content}/types.d.ts +0 -0
  22. /package/dist/libs/pickerPage/src/{Content → components/Content}/types.js +0 -0
  23. /package/dist/libs/pickerPage/src/{Item → components/Item}/types.js +0 -0
  24. /package/dist/libs/pickerPage/src/{Page → components/Page}/index.d.ts +0 -0
  25. /package/dist/libs/pickerPage/src/{Page → components/Page}/types.js +0 -0
@@ -1,5 +1,5 @@
1
- import Page from './src/Page';
2
- import Item from './src/Item';
1
+ import Page from './src/components/Page';
2
+ import Item from './src/components/Item';
3
3
  type PickerPageComponent = typeof Page & {
4
4
  Item: typeof Item;
5
5
  };
@@ -1,5 +1,5 @@
1
- import Page from './src/Page';
2
- import Item from './src/Item';
1
+ import Page from './src/components/Page';
2
+ import Item from './src/components/Item';
3
3
  const PickerPage = Page;
4
4
  PickerPage.Item = Item;
5
5
  export default PickerPage;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ children, selected, onSelectionChange }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import { Host, Section, Picker } from '@expo/ui/swift-ui';
2
2
  import { listRowInsets, listStyle, pickerStyle } from '@expo/ui/swift-ui/modifiers';
3
3
  import React, { memo, useMemo } from 'react';
4
- import { List } from "../../../../libs/swiftui";
4
+ import { List } from "../../../../../libs/swiftui";
5
5
  export default memo(({ children, selected, onSelectionChange, adjustRowInsets }) => {
6
6
  const _modifiersPicker = useMemo(() => [
7
7
  pickerStyle('inline'),
@@ -0,0 +1,14 @@
1
+ import React, { memo, useMemo } from 'react';
2
+ import { ScrollView } from 'react-native';
3
+ import Table from "../../../../../libs/table";
4
+ import { Provider } from '../../context/page';
5
+ export default memo(({ children, selected, onSelectionChange }) => {
6
+ const value = useMemo(() => ({ selected, onSelectionChange }), [selected]);
7
+ return (<Provider value={value}>
8
+ <ScrollView>
9
+ <Table>
10
+ {children}
11
+ </Table>
12
+ </ScrollView>
13
+ </Provider>);
14
+ });
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type Props from "./types";
3
+ declare const _default: React.MemoExoticComponent<({ itemKey, title, ionIconName, icon }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -4,5 +4,5 @@ import type Props from "./types";
4
4
  Item component for the picker page.
5
5
  It is necessary to use the tag modifier to display the item in the picker.
6
6
  */
7
- declare const _default: React.MemoExoticComponent<({ itemKey, ...props }: Props) => React.JSX.Element>;
7
+ declare const _default: React.MemoExoticComponent<({ itemKey, title, systemImage, icon }: Props) => React.JSX.Element>;
8
8
  export default _default;
@@ -5,4 +5,4 @@ import { tag } from "@expo/ui/swift-ui/modifiers";
5
5
  Item component for the picker page.
6
6
  It is necessary to use the tag modifier to display the item in the picker.
7
7
  */
8
- export default memo(({ itemKey, ...props }) => (<Label {...props} modifiers={[tag(itemKey)]}/>));
8
+ export default memo(({ itemKey, title, systemImage, icon }) => (<Label title={title} systemImage={systemImage} icon={icon} modifiers={[tag(itemKey)]}/>));
@@ -0,0 +1,14 @@
1
+ import React, { memo } from "react";
2
+ import { Ionicons } from '@expo/vector-icons';
3
+ import { useApp } from "../../../../../libs/providers/App";
4
+ import Table from "../../../../../libs/table";
5
+ import Colors from "../../../../../libs/constants/colors";
6
+ import { usePage } from '../../context/page';
7
+ export default memo(({ itemKey, title, ionIconName, icon }) => {
8
+ const { colorScheme } = useApp();
9
+ const { selected, onSelectionChange } = usePage();
10
+ return (<Table.Option id={itemKey} onPress={() => onSelectionChange?.(itemKey)} colorScheme={colorScheme} childrenLeft={<>
11
+ {icon ?? (ionIconName && <Ionicons name={ionIconName} size={24} color={Colors.especiales.azul}/>)}
12
+ {title && <Table.Option.Components.Text text={title}/>}
13
+ </>} childrenRight={itemKey !== selected ? undefined : (<Ionicons name='checkmark-circle' size={24} color={Colors.especiales.azul}/>)}/>);
14
+ });
@@ -1,4 +1,5 @@
1
1
  import type { SFSymbol } from 'sf-symbols-typescript';
2
+ import { Ionicons } from '@expo/vector-icons';
2
3
  type Props = {
3
4
  /**
4
5
  The key of the item to be used in the tag modifier.
@@ -14,6 +15,10 @@ type Props = {
14
15
  @platform ios
15
16
  */
16
17
  systemImage?: SFSymbol;
18
+ /**
19
+ The name of the Ionicon to be displayed in the label.
20
+ */
21
+ ionIconName?: keyof typeof Ionicons.glyphMap;
17
22
  /**
18
23
  Custom icon view to be displayed in the label.
19
24
  When provided, this takes precedence over `systemImage`.
@@ -13,7 +13,7 @@ export default memo(({ children, onChangeSearchText, onSelectionChange, placehol
13
13
  </Stack.Toolbar.Button>
14
14
  </Stack.Toolbar>
15
15
 
16
- <Stack.SearchBar placeholder={placeholderSearchBar} onChangeText={(e) => onChangeSearchText(e.nativeEvent.text)}/>
16
+ <Stack.SearchBar placeholder={placeholderSearchBar} onChangeText={(e) => onChangeSearchText?.(e.nativeEvent.text)}/>
17
17
 
18
18
  <Content onSelectionChange={_onSelectionChange} {...props}>
19
19
  {children}
@@ -7,14 +7,14 @@ type Props = {
7
7
  Selected value.
8
8
  */
9
9
  selected?: string;
10
- /**
11
- Function to be called when the user changes the search text.
12
- */
13
- onChangeSearchText: (text: string) => void;
14
10
  /**
15
11
  Function to be called when the user selects a selection.
16
12
  */
17
13
  onSelectionChange?: (selection: string) => void | Promise<void>;
14
+ /**
15
+ Function to be called when the user changes the search text.
16
+ */
17
+ onChangeSearchText?: (text: string) => void;
18
18
  /**
19
19
  Placeholder for the search bar.
20
20
  @default 'Buscar'
@@ -0,0 +1,7 @@
1
+ export declare const Provider: import("react").Provider<{
2
+ selected?: string;
3
+ onSelectionChange?: (selection: string) => void;
4
+ } | null>, usePage: () => {
5
+ selected?: string;
6
+ onSelectionChange?: (selection: string) => void;
7
+ };
@@ -0,0 +1,2 @@
1
+ import Utils from '../../../../libs/constants/utils';
2
+ export const [Provider, usePage] = Utils.createCtx();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.126",
3
+ "version": "1.0.130",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +0,0 @@
1
- import type Props from "./types";
2
- declare const _default: ({ ...props }: Props) => null;
3
- export default _default;
@@ -1 +0,0 @@
1
- export default ({ ...props }) => null;
@@ -1,3 +0,0 @@
1
- import type Props from "./types";
2
- declare const _default: ({ ...props }: Props) => null;
3
- export default _default;
@@ -1 +0,0 @@
1
- export default ({ ...props }) => null;