native-pytech 1.0.33 → 1.0.37

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 (52) hide show
  1. package/dist/libs/constants/formats.js +1 -6
  2. package/dist/libs/editPage/src/components/ItemDate/index.js +1 -1
  3. package/dist/libs/swiftui/index.d.ts +8 -8
  4. package/dist/libs/swiftui/index.js +8 -8
  5. package/dist/libs/swiftui/src/{IconSection → components/IconSection}/Icon.d.ts +1 -1
  6. package/dist/libs/swiftui/src/{IconSection → components/IconSection}/Icon.js +1 -1
  7. package/dist/libs/swiftui/src/{IconSection → components/IconSection}/Section.js +1 -1
  8. package/dist/libs/swiftui/src/components/List/BaseList/index.d.ts +10 -0
  9. package/dist/libs/swiftui/src/components/List/BaseList/index.js +15 -0
  10. package/dist/libs/swiftui/src/components/List/BaseList/types.d.ts +9 -0
  11. package/dist/libs/swiftui/src/components/List/Editable/List/index.d.ts +4 -0
  12. package/dist/libs/swiftui/src/components/List/Editable/List/index.js +18 -0
  13. package/dist/libs/swiftui/src/components/List/Editable/List/types.d.ts +16 -0
  14. package/dist/libs/swiftui/src/components/List/Editable/Section/index.d.ts +5 -0
  15. package/dist/libs/swiftui/src/components/List/Editable/Section/index.js +37 -0
  16. package/dist/libs/swiftui/src/components/List/Editable/Section/types.d.ts +37 -0
  17. package/dist/libs/swiftui/src/components/List/Editable/Section/types.js +1 -0
  18. package/dist/libs/swiftui/src/components/List/Editable/index.d.ts +7 -0
  19. package/dist/libs/swiftui/src/components/List/Editable/index.js +5 -0
  20. package/dist/libs/swiftui/src/components/List/index.d.ts +7 -0
  21. package/dist/libs/swiftui/src/components/List/index.js +5 -0
  22. package/dist/libs/swiftui/src/{NavigationLink → components/NavigationLink}/index.js +1 -1
  23. package/dist/libs/swiftui/src/components/NavigationLink/types.js +1 -0
  24. package/dist/libs/swiftui/src/{Picker.js → components/Picker.js} +1 -1
  25. package/dist/libs/swiftui/src/{Text.js → components/Text.js} +1 -1
  26. package/dist/libs/swiftui/src/context/ListEditable.d.ts +7 -0
  27. package/dist/libs/swiftui/src/context/ListEditable.js +2 -0
  28. package/package.json +1 -1
  29. package/dist/libs/swiftui/src/List/Editable/index.d.ts +0 -5
  30. package/dist/libs/swiftui/src/List/Editable/index.js +0 -51
  31. package/dist/libs/swiftui/src/List/Editable/types.d.ts +0 -76
  32. package/dist/libs/swiftui/src/List/index.d.ts +0 -16
  33. package/dist/libs/swiftui/src/List/index.js +0 -21
  34. /package/dist/libs/swiftui/src/{Dialog → components/Dialog}/index.d.ts +0 -0
  35. /package/dist/libs/swiftui/src/{Dialog → components/Dialog}/index.js +0 -0
  36. /package/dist/libs/swiftui/src/{Dialog → components/Dialog}/types.d.ts +0 -0
  37. /package/dist/libs/swiftui/src/{Dialog → components/Dialog}/types.js +0 -0
  38. /package/dist/libs/swiftui/src/{Icon.d.ts → components/Icon.d.ts} +0 -0
  39. /package/dist/libs/swiftui/src/{Icon.js → components/Icon.js} +0 -0
  40. /package/dist/libs/swiftui/src/{IconSection → components/IconSection}/Section.d.ts +0 -0
  41. /package/dist/libs/swiftui/src/{IconSection → components/IconSection}/index.d.ts +0 -0
  42. /package/dist/libs/swiftui/src/{IconSection → components/IconSection}/index.js +0 -0
  43. /package/dist/libs/swiftui/src/{List/Editable → components/List/BaseList}/types.js +0 -0
  44. /package/dist/libs/swiftui/src/{NavigationLink → components/List/Editable/List}/types.js +0 -0
  45. /package/dist/libs/swiftui/src/{NavigationLink → components/NavigationLink}/Trailing.d.ts +0 -0
  46. /package/dist/libs/swiftui/src/{NavigationLink → components/NavigationLink}/Trailing.js +0 -0
  47. /package/dist/libs/swiftui/src/{NavigationLink → components/NavigationLink}/index.d.ts +0 -0
  48. /package/dist/libs/swiftui/src/{NavigationLink → components/NavigationLink}/types.d.ts +0 -0
  49. /package/dist/libs/swiftui/src/{Picker.d.ts → components/Picker.d.ts} +0 -0
  50. /package/dist/libs/swiftui/src/{Text.d.ts → components/Text.d.ts} +0 -0
  51. /package/dist/libs/swiftui/src/{TextSubtitle.d.ts → components/TextSubtitle.d.ts} +0 -0
  52. /package/dist/libs/swiftui/src/{TextSubtitle.js → components/TextSubtitle.js} +0 -0
@@ -67,12 +67,7 @@ const phoneToText = (phone) => {
67
67
  }
68
68
  return extra ? `${base}${extra}` : base;
69
69
  };
70
- const dateToTextFormat = (date,
71
- /**
72
- Format of the date.
73
- @default 'YYYY-MM-DD'
74
- */
75
- format = 'YYYY-MM-DD') => {
70
+ const dateToTextFormat = (date, format = 'YYYY-MM-DD') => {
76
71
  const _format = format.replaceAll('Y', 'y').replaceAll('m', 'M').replaceAll('D', 'd');
77
72
  return DateFormatter(date, _format);
78
73
  };
@@ -9,8 +9,8 @@ export default memo(({ label, defaultValue, minDate = new Date(new Date().setFul
9
9
  const { index } = useItem();
10
10
  const [selection, setSelection] = useState(defaultValue);
11
11
  const _modifiers = useMemo(() => [
12
- environment('locale', 'es_ES'),
13
12
  ...(modifiers ?? []),
13
+ environment('locale', 'es_ES'),
14
14
  ], [modifiers]);
15
15
  // ------------------- Hooks -------------------
16
16
  useEffect(() => setSelection(defaultValue), [defaultValue]);
@@ -1,8 +1,8 @@
1
- export { default as NavigationLink } from './src/NavigationLink';
2
- export { default as Icon } from './src/Icon';
3
- export { default as IconSection } from './src/IconSection';
4
- export { default as List } from './src/List';
5
- export { default as Text } from './src/Text';
6
- export { default as Picker } from './src/Picker';
7
- export { default as TextSubtitle } from './src/TextSubtitle';
8
- export { default as Dialog } from './src/Dialog';
1
+ export { default as NavigationLink } from './src/components/NavigationLink';
2
+ export { default as Icon } from './src/components/Icon';
3
+ export { default as IconSection } from './src/components/IconSection';
4
+ export { default as List } from './src/components/List';
5
+ export { default as Text } from './src/components/Text';
6
+ export { default as Picker } from './src/components/Picker';
7
+ export { default as TextSubtitle } from './src/components/TextSubtitle';
8
+ export { default as Dialog } from './src/components/Dialog';
@@ -1,8 +1,8 @@
1
- export { default as NavigationLink } from './src/NavigationLink';
2
- export { default as Icon } from './src/Icon';
3
- export { default as IconSection } from './src/IconSection';
4
- export { default as List } from './src/List';
5
- export { default as Text } from './src/Text';
6
- export { default as Picker } from './src/Picker';
7
- export { default as TextSubtitle } from './src/TextSubtitle';
8
- export { default as Dialog } from './src/Dialog';
1
+ export { default as NavigationLink } from './src/components/NavigationLink';
2
+ export { default as Icon } from './src/components/Icon';
3
+ export { default as IconSection } from './src/components/IconSection';
4
+ export { default as List } from './src/components/List';
5
+ export { default as Text } from './src/components/Text';
6
+ export { default as Picker } from './src/components/Picker';
7
+ export { default as TextSubtitle } from './src/components/TextSubtitle';
8
+ export { default as Dialog } from './src/components/Dialog';
@@ -1,6 +1,6 @@
1
1
  import { ButtonProps } from '@expo/ui/swift-ui';
2
2
  import React from 'react';
3
- import { Props as GradientProps } from '../../../../libs/components/Gradient';
3
+ import { Props as GradientProps } from '../../../../../libs/components/Gradient';
4
4
  type Props = {
5
5
  /**
6
6
  The title of the icon section.
@@ -1,7 +1,7 @@
1
1
  import { Button, RNHostView, VStack } from '@expo/ui/swift-ui';
2
2
  import { frame, font, buttonStyle } from '@expo/ui/swift-ui/modifiers';
3
3
  import React, { memo, useMemo } from 'react';
4
- import Gradient from '../../../../libs/components/Gradient';
4
+ import Gradient from '../../../../../libs/components/Gradient';
5
5
  import Text from '../Text';
6
6
  import Section from './Section';
7
7
  export default memo(({ title, subtitle, gradientProps, buttonProps, }) => {
@@ -9,7 +9,7 @@ export default memo(({ children, modifiers, ...vStackProps }) => {
9
9
  listRowInsets({ bottom: 0.1 })
10
10
  ];
11
11
  return (<Section>
12
- <VStack spacing={20} modifiers={[..._modifiers, ...(modifiers || [])]} {...vStackProps}>
12
+ <VStack spacing={20} modifiers={[...(modifiers || []), ..._modifiers]} {...vStackProps}>
13
13
  {children}
14
14
  </VStack>
15
15
  </Section>);
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ /**
4
+ Wrapper de List que aplica un padding superior negativo por defecto.
5
+
6
+ Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
7
+ - padding({ top: -15 })
8
+ */
9
+ declare const _default: React.MemoExoticComponent<({ children, modifiers, disablePaddingTop, ...listProps }: Props) => React.JSX.Element>;
10
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { List } from '@expo/ui/swift-ui';
2
+ import { padding } from '@expo/ui/swift-ui/modifiers';
3
+ import React, { memo, useMemo } from 'react';
4
+ /**
5
+ Wrapper de List que aplica un padding superior negativo por defecto.
6
+
7
+ Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
8
+ - padding({ top: -15 })
9
+ */
10
+ export default memo(({ children, modifiers, disablePaddingTop = false, ...listProps }) => {
11
+ const _modifiers = useMemo(() => disablePaddingTop ? [] : [padding({ top: -15 })], [disablePaddingTop]);
12
+ return (<List modifiers={[...(modifiers || []), ..._modifiers]} {...listProps}>
13
+ {children}
14
+ </List>);
15
+ });
@@ -0,0 +1,9 @@
1
+ import { ListProps } from "@expo/ui/swift-ui";
2
+ type Props = ListProps & {
3
+ /**
4
+ Whether to disable the padding top of the list.
5
+ @default false
6
+ */
7
+ disablePaddingTop?: boolean;
8
+ };
9
+ export default Props;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type Props from "./types";
3
+ declare const _default: React.MemoExoticComponent<({ children, editMode, moveEnabled, deleteEnabled, modifiers, ...listProps }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { listStyle, environment, moveDisabled, deleteDisabled } from "@expo/ui/swift-ui/modifiers";
2
+ import React, { memo, useMemo } from "react";
3
+ import BaseList from "../../BaseList";
4
+ import { Provider } from '../../../../context/ListEditable';
5
+ export default memo(({ children, editMode, moveEnabled, deleteEnabled, modifiers, ...listProps }) => {
6
+ const _modifiers = useMemo(() => [
7
+ listStyle('inset'),
8
+ environment('editMode', editMode ? 'active' : 'inactive'),
9
+ moveDisabled(!(moveEnabled ?? true)),
10
+ deleteDisabled(!(deleteEnabled ?? true)),
11
+ ], [editMode, moveEnabled, deleteEnabled]);
12
+ const value = useMemo(() => ({ enableMove: moveEnabled, enableDelete: deleteEnabled }), [moveEnabled, deleteEnabled]);
13
+ return (<BaseList {...listProps} modifiers={[...(modifiers || []), ..._modifiers]}>
14
+ <Provider value={value}>
15
+ {children}
16
+ </Provider>
17
+ </BaseList>);
18
+ });
@@ -0,0 +1,16 @@
1
+ import type BaseListProps from '../../BaseList/types';
2
+ type Props = BaseListProps & {
3
+ /**
4
+ Whether the list is on edit mode.
5
+ */
6
+ editMode?: boolean;
7
+ /**
8
+ Whether to enable the move of the items.
9
+ */
10
+ moveEnabled?: boolean;
11
+ /**
12
+ Whether to enable the delete of the items.
13
+ */
14
+ deleteEnabled?: boolean;
15
+ };
16
+ export default Props;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type Props from "./types";
3
+ declare function Component<T>({ data, keyExtractor, onDelete, onMove, renderItem }: Props<T>): React.JSX.Element;
4
+ declare const _default: typeof Component;
5
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { List, Section } from "@expo/ui/swift-ui";
2
+ import { moveDisabled, tag, deleteDisabled } from "@expo/ui/swift-ui/modifiers";
3
+ import React, { memo, useCallback, useState } from "react";
4
+ import Hooks from '../../../../../../../libs/constants/hooks';
5
+ import { useListEditable } from "../../../../context/ListEditable";
6
+ function Component({ data = [], keyExtractor, onDelete, onMove, renderItem }) {
7
+ // ---------------------- Variables ----------------------
8
+ const { enableMove, enableDelete } = useListEditable();
9
+ const [_data, setData] = useState(data ?? []);
10
+ // ---------------------- Hooks ----------------------
11
+ Hooks.useEffectWithoutFirstRender(() => setData(data ?? []), [data]);
12
+ // ---------------------- Functions ----------------------
13
+ const handleDelete = useCallback((indices) => {
14
+ setData(prev => prev.filter((_, i) => !indices.includes(i)));
15
+ for (const index of indices)
16
+ onDelete?.({ index });
17
+ }, [onDelete]);
18
+ const handleMove = useCallback((sourceIndices, destination) => {
19
+ const adjustedDest = sourceIndices[0] < destination ? destination - 1 : destination;
20
+ setData(prev => {
21
+ const newData = [...prev];
22
+ const [removed] = newData.splice(sourceIndices[0], 1);
23
+ newData.splice(adjustedDest, 0, removed);
24
+ return newData;
25
+ });
26
+ onMove?.({ listIndexes: sourceIndices, destinationIndex: adjustedDest });
27
+ }, [onMove]);
28
+ return (<Section>
29
+ <List.ForEach onDelete={handleDelete} onMove={handleMove} modifiers={[moveDisabled(!enableMove), deleteDisabled(!enableDelete)]}>
30
+ {_data.map((item, index) => {
31
+ const key = keyExtractor?.(item) ?? index;
32
+ return renderItem?.({ item, tagModifier: tag(key) });
33
+ })}
34
+ </List.ForEach>
35
+ </Section>);
36
+ }
37
+ export default memo(Component);
@@ -0,0 +1,37 @@
1
+ import { ViewModifier } from "@expo/ui/swift-ui/modifiers";
2
+ type Props<T> = {
3
+ /**
4
+ The data items to be rendered inside the list.
5
+ @default []
6
+ */
7
+ data?: T[];
8
+ /**
9
+ The function to extract the key from the data item.
10
+ @example
11
+ keyExtractor={(item) => item.id}
12
+ */
13
+ keyExtractor?: (item: T) => string | number;
14
+ /**
15
+ The function to handle the delete event.
16
+
17
+ */
18
+ onDelete?: ({ index }: {
19
+ index: number;
20
+ }) => void;
21
+ /**
22
+ The function to handle the move event.
23
+ */
24
+ onMove?: ({ listIndexes, destinationIndex }: {
25
+ listIndexes: number[];
26
+ destinationIndex: number;
27
+ }) => void;
28
+ /**
29
+ The function to render the item.
30
+ The prop "modifier" is the modifier to be applied to the item [tag(key)].
31
+ */
32
+ renderItem?: ({ item, tagModifier }: {
33
+ item: T;
34
+ tagModifier: ViewModifier;
35
+ }) => React.ReactNode;
36
+ };
37
+ export default Props;
@@ -0,0 +1,7 @@
1
+ import List from './List';
2
+ import Section from './Section';
3
+ type Component = typeof List & {
4
+ Section: typeof Section;
5
+ };
6
+ declare const ListComponent: Component;
7
+ export default ListComponent;
@@ -0,0 +1,5 @@
1
+ import List from './List';
2
+ import Section from './Section';
3
+ const ListComponent = List;
4
+ ListComponent.Section = Section;
5
+ export default ListComponent;
@@ -0,0 +1,7 @@
1
+ import List from './BaseList';
2
+ import Editable from './Editable';
3
+ type Component = typeof List & {
4
+ Editable: typeof Editable;
5
+ };
6
+ declare const ListComponent: Component;
7
+ export default ListComponent;
@@ -0,0 +1,5 @@
1
+ import List from './BaseList';
2
+ import Editable from './Editable';
3
+ const ListComponent = List;
4
+ ListComponent.Editable = Editable;
5
+ export default ListComponent;
@@ -11,7 +11,7 @@ export default memo(({ children, systemImage, label, modifiers, maintainButtonSt
11
11
  const buttonSystemImage = !renderLabel ? systemImage : undefined;
12
12
  const buttonLabel = !renderLabel ? label : undefined;
13
13
  return (<HStack>
14
- <Button modifiers={[..._modifiers, ...(modifiers || [])]} systemImage={buttonSystemImage} label={buttonLabel} {...buttonProps}>
14
+ <Button modifiers={[...(modifiers || []), ..._modifiers]} systemImage={buttonSystemImage} label={buttonLabel} {...buttonProps}>
15
15
  {children}
16
16
  </Button>
17
17
  {!children && renderLabel && (<Label title={label} systemImage={systemImage}/>)}
@@ -3,7 +3,7 @@ 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
5
  const _modifiers = useMemo(() => [pickerStyle('menu')], []);
6
- return (<Picker modifiers={[..._modifiers, ...(modifiers || [])]} {...pickerProps}>
6
+ return (<Picker modifiers={[...(modifiers || []), ..._modifiers]} {...pickerProps}>
7
7
  {data.map(item => (<Text key={item} modifiers={[tag(item)]}>
8
8
  {item}
9
9
  </Text>))}
@@ -3,5 +3,5 @@ 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
5
  const _modifiers = useMemo(() => secondary ? [foregroundStyle({ type: 'hierarchical', style: 'secondary' })] : [], [secondary]);
6
- return (<Text modifiers={[..._modifiers, ...(modifiers || [])]} {...restProps}/>);
6
+ return (<Text modifiers={[...(modifiers || []), ..._modifiers]} {...restProps}/>);
7
7
  });
@@ -0,0 +1,7 @@
1
+ export declare const Provider: import("react").Provider<{
2
+ enableMove: boolean;
3
+ enableDelete: boolean;
4
+ }>, useListEditable: () => {
5
+ enableMove: boolean;
6
+ enableDelete: boolean;
7
+ };
@@ -0,0 +1,2 @@
1
+ import Utils from "../../../../libs/constants/utils";
2
+ export const [Provider, useListEditable] = Utils.createCtx();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.33",
3
+ "version": "1.0.37",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import type Props from "./types";
3
- declare function Component<T>({ children, data, keyExtractor, editMode, onDelete, onMove, renderItem, listProps, listForEachProps, listSectionProps, enableMove, enableDelete, withoutTopPadding, }: Props<T>): React.JSX.Element;
4
- declare const _default: typeof Component;
5
- export default _default;
@@ -1,51 +0,0 @@
1
- import { List, Section } from "@expo/ui/swift-ui";
2
- import { listStyle, environment, moveDisabled, tag, deleteDisabled, padding } from "@expo/ui/swift-ui/modifiers";
3
- import React, { memo, useCallback, useMemo, useState } from "react";
4
- import Hooks from '../../../../../libs/constants/hooks';
5
- function Component({ children, data = [], keyExtractor, editMode = false, onDelete, onMove, renderItem, listProps, listForEachProps, listSectionProps, enableMove = false, enableDelete = false, withoutTopPadding = false, }) {
6
- // ---------------------- Variables ----------------------
7
- const [_data, setData] = useState(data ?? []);
8
- // ---------------------- Hooks ----------------------
9
- Hooks.useEffectWithoutFirstRender(() => setData(data ?? []), [data]);
10
- // ---------------------- Modifiers ----------------------
11
- const modifiersList = useMemo(() => [
12
- listStyle('inset'),
13
- environment('editMode', editMode ? 'active' : 'inactive'),
14
- moveDisabled(!enableMove),
15
- deleteDisabled(!enableDelete),
16
- ...(withoutTopPadding ? [padding({ top: -15 })] : []),
17
- ], [editMode, enableMove, enableDelete, withoutTopPadding]);
18
- const modifiersListForEach = useMemo(() => [
19
- moveDisabled(!enableMove),
20
- deleteDisabled(!enableDelete)
21
- ], [enableMove, enableDelete]);
22
- // ---------------------- Functions ----------------------
23
- const handleDelete = useCallback((indices) => {
24
- setData(prev => prev.filter((_, i) => !indices.includes(i)));
25
- for (const index of indices) {
26
- onDelete?.({ index });
27
- }
28
- }, [onDelete]);
29
- const handleMove = useCallback((sourceIndices, destination) => {
30
- const adjustedDest = sourceIndices[0] < destination ? destination - 1 : destination;
31
- setData(prev => {
32
- const newData = [...prev];
33
- const [removed] = newData.splice(sourceIndices[0], 1);
34
- newData.splice(adjustedDest, 0, removed);
35
- return newData;
36
- });
37
- onMove?.({ listIndexes: sourceIndices, destinationIndex: adjustedDest });
38
- }, [onMove]);
39
- return (<List {...listProps} modifiers={[...modifiersList, ...(listProps?.modifiers || [])]}>
40
- {children}
41
- <Section {...listSectionProps}>
42
- <List.ForEach {...listForEachProps} onDelete={handleDelete} onMove={handleMove} modifiers={[...modifiersListForEach, ...(listForEachProps?.modifiers || [])]}>
43
- {_data.map((item, index) => {
44
- const key = keyExtractor?.(item) ?? index;
45
- return renderItem?.({ item, modifier: tag(key) });
46
- })}
47
- </List.ForEach>
48
- </Section>
49
- </List>);
50
- }
51
- export default memo(Component);
@@ -1,76 +0,0 @@
1
- import { ListProps, ListForEachProps, SectionProps } from "@expo/ui/swift-ui";
2
- import { ViewModifier } from "@expo/ui/swift-ui/modifiers";
3
- type Props<T> = {
4
- /**
5
- The children elements to be rendered inside the list.
6
- They will be rendered before the data items.
7
- */
8
- children?: React.ReactNode;
9
- /**
10
- The data items to be rendered inside the list.
11
- @default []
12
- */
13
- data?: T[];
14
- /**
15
- The function to extract the key from the data item.
16
- @example
17
- keyExtractor={(item) => item.id}
18
- */
19
- keyExtractor?: (item: T) => string | number;
20
- /**
21
- Whether the list is in edit mode.
22
- @default false
23
- */
24
- editMode?: boolean;
25
- /**
26
- The function to handle the delete event.
27
-
28
- */
29
- onDelete?: ({ index }: {
30
- index: number;
31
- }) => void;
32
- /**
33
- The function to handle the move event.
34
- */
35
- onMove?: ({ listIndexes, destinationIndex }: {
36
- listIndexes: number[];
37
- destinationIndex: number;
38
- }) => void;
39
- /**
40
- The function to render the item.
41
- The prop "modifier" is the modifier to be applied to the item [tag(key)].
42
- */
43
- renderItem?: ({ item, modifier }: {
44
- item: T;
45
- modifier: ViewModifier;
46
- }) => React.ReactNode;
47
- /**
48
- The props to be applied to the list.
49
- */
50
- listProps?: Omit<ListProps, 'children'>;
51
- /**
52
- The props to be applied to the list.
53
- */
54
- listForEachProps?: Omit<ListForEachProps, 'children' | 'onDelete' | 'onMove'>;
55
- /**
56
- The props to be applied to the list.
57
- */
58
- listSectionProps?: SectionProps;
59
- /**
60
- Whether to enable the move of the items.
61
- @default false
62
- */
63
- enableMove?: boolean;
64
- /**
65
- Whether to enable the delete of the items.
66
- @default false
67
- */
68
- enableDelete?: boolean;
69
- /**
70
- Whether to remove the top padding of the list.
71
- It puts [padding({ top: -15 })] to the list.
72
- @default false
73
- */
74
- withoutTopPadding?: boolean;
75
- };
76
- export default Props;
@@ -1,16 +0,0 @@
1
- import { ListProps } from '@expo/ui/swift-ui';
2
- import React from 'react';
3
- import Editable from './Editable';
4
- /**
5
- Wrapper de List que aplica un padding superior negativo por defecto.
6
-
7
- Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
8
- - padding({ top: -15 })
9
-
10
- También expone "List.Editable" para usar una versión editable de la lista.
11
- Para ponerle el padding superior negativo, se puede usar el prop "withoutTopPadding" = true en "List.Editable".
12
- */
13
- declare const Component: React.MemoExoticComponent<React.FC<ListProps>> & {
14
- Editable: typeof Editable;
15
- };
16
- export default Component;
@@ -1,21 +0,0 @@
1
- import { List } from '@expo/ui/swift-ui';
2
- import { padding } from '@expo/ui/swift-ui/modifiers';
3
- import React, { memo, useMemo } from 'react';
4
- import Editable from './Editable';
5
- /**
6
- Wrapper de List que aplica un padding superior negativo por defecto.
7
-
8
- Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
9
- - padding({ top: -15 })
10
-
11
- También expone "List.Editable" para usar una versión editable de la lista.
12
- Para ponerle el padding superior negativo, se puede usar el prop "withoutTopPadding" = true en "List.Editable".
13
- */
14
- const Component = memo(({ children, modifiers, ...listProps }) => {
15
- const _modifiers = useMemo(() => [padding({ top: -15 })], []);
16
- return (<List modifiers={[..._modifiers, ...(modifiers || [])]} {...listProps}>
17
- {children}
18
- </List>);
19
- });
20
- Component.Editable = Editable;
21
- export default Component;