native-pytech 1.0.37 → 1.0.38
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.
- package/dist/libs/swiftui/src/components/IconSection/Section.js +5 -4
- package/dist/libs/swiftui/src/components/List/BaseList/index.d.ts +1 -1
- package/dist/libs/swiftui/src/components/List/BaseList/index.js +8 -4
- package/dist/libs/swiftui/src/components/List/BaseList/types.d.ts +4 -1
- package/dist/libs/swiftui/src/components/List/Editable/List/index.js +5 -4
- package/dist/libs/swiftui/src/components/List/Editable/Section/index.js +0 -1
- package/dist/libs/swiftui/src/components/NavigationLink/index.js +6 -3
- package/dist/libs/swiftui/src/components/Picker.js +5 -2
- package/dist/libs/swiftui/src/components/Text.js +5 -2
- package/package.json +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Section, VStack } from '@expo/ui/swift-ui';
|
|
2
2
|
import { containerRelativeFrame, listRowBackground, frame, listRowInsets } from '@expo/ui/swift-ui/modifiers';
|
|
3
|
-
import React, { memo } from 'react';
|
|
3
|
+
import React, { memo, useMemo } from 'react';
|
|
4
4
|
export default memo(({ children, modifiers, ...vStackProps }) => {
|
|
5
|
-
const _modifiers = [
|
|
5
|
+
const _modifiers = useMemo(() => [
|
|
6
|
+
...(modifiers ?? []),
|
|
6
7
|
frame({ alignment: 'center' }),
|
|
7
8
|
containerRelativeFrame({ axes: 'horizontal' }),
|
|
8
9
|
listRowBackground('transparent'),
|
|
9
10
|
listRowInsets({ bottom: 0.1 })
|
|
10
|
-
];
|
|
11
|
+
], [modifiers]);
|
|
11
12
|
return (<Section>
|
|
12
|
-
<VStack spacing={20} modifiers={
|
|
13
|
+
<VStack spacing={20} modifiers={_modifiers} {...vStackProps}>
|
|
13
14
|
{children}
|
|
14
15
|
</VStack>
|
|
15
16
|
</Section>);
|
|
@@ -6,5 +6,5 @@ import type Props from './types';
|
|
|
6
6
|
Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
|
|
7
7
|
- padding({ top: -15 })
|
|
8
8
|
*/
|
|
9
|
-
declare const _default: React.MemoExoticComponent<({ children, modifiers, disablePaddingTop, ...listProps }: Props) => React.JSX.Element>;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ children, modifiers, disablePaddingTop, onRefresh, ...listProps }: Props) => React.JSX.Element>;
|
|
10
10
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { List } from '@expo/ui/swift-ui';
|
|
2
|
-
import { padding } from '@expo/ui/swift-ui/modifiers';
|
|
2
|
+
import { padding, refreshable } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import React, { memo, useMemo } from 'react';
|
|
4
4
|
/**
|
|
5
5
|
Wrapper de List que aplica un padding superior negativo por defecto.
|
|
@@ -7,9 +7,13 @@ import React, { memo, useMemo } from 'react';
|
|
|
7
7
|
Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
|
|
8
8
|
- padding({ top: -15 })
|
|
9
9
|
*/
|
|
10
|
-
export default memo(({ children, modifiers, disablePaddingTop
|
|
11
|
-
const _modifiers = useMemo(() =>
|
|
12
|
-
|
|
10
|
+
export default memo(({ children, modifiers, disablePaddingTop, onRefresh, ...listProps }) => {
|
|
11
|
+
const _modifiers = useMemo(() => [
|
|
12
|
+
...(modifiers ?? []),
|
|
13
|
+
...(disablePaddingTop ? [padding({ top: -15 })] : []),
|
|
14
|
+
...(onRefresh ? [refreshable(onRefresh)] : []),
|
|
15
|
+
], [modifiers, disablePaddingTop, onRefresh]);
|
|
16
|
+
return (<List modifiers={_modifiers} {...listProps}>
|
|
13
17
|
{children}
|
|
14
18
|
</List>);
|
|
15
19
|
});
|
|
@@ -2,8 +2,11 @@ import { ListProps } from "@expo/ui/swift-ui";
|
|
|
2
2
|
type Props = ListProps & {
|
|
3
3
|
/**
|
|
4
4
|
Whether to disable the padding top of the list.
|
|
5
|
-
@default false
|
|
6
5
|
*/
|
|
7
6
|
disablePaddingTop?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
The function to handle the refresh event.
|
|
9
|
+
*/
|
|
10
|
+
onRefresh?: () => Promise<void>;
|
|
8
11
|
};
|
|
9
12
|
export default Props;
|
|
@@ -4,13 +4,14 @@ import BaseList from "../../BaseList";
|
|
|
4
4
|
import { Provider } from '../../../../context/ListEditable';
|
|
5
5
|
export default memo(({ children, editMode, moveEnabled, deleteEnabled, modifiers, ...listProps }) => {
|
|
6
6
|
const _modifiers = useMemo(() => [
|
|
7
|
+
...(modifiers ?? []),
|
|
7
8
|
listStyle('inset'),
|
|
8
9
|
environment('editMode', editMode ? 'active' : 'inactive'),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
], [editMode, moveEnabled, deleteEnabled]);
|
|
10
|
+
...(moveEnabled ? [moveDisabled(false)] : []),
|
|
11
|
+
...(deleteEnabled ? [deleteDisabled(false)] : []),
|
|
12
|
+
], [modifiers, editMode, moveEnabled, deleteEnabled]);
|
|
12
13
|
const value = useMemo(() => ({ enableMove: moveEnabled, enableDelete: deleteEnabled }), [moveEnabled, deleteEnabled]);
|
|
13
|
-
return (<BaseList {...listProps} modifiers={
|
|
14
|
+
return (<BaseList {...listProps} modifiers={_modifiers}>
|
|
14
15
|
<Provider value={value}>
|
|
15
16
|
{children}
|
|
16
17
|
</Provider>
|
|
@@ -7,7 +7,6 @@ function Component({ data = [], keyExtractor, onDelete, onMove, renderItem }) {
|
|
|
7
7
|
// ---------------------- Variables ----------------------
|
|
8
8
|
const { enableMove, enableDelete } = useListEditable();
|
|
9
9
|
const [_data, setData] = useState(data ?? []);
|
|
10
|
-
// ---------------------- Hooks ----------------------
|
|
11
10
|
Hooks.useEffectWithoutFirstRender(() => setData(data ?? []), [data]);
|
|
12
11
|
// ---------------------- Functions ----------------------
|
|
13
12
|
const handleDelete = useCallback((indices) => {
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Button, HStack, Label } from '@expo/ui/swift-ui';
|
|
2
2
|
import { foregroundStyle } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import { Color } from 'expo-router';
|
|
4
|
-
import React, { memo } from 'react';
|
|
4
|
+
import React, { memo, useMemo } from 'react';
|
|
5
5
|
import Trailing from './Trailing';
|
|
6
6
|
export default memo(({ children, systemImage, label, modifiers, maintainButtonStyle = false, textTrailing, textTrailingProps, ...buttonProps }) => {
|
|
7
7
|
// Va a poner una Label cuando no tenga que mantener el estilo del button y haya una imagen.
|
|
8
8
|
// Si no tiene que mantener el estilo del button y no hay una imagen, solo va a cambiar el foregroundColor.
|
|
9
9
|
const renderLabel = !maintainButtonStyle && systemImage !== undefined;
|
|
10
|
-
const _modifiers = (
|
|
10
|
+
const _modifiers = useMemo(() => [
|
|
11
|
+
...(modifiers ?? []),
|
|
12
|
+
...(!maintainButtonStyle && !renderLabel ? [foregroundStyle(Color.ios.label)] : []),
|
|
13
|
+
], [modifiers, maintainButtonStyle, renderLabel]);
|
|
11
14
|
const buttonSystemImage = !renderLabel ? systemImage : undefined;
|
|
12
15
|
const buttonLabel = !renderLabel ? label : undefined;
|
|
13
16
|
return (<HStack>
|
|
14
|
-
<Button modifiers={
|
|
17
|
+
<Button modifiers={_modifiers} systemImage={buttonSystemImage} label={buttonLabel} {...buttonProps}>
|
|
15
18
|
{children}
|
|
16
19
|
</Button>
|
|
17
20
|
{!children && renderLabel && (<Label title={label} systemImage={systemImage}/>)}
|
|
@@ -2,8 +2,11 @@ import { Picker, Text } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { pickerStyle, tag } from "@expo/ui/swift-ui/modifiers";
|
|
3
3
|
import React, { memo, useMemo } from 'react';
|
|
4
4
|
export default memo(({ modifiers, data = [], ...pickerProps }) => {
|
|
5
|
-
const _modifiers = useMemo(() => [
|
|
6
|
-
|
|
5
|
+
const _modifiers = useMemo(() => [
|
|
6
|
+
...(modifiers ?? []),
|
|
7
|
+
pickerStyle('menu'),
|
|
8
|
+
], [modifiers]);
|
|
9
|
+
return (<Picker modifiers={_modifiers} {...pickerProps}>
|
|
7
10
|
{data.map(item => (<Text key={item} modifiers={[tag(item)]}>
|
|
8
11
|
{item}
|
|
9
12
|
</Text>))}
|
|
@@ -2,6 +2,9 @@ import { Text } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { foregroundStyle } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import React, { memo, useMemo } from 'react';
|
|
4
4
|
export default memo(({ modifiers, secondary = false, ...restProps }) => {
|
|
5
|
-
const _modifiers = useMemo(() =>
|
|
6
|
-
|
|
5
|
+
const _modifiers = useMemo(() => [
|
|
6
|
+
...(modifiers ?? []),
|
|
7
|
+
...(secondary ? [foregroundStyle({ type: 'hierarchical', style: 'secondary' })] : []),
|
|
8
|
+
], [modifiers, secondary]);
|
|
9
|
+
return (<Text modifiers={_modifiers} {...restProps}/>);
|
|
7
10
|
});
|