native-pytech 1.0.100 → 1.0.103
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/index.d.ts +1 -0
- package/dist/libs/swiftui/index.js +1 -0
- package/dist/libs/swiftui/src/components/Host.d.ts +6 -0
- package/dist/libs/swiftui/src/components/Host.js +5 -0
- package/dist/libs/swiftui/src/components/NavigationLink/index.d.ts +1 -1
- package/dist/libs/swiftui/src/components/NavigationLink/index.js +6 -16
- package/dist/libs/swiftui/src/components/NavigationLink/types.d.ts +11 -11
- package/package.json +1 -1
- package/dist/libs/editPage copy/index.d.ts +0 -9
- package/dist/libs/editPage copy/index.js +0 -7
- package/dist/libs/editPage copy/src/components/Item/index.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/Item/index.ios.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/Item/index.ios.js +0 -12
- package/dist/libs/editPage copy/src/components/Item/index.js +0 -1
- package/dist/libs/editPage copy/src/components/Item/types.d.ts +0 -14
- package/dist/libs/editPage copy/src/components/Item/types.js +0 -1
- package/dist/libs/editPage copy/src/components/ItemDate/index.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/ItemDate/index.ios.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/ItemDate/index.ios.js +0 -26
- package/dist/libs/editPage copy/src/components/ItemDate/index.js +0 -1
- package/dist/libs/editPage copy/src/components/ItemDate/types.d.ts +0 -21
- package/dist/libs/editPage copy/src/components/ItemDate/types.js +0 -1
- package/dist/libs/editPage copy/src/components/Screen/index.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/Screen/index.ios.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/Screen/index.ios.js +0 -8
- package/dist/libs/editPage copy/src/components/Screen/index.js +0 -1
- package/dist/libs/editPage copy/src/components/Screen/types.d.ts +0 -27
- package/dist/libs/editPage copy/src/components/Screen/types.js +0 -1
- package/dist/libs/editPage copy/src/components/TextField/index.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/TextField/index.ios.d.ts +0 -4
- package/dist/libs/editPage copy/src/components/TextField/index.ios.js +0 -52
- package/dist/libs/editPage copy/src/components/TextField/index.js +0 -1
- package/dist/libs/editPage copy/src/components/TextField/types.d.ts +0 -28
- package/dist/libs/editPage copy/src/components/TextField/types.js +0 -1
- package/dist/libs/editPage copy/src/components/Wrapper/index.d.ts +0 -5
- package/dist/libs/editPage copy/src/components/Wrapper/index.js +0 -70
- package/dist/libs/editPage copy/src/components/Wrapper/types.d.ts +0 -27
- package/dist/libs/editPage copy/src/components/Wrapper/types.js +0 -1
- package/dist/libs/editPage copy/src/context/item.d.ts +0 -7
- package/dist/libs/editPage copy/src/context/item.js +0 -2
- package/dist/libs/editPage copy/src/context/page.d.ts +0 -18
- package/dist/libs/editPage copy/src/context/page.js +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as NavigationLink } from './src/components/NavigationLink';
|
|
2
|
+
export { default as Host } from './src/components/Host';
|
|
2
3
|
export { default as Icon } from './src/components/Icon';
|
|
3
4
|
export { default as IconSection } from './src/components/IconSection';
|
|
4
5
|
export { default as List } from './src/components/List';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as NavigationLink } from './src/components/NavigationLink';
|
|
2
|
+
export { default as Host } from './src/components/Host';
|
|
2
3
|
export { default as Icon } from './src/components/Icon';
|
|
3
4
|
export { default as IconSection } from './src/components/IconSection';
|
|
4
5
|
export { default as List } from './src/components/List';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type Props from './types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ children,
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ children, onPress, icon, label, systemImage, listRowInsets, textTrailing, textTrailingProps }: Props) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { Button, HStack, Label } from '@expo/ui/swift-ui';
|
|
2
|
-
import {
|
|
3
|
-
import { Color } from 'expo-router';
|
|
2
|
+
import { listRowInsets as listRowInsetsModifier } from '@expo/ui/swift-ui/modifiers';
|
|
4
3
|
import React, { memo, useMemo } from 'react';
|
|
5
4
|
import Trailing from './Trailing';
|
|
6
|
-
export default memo(({ children,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...(modifiers ?? []),
|
|
12
|
-
...(!maintainButtonStyle && !renderLabel ? [foregroundStyle(Color.ios.label)] : []),
|
|
13
|
-
], [modifiers, maintainButtonStyle, renderLabel]);
|
|
14
|
-
const buttonSystemImage = !renderLabel ? systemImage : undefined;
|
|
15
|
-
const buttonLabel = !renderLabel ? label : undefined;
|
|
16
|
-
return (<HStack {...hStackProps}>
|
|
17
|
-
<Button modifiers={_modifiers} systemImage={buttonSystemImage} label={buttonLabel} {...buttonProps}>
|
|
18
|
-
{children}
|
|
5
|
+
export default memo(({ children, onPress, icon, label, systemImage, listRowInsets = false, textTrailing, textTrailingProps }) => {
|
|
6
|
+
const modifiers = useMemo(() => listRowInsets ? [listRowInsetsModifier({ top: 20, bottom: 20, leading: 25, trailing: 20 })] : [], [listRowInsets]);
|
|
7
|
+
return (<HStack modifiers={modifiers}>
|
|
8
|
+
<Button onPress={onPress}>
|
|
9
|
+
{children ?? <Label title={label} systemImage={systemImage} icon={icon}/>}
|
|
19
10
|
</Button>
|
|
20
|
-
{!children && renderLabel && (<Label title={label} systemImage={systemImage}/>)}
|
|
21
11
|
<Trailing text={textTrailing} textProps={textTrailingProps}/>
|
|
22
12
|
</HStack>);
|
|
23
13
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps,
|
|
1
|
+
import { ButtonProps, LabelProps, TextProps } from "@expo/ui/swift-ui";
|
|
2
2
|
export type TrailingProps = {
|
|
3
3
|
/**
|
|
4
4
|
Text to display on the Trailing Stack.
|
|
@@ -9,23 +9,23 @@ export type TrailingProps = {
|
|
|
9
9
|
*/
|
|
10
10
|
textProps?: TextProps;
|
|
11
11
|
};
|
|
12
|
-
type Props = ButtonProps & {
|
|
12
|
+
type Props = Pick<ButtonProps, 'children' | 'onPress' | 'systemImage' | 'label'> & {
|
|
13
13
|
/**
|
|
14
|
-
|
|
14
|
+
Whether to apply the listRowInsets modifier to the HStack.
|
|
15
|
+
@default false
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
listRowInsets?: boolean;
|
|
17
18
|
/**
|
|
18
|
-
|
|
19
|
+
Icon to display on the Label.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
icon?: LabelProps['icon'];
|
|
21
22
|
/**
|
|
22
|
-
|
|
23
|
-
@default false
|
|
23
|
+
Text to display on the Trailing Stack.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
textTrailing?: TrailingProps['text'];
|
|
26
26
|
/**
|
|
27
|
-
|
|
27
|
+
TextProps to apply to the Trailing Stack text.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
textTrailingProps?: TrailingProps['textProps'];
|
|
30
30
|
};
|
|
31
31
|
export default Props;
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Wrapper from './src/components/Wrapper';
|
|
2
|
-
import Item from './src/components/Item';
|
|
3
|
-
import ItemDate from './src/components/ItemDate';
|
|
4
|
-
type Component = typeof Wrapper & {
|
|
5
|
-
Item: typeof Item;
|
|
6
|
-
ItemDate: typeof ItemDate;
|
|
7
|
-
};
|
|
8
|
-
declare const Screen: Component;
|
|
9
|
-
export default Screen;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { HStack, Spacer, Text } from '@expo/ui/swift-ui';
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
import TextField from '../TextField';
|
|
4
|
-
export default memo(({ label, minLengthSpacer, ...textFieldProps }) => {
|
|
5
|
-
if (!label)
|
|
6
|
-
return <TextField {...textFieldProps}/>;
|
|
7
|
-
return (<HStack>
|
|
8
|
-
<Text>{label}</Text>
|
|
9
|
-
<Spacer minLength={minLengthSpacer}/>
|
|
10
|
-
<TextField {...textFieldProps}/>
|
|
11
|
-
</HStack>);
|
|
12
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ ...props }) => null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type TextFieldProps from '../TextField/types';
|
|
2
|
-
type Props = TextFieldProps & {
|
|
3
|
-
/**
|
|
4
|
-
Text to display on the left of the text field.
|
|
5
|
-
If not provided, the item will be only a text field.
|
|
6
|
-
*/
|
|
7
|
-
label?: string;
|
|
8
|
-
/**
|
|
9
|
-
Minimum length of the spacer between the title and the text field.
|
|
10
|
-
If the title is not provided, will not be displayed.
|
|
11
|
-
*/
|
|
12
|
-
minLengthSpacer?: number;
|
|
13
|
-
};
|
|
14
|
-
export default Props;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Section, DatePicker } from '@expo/ui/swift-ui';
|
|
2
|
-
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import { environment } from '@expo/ui/swift-ui/modifiers';
|
|
4
|
-
import { usePage } from '../../context/page';
|
|
5
|
-
import { useItem } from '../../context/item';
|
|
6
|
-
export default memo(({ label, defaultValue, minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 100)), maxDate = new Date() }) => {
|
|
7
|
-
const { store } = usePage();
|
|
8
|
-
const { index } = useItem();
|
|
9
|
-
const [selection, setSelection] = useState(defaultValue);
|
|
10
|
-
// Hooks
|
|
11
|
-
useEffect(() => setSelection(defaultValue), [defaultValue]);
|
|
12
|
-
const onValueChange = useCallback((value) => {
|
|
13
|
-
setSelection(value);
|
|
14
|
-
store.values[index].set({
|
|
15
|
-
value: value,
|
|
16
|
-
hasChanged: value.getTime() !== defaultValue?.getTime(),
|
|
17
|
-
isValid: true,
|
|
18
|
-
});
|
|
19
|
-
}, []);
|
|
20
|
-
return (<Section>
|
|
21
|
-
<DatePicker title={label} selection={selection} onDateChange={onValueChange} modifiers={[environment('locale', 'es_ES')]} range={{
|
|
22
|
-
start: minDate,
|
|
23
|
-
end: maxDate,
|
|
24
|
-
}}/>
|
|
25
|
-
</Section>);
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ ...props }) => null;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/**
|
|
3
|
-
Title of the date picker.
|
|
4
|
-
*/
|
|
5
|
-
label?: string;
|
|
6
|
-
/**
|
|
7
|
-
Default value of the date picker.
|
|
8
|
-
*/
|
|
9
|
-
defaultValue?: Date;
|
|
10
|
-
/**
|
|
11
|
-
Minimum date allowed.
|
|
12
|
-
@default 100 years ago
|
|
13
|
-
*/
|
|
14
|
-
minDate?: Date;
|
|
15
|
-
/**
|
|
16
|
-
Maximum date allowed.
|
|
17
|
-
@default today
|
|
18
|
-
*/
|
|
19
|
-
maxDate?: Date;
|
|
20
|
-
};
|
|
21
|
-
export default Props;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ children }) => null;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
type Props<T> = {
|
|
2
|
-
/**
|
|
3
|
-
The data items to be rendered inside the list.
|
|
4
|
-
@default []
|
|
5
|
-
*/
|
|
6
|
-
data?: T[];
|
|
7
|
-
/**
|
|
8
|
-
The function to render the item.
|
|
9
|
-
*/
|
|
10
|
-
renderItem?: (item: T) => React.ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
Function to be called when the user saves the changes.
|
|
13
|
-
If the function returns false, the user will not be redirected to the previous screen.
|
|
14
|
-
*/
|
|
15
|
-
onSave?: (values: (string | null | Date)[]) => boolean | Promise<boolean>;
|
|
16
|
-
};
|
|
17
|
-
export type Value = {
|
|
18
|
-
value: string | null | Date | undefined;
|
|
19
|
-
hasChanged: boolean;
|
|
20
|
-
isValid: boolean;
|
|
21
|
-
};
|
|
22
|
-
export type Values = Record<number, Value>;
|
|
23
|
-
export type Store = {
|
|
24
|
-
values: Values;
|
|
25
|
-
saveEnabled: boolean;
|
|
26
|
-
};
|
|
27
|
-
export default Props;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, memo, useRef, useCallback, useEffect } from "react";
|
|
2
|
-
import { SecureField, TextField } from "@expo/ui/swift-ui";
|
|
3
|
-
import { keyboardType as keyboardTypeModifier, submitLabel, textInputAutocapitalization, onSubmit } from '@expo/ui/swift-ui/modifiers';
|
|
4
|
-
import { usePage } from '../../context/page';
|
|
5
|
-
import { useItem } from '../../context/item';
|
|
6
|
-
export default memo(({ defaultValue, placeholder, keyboardType, autocapitalization = true, secureTextEntry, isValid, }) => {
|
|
7
|
-
const { store, isUniqueItem, saveEnabledRef, onPressSave, textFieldsRefs } = usePage();
|
|
8
|
-
const { index, nextIndex } = useItem();
|
|
9
|
-
const ref = useRef(null);
|
|
10
|
-
textFieldsRefs.current[index] = ref;
|
|
11
|
-
useEffect(() => store.values[index].value.set(defaultValue), [defaultValue]);
|
|
12
|
-
// onChange
|
|
13
|
-
const onValueChange = useCallback((value) => {
|
|
14
|
-
const _value = value.trim() === '' ? null : value.trim();
|
|
15
|
-
store.values[index].set({
|
|
16
|
-
value: _value,
|
|
17
|
-
hasChanged: _value !== defaultValue,
|
|
18
|
-
isValid: isValid?.(_value) ?? true,
|
|
19
|
-
});
|
|
20
|
-
}, []);
|
|
21
|
-
const _onSubmit = useCallback(() => {
|
|
22
|
-
// Guarda los cambios
|
|
23
|
-
if (isUniqueItem) {
|
|
24
|
-
const saveEnabled = saveEnabledRef.current;
|
|
25
|
-
if (!saveEnabled)
|
|
26
|
-
return;
|
|
27
|
-
onPressSave();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// Va al siguiente campo
|
|
31
|
-
if (!nextIndex)
|
|
32
|
-
return;
|
|
33
|
-
textFieldsRefs.current[nextIndex].current?.focus();
|
|
34
|
-
}, []);
|
|
35
|
-
// Props
|
|
36
|
-
const modifiers = useMemo(() => [
|
|
37
|
-
...(isUniqueItem ? [submitLabel('done')] : []),
|
|
38
|
-
...(keyboardType ? [keyboardTypeModifier(keyboardType)] : []),
|
|
39
|
-
...(!autocapitalization ? [textInputAutocapitalization('never')] : []),
|
|
40
|
-
onSubmit(_onSubmit),
|
|
41
|
-
], [keyboardType, autocapitalization, isUniqueItem]);
|
|
42
|
-
const props = {
|
|
43
|
-
autoFocus: isUniqueItem,
|
|
44
|
-
modifiers,
|
|
45
|
-
placeholder,
|
|
46
|
-
defaultValue,
|
|
47
|
-
onValueChange,
|
|
48
|
-
};
|
|
49
|
-
if (secureTextEntry)
|
|
50
|
-
return <SecureField {...props} ref={ref}/>;
|
|
51
|
-
return <TextField {...props} ref={ref}/>;
|
|
52
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ ...props }) => null;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/**
|
|
3
|
-
Default value of the text field.
|
|
4
|
-
*/
|
|
5
|
-
defaultValue?: string;
|
|
6
|
-
/**
|
|
7
|
-
Placeholder of the text field.
|
|
8
|
-
*/
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
/**
|
|
11
|
-
Keyboard type. Uses the keyboardType modifier.
|
|
12
|
-
*/
|
|
13
|
-
keyboardType?: "default" | "email-address" | "numeric" | "phone-pad" | "ascii-capable" | "numbers-and-punctuation" | "url" | "name-phone-pad" | "decimal-pad" | "twitter" | "web-search" | "ascii-capable-number-pad";
|
|
14
|
-
/**
|
|
15
|
-
If true, the text field will be autocapitalized. Uses the textInputAutocapitalization modifier.
|
|
16
|
-
@default true
|
|
17
|
-
*/
|
|
18
|
-
autocapitalization?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
If true, the text field will be secure (password).
|
|
21
|
-
*/
|
|
22
|
-
secureTextEntry?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
Function to validate the value.
|
|
25
|
-
*/
|
|
26
|
-
isValid?: (value: string | null) => boolean;
|
|
27
|
-
};
|
|
28
|
-
export default Props;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { useObservable, useValue } from '@legendapp/state/react';
|
|
2
|
-
import { Stack, useRouter } from 'expo-router';
|
|
3
|
-
import React, { memo, useCallback, useMemo, useRef } from 'react';
|
|
4
|
-
import Hooks from '../../../../../libs/constants/hooks';
|
|
5
|
-
import { Provider } from '../../context/page';
|
|
6
|
-
import { Provider as ItemProvider } from '../../context/item';
|
|
7
|
-
import Screen from '../Screen';
|
|
8
|
-
function Component({ data = [], renderItem, onSave, }) {
|
|
9
|
-
const router = useRouter();
|
|
10
|
-
const saveEnabledRef = useRef(false);
|
|
11
|
-
// Store
|
|
12
|
-
const values = (data ?? []).reduce((acc, item, index) => {
|
|
13
|
-
acc[index] = {
|
|
14
|
-
value: undefined,
|
|
15
|
-
hasChanged: false,
|
|
16
|
-
isValid: true,
|
|
17
|
-
};
|
|
18
|
-
return acc;
|
|
19
|
-
}, {});
|
|
20
|
-
const store = useObservable({
|
|
21
|
-
values: values,
|
|
22
|
-
saveEnabled: () => {
|
|
23
|
-
const listValues = Object.values(store.values.get());
|
|
24
|
-
const hasChanged = listValues.some(value => value.hasChanged);
|
|
25
|
-
const allValid = listValues.every(value => value.isValid);
|
|
26
|
-
return hasChanged && allValid;
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
const saveEnabled = useValue(() => store.saveEnabled.get());
|
|
30
|
-
Hooks.useEffectWithoutFirstRender(() => saveEnabledRef.current = saveEnabled, [saveEnabled]);
|
|
31
|
-
const textFieldsRefs = useRef({});
|
|
32
|
-
// onPress
|
|
33
|
-
const onPressSave = useCallback(async () => {
|
|
34
|
-
// Obtengo los valores del store
|
|
35
|
-
const values = store.values.peek();
|
|
36
|
-
const valuesToSave = Object.values(values).map(value => value.value ?? null);
|
|
37
|
-
// Llamo a la función onSave
|
|
38
|
-
const result = await onSave?.(valuesToSave);
|
|
39
|
-
if (result === false)
|
|
40
|
-
return;
|
|
41
|
-
router.back();
|
|
42
|
-
}, [onSave, store.values]);
|
|
43
|
-
const value = useMemo(() => ({ store, saveEnabledRef, onPressSave, isUniqueItem: (data?.length ?? 0) === 1, textFieldsRefs }), []);
|
|
44
|
-
return (<>
|
|
45
|
-
<Stack.Toolbar placement="left">
|
|
46
|
-
<Stack.Toolbar.Button onPress={() => router.back()}>
|
|
47
|
-
<Stack.Toolbar.Icon sf="xmark"/>
|
|
48
|
-
</Stack.Toolbar.Button>
|
|
49
|
-
</Stack.Toolbar>
|
|
50
|
-
|
|
51
|
-
<Stack.Toolbar placement="right">
|
|
52
|
-
<Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
|
|
53
|
-
<Stack.Toolbar.Icon sf="checkmark"/>
|
|
54
|
-
</Stack.Toolbar.Button>
|
|
55
|
-
</Stack.Toolbar>
|
|
56
|
-
|
|
57
|
-
<Screen>
|
|
58
|
-
<Provider value={value}>
|
|
59
|
-
{data.map((item, index) => {
|
|
60
|
-
const nextIndex = index + 1;
|
|
61
|
-
const value = { index, nextIndex: nextIndex < data.length ? nextIndex : undefined };
|
|
62
|
-
return (<ItemProvider key={index} value={value}>
|
|
63
|
-
{renderItem?.(item)}
|
|
64
|
-
</ItemProvider>);
|
|
65
|
-
})}
|
|
66
|
-
</Provider>
|
|
67
|
-
</Screen>
|
|
68
|
-
</>);
|
|
69
|
-
}
|
|
70
|
-
export default memo(Component);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
type Props<T> = {
|
|
2
|
-
/**
|
|
3
|
-
The data items to be rendered inside the list.
|
|
4
|
-
@default []
|
|
5
|
-
*/
|
|
6
|
-
data?: T[];
|
|
7
|
-
/**
|
|
8
|
-
The function to render the item.
|
|
9
|
-
*/
|
|
10
|
-
renderItem?: (item: T) => React.ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
Function to be called when the user saves the changes.
|
|
13
|
-
If the function returns false, the user will not be redirected to the previous screen.
|
|
14
|
-
*/
|
|
15
|
-
onSave?: (values: (string | null | Date)[]) => boolean | Promise<boolean>;
|
|
16
|
-
};
|
|
17
|
-
export type Value = {
|
|
18
|
-
value: string | null | Date | undefined;
|
|
19
|
-
hasChanged: boolean;
|
|
20
|
-
isValid: boolean;
|
|
21
|
-
};
|
|
22
|
-
export type Values = Record<number, Value>;
|
|
23
|
-
export type Store = {
|
|
24
|
-
values: Values;
|
|
25
|
-
saveEnabled: boolean;
|
|
26
|
-
};
|
|
27
|
-
export default Props;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Observable } from '@legendapp/state';
|
|
2
|
-
import { TextFieldRef } from '@expo/ui/swift-ui';
|
|
3
|
-
import { RefObject } from 'react';
|
|
4
|
-
import type { Store } from '../components/Wrapper/types';
|
|
5
|
-
export type TextFieldsRefsType = Record<number, RefObject<TextFieldRef | null>>;
|
|
6
|
-
export declare const Provider: import("react").Provider<{
|
|
7
|
-
store: Observable<Store>;
|
|
8
|
-
saveEnabledRef: RefObject<boolean>;
|
|
9
|
-
onPressSave: () => Promise<void>;
|
|
10
|
-
isUniqueItem: boolean;
|
|
11
|
-
textFieldsRefs: RefObject<TextFieldsRefsType>;
|
|
12
|
-
}>, usePage: () => {
|
|
13
|
-
store: Observable<Store>;
|
|
14
|
-
saveEnabledRef: RefObject<boolean>;
|
|
15
|
-
onPressSave: () => Promise<void>;
|
|
16
|
-
isUniqueItem: boolean;
|
|
17
|
-
textFieldsRefs: RefObject<TextFieldsRefsType>;
|
|
18
|
-
};
|