native-pytech 1.0.174 → 1.0.176
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/editPage/src/components/ItemDate/index.d.ts +1 -1
- package/dist/libs/editPage/src/components/ItemDate/index.ios.d.ts +1 -1
- package/dist/libs/editPage/src/components/ItemDate/index.ios.js +4 -3
- package/dist/libs/editPage/src/components/ItemDate/index.js +5 -4
- package/dist/libs/editPage/src/components/ItemDate/types.d.ts +4 -0
- package/dist/libs/swiftui/src/components/NavigationLink/index.d.ts +1 -1
- package/dist/libs/swiftui/src/components/NavigationLink/index.js +6 -3
- package/dist/libs/swiftui/src/components/NavigationLink/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type Props from './types';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ itemKey, label, defaultValue, minDate, maxDate, }: Props) => import("react").JSX.Element>;
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<({ itemKey, label, defaultValue, minDate, maxDate, onValueChange, }: Props) => import("react").JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type Props from './types';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ itemKey, label, defaultValue, minDate, maxDate, }: Props) => import("react").JSX.Element>;
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<({ itemKey, label, defaultValue, minDate, maxDate, onValueChange, }: Props) => import("react").JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { Section, DatePicker } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { environment } from '@expo/ui/swift-ui/modifiers';
|
|
4
4
|
import { usePage } from '../../context/page';
|
|
5
|
-
export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 100)), maxDate = new Date(), }) => {
|
|
5
|
+
export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 100)), maxDate = new Date(), onValueChange, }) => {
|
|
6
6
|
const { store, registerItem } = usePage();
|
|
7
7
|
const [selection, setSelection] = useState(defaultValue);
|
|
8
8
|
// Key
|
|
@@ -12,16 +12,17 @@ export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date
|
|
|
12
12
|
}, []);
|
|
13
13
|
// Hooks
|
|
14
14
|
useEffect(() => setSelection(defaultValue), [defaultValue]);
|
|
15
|
-
const
|
|
15
|
+
const _onValueChange = useCallback((value) => {
|
|
16
16
|
setSelection(value);
|
|
17
17
|
store.values[keyRef.current ?? 0].set({
|
|
18
18
|
value: value,
|
|
19
19
|
hasChanged: value.getTime() !== defaultValue?.getTime(),
|
|
20
20
|
isValid: true,
|
|
21
21
|
});
|
|
22
|
+
onValueChange?.(value);
|
|
22
23
|
}, []);
|
|
23
24
|
return (<Section>
|
|
24
|
-
<DatePicker title={label} selection={selection} onDateChange={
|
|
25
|
+
<DatePicker title={label} selection={selection} onDateChange={_onValueChange} modifiers={[environment('locale', 'es_ES')]} range={{
|
|
25
26
|
start: minDate,
|
|
26
27
|
end: maxDate,
|
|
27
28
|
}}/>
|
|
@@ -5,7 +5,7 @@ import { useApp } from '../../../../../libs/providers/App';
|
|
|
5
5
|
import Formats from '../../../../../libs/constants/formats';
|
|
6
6
|
import { usePage } from '../../context/page';
|
|
7
7
|
import Colors from '../../../../../libs/constants/colors';
|
|
8
|
-
export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 100)), maxDate = new Date(), }) => {
|
|
8
|
+
export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 100)), maxDate = new Date(), onValueChange, }) => {
|
|
9
9
|
const { colorScheme } = useApp();
|
|
10
10
|
const { store, registerItem } = usePage();
|
|
11
11
|
const [selection, setSelection] = useState(defaultValue ?? new Date());
|
|
@@ -19,9 +19,9 @@ export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date
|
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
setSelection(defaultValue ?? new Date());
|
|
21
21
|
if (defaultValue === undefined)
|
|
22
|
-
|
|
22
|
+
_onValueChange(Formats.dateToTextFormat(selection, 'yyyy-MM-dd'));
|
|
23
23
|
}, [defaultValue]);
|
|
24
|
-
const
|
|
24
|
+
const _onValueChange = useCallback((value_str) => {
|
|
25
25
|
const [year, month, day] = value_str.split('-').map(Number);
|
|
26
26
|
const value = new Date(year, month - 1, day);
|
|
27
27
|
setSelection(value);
|
|
@@ -30,11 +30,12 @@ export default memo(({ itemKey, label, defaultValue, minDate = new Date(new Date
|
|
|
30
30
|
hasChanged: value.getTime() !== defaultValue?.getTime(),
|
|
31
31
|
isValid: true,
|
|
32
32
|
});
|
|
33
|
+
onValueChange?.(value);
|
|
33
34
|
}, []);
|
|
34
35
|
return (<Table.Option id={label ?? ''} colorScheme={colorScheme} childrenLeft={<Table.Option.Components.Text text={label ?? 'Seleccione una fecha'}/>} childrenRight={(<>
|
|
35
36
|
<Pressable onPress={() => inputRef.current?.showPicker()} style={[styles.container, { backgroundColor: Colors.especiales.azul }]}>
|
|
36
37
|
<Table.Option.Components.Text text={Formats.dateToTextFormat(selection, 'dd/MM/yyyy')} style={{ color: 'white', userSelect: 'none' }}/>
|
|
37
|
-
<input ref={inputRef} type="date" value={Formats.dateToTextFormat(selection, 'yyyy-MM-dd')} onChange={(e) =>
|
|
38
|
+
<input ref={inputRef} type="date" value={Formats.dateToTextFormat(selection, 'yyyy-MM-dd')} onChange={(e) => _onValueChange(e.target.value)} style={{
|
|
38
39
|
all: 'unset',
|
|
39
40
|
visibility: 'hidden',
|
|
40
41
|
width: 0,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type Props from './types';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ children, onPress, icon, label, systemImage, listRowInsets, trailingText, trailingTextProps, trailingComponent }: Props) => import("react").JSX.Element>;
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<({ children, onPress, icon, label, systemImage, listRowInsets, trailingText, trailingTextProps, trailingComponent, modifiers }: Props) => import("react").JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -2,9 +2,12 @@ import { Button, HStack, Label } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { listRowInsets as listRowInsetsModifier, foregroundStyle } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
4
|
import Trailing from './Trailing';
|
|
5
|
-
export default memo(({ children, onPress, icon, label, systemImage, listRowInsets = false, trailingText, trailingTextProps, trailingComponent }) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
export default memo(({ children, onPress, icon, label, systemImage, listRowInsets = false, trailingText, trailingTextProps, trailingComponent, modifiers }) => {
|
|
6
|
+
const _modifiers = useMemo(() => [
|
|
7
|
+
...(modifiers ?? []),
|
|
8
|
+
...(listRowInsets ? [listRowInsetsModifier({ top: 20, bottom: 20, leading: 25, trailing: 20 })] : []),
|
|
9
|
+
], [modifiers, listRowInsets]);
|
|
10
|
+
return (<HStack modifiers={_modifiers}>
|
|
8
11
|
<Button onPress={onPress} modifiers={[foregroundStyle({ type: 'hierarchical', style: 'primary' })]}>
|
|
9
12
|
{children ?? (!systemImage ? <Label title={label} icon={icon}/> : undefined)}
|
|
10
13
|
</Button>
|
|
@@ -13,7 +13,7 @@ export type TrailingProps = {
|
|
|
13
13
|
*/
|
|
14
14
|
component?: React.ReactNode;
|
|
15
15
|
};
|
|
16
|
-
type Props = Pick<ButtonProps, 'children' | 'onPress' | 'systemImage' | 'label'> & {
|
|
16
|
+
type Props = Pick<ButtonProps, 'children' | 'onPress' | 'systemImage' | 'label' | 'modifiers'> & {
|
|
17
17
|
/**
|
|
18
18
|
Whether to apply the listRowInsets modifier to the HStack.
|
|
19
19
|
@default false
|