react-native-exp-fig 0.1.34 → 0.1.35
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/lib/commonjs/common/icons-svg/carrier/inde.js +39 -0
- package/lib/commonjs/common/icons-svg/carrier/inde.js.map +1 -0
- package/lib/commonjs/common/icons-svg/constants/index.js +2 -1
- package/lib/commonjs/common/icons-svg/constants/index.js.map +1 -1
- package/lib/commonjs/common/icons-svg/index.js +7 -0
- package/lib/commonjs/common/icons-svg/index.js.map +1 -1
- package/lib/commonjs/components/activity-timeline/components/activite-row/index.js +16 -13
- package/lib/commonjs/components/activity-timeline/components/activite-row/index.js.map +1 -1
- package/lib/commonjs/components/activity-timeline/index.js +7 -7
- package/lib/commonjs/components/activity-timeline/index.js.map +1 -1
- package/lib/commonjs/components/activity-timeline/interface.js.map +1 -1
- package/lib/commonjs/stories/activity-timeline/activity-timeline.stories.js +29 -18
- package/lib/commonjs/stories/activity-timeline/activity-timeline.stories.js.map +1 -1
- package/lib/module/common/icons-svg/carrier/inde.js +31 -0
- package/lib/module/common/icons-svg/carrier/inde.js.map +1 -0
- package/lib/module/common/icons-svg/constants/index.js +2 -1
- package/lib/module/common/icons-svg/constants/index.js.map +1 -1
- package/lib/module/common/icons-svg/index.js +7 -0
- package/lib/module/common/icons-svg/index.js.map +1 -1
- package/lib/module/components/activity-timeline/components/activite-row/index.js +16 -13
- package/lib/module/components/activity-timeline/components/activite-row/index.js.map +1 -1
- package/lib/module/components/activity-timeline/index.js +7 -7
- package/lib/module/components/activity-timeline/index.js.map +1 -1
- package/lib/module/components/activity-timeline/interface.js.map +1 -1
- package/lib/module/stories/activity-timeline/activity-timeline.stories.js +29 -18
- package/lib/module/stories/activity-timeline/activity-timeline.stories.js.map +1 -1
- package/lib/typescript/src/common/icons-svg/carrier/inde.d.ts +10 -0
- package/lib/typescript/src/common/icons-svg/constants/index.d.ts +1 -0
- package/lib/typescript/src/components/activity-timeline/components/activite-row/index.d.ts +1 -1
- package/lib/typescript/src/components/activity-timeline/index.d.ts +2 -1
- package/lib/typescript/src/components/activity-timeline/interface.d.ts +18 -7
- package/lib/typescript/src/components/selects/select-date-and-hours/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/common/icons-svg/carrier/inde.tsx +31 -0
- package/src/common/icons-svg/constants/index.ts +1 -0
- package/src/common/icons-svg/index.tsx +4 -0
- package/src/components/activity-timeline/components/activite-row/index.tsx +134 -133
- package/src/components/activity-timeline/index.tsx +72 -72
- package/src/components/activity-timeline/interface.ts +67 -53
- package/src/stories/activity-timeline/activity-timeline.stories.tsx +99 -90
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import Svg, { Path } from "react-native-svg";
|
|
6
|
+
|
|
7
|
+
//typings
|
|
8
|
+
import { ISvgProps } from "../interface";
|
|
9
|
+
|
|
10
|
+
const SvgIconCarrier: React.FC<ISvgProps> = ({ color, size = 17 }) => (
|
|
11
|
+
<Svg
|
|
12
|
+
//@ts-ignore
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
width={size}
|
|
15
|
+
height={size - 2}
|
|
16
|
+
fill="none"
|
|
17
|
+
viewBox="0 0 17 15"
|
|
18
|
+
>
|
|
19
|
+
<Path
|
|
20
|
+
fill={color ?? "#2BA20D"}
|
|
21
|
+
fillRule="evenodd"
|
|
22
|
+
d="M15.938 13.125c0 .516-.477.938-1.063.938H2.125c-.586 0-1.062-.422-1.062-.938V1.875c0-.516.476-.937 1.062-.937h12.75c.586 0 1.063.421 1.063.937zM14.875 0H2.125C.951 0 0 .84 0 1.875v11.25C0 14.161.951 15 2.125 15h12.75C16.049 15 17 14.16 17 13.125V1.875C17 .839 16.049 0 14.875 0m-3.187 7.031H9.03V4.688c0-.258-.238-.47-.531-.47s-.531.212-.531.47V7.03H5.312c-.293 0-.53.211-.53.469s.237.469.53.469H7.97v2.343c0 .258.238.47.531.47s.531-.212.531-.47V7.97h2.656c.294 0 .532-.211.532-.469s-.238-.469-.531-.469"
|
|
23
|
+
clipRule="evenodd"
|
|
24
|
+
></Path>
|
|
25
|
+
</Svg>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* EXPORTS
|
|
30
|
+
*/
|
|
31
|
+
export { SvgIconCarrier };
|
|
@@ -59,6 +59,7 @@ import { SvgPackage } from "./package";
|
|
|
59
59
|
import { SvgIconHouse } from "./house";
|
|
60
60
|
import { SvgIconWarningTriangle } from "./eclamation-triangle";
|
|
61
61
|
import { SvgIconScales } from "./scales";
|
|
62
|
+
import { SvgIconCarrier } from "./carrier/inde";
|
|
62
63
|
|
|
63
64
|
// typing
|
|
64
65
|
import { ISvgProps } from "./interface";
|
|
@@ -162,6 +163,9 @@ const Icons: React.FC<ISvgProps> = ({ icon, color, size, background }) => {
|
|
|
162
163
|
case "NOTE_PINCEL":
|
|
163
164
|
return <SvgIconNotePencil color={color} size={size} icon={"NOTE_PINCEL"} />;
|
|
164
165
|
|
|
166
|
+
case "CARRIER":
|
|
167
|
+
return <SvgIconCarrier color={color} size={size} icon={"CARRIER"} />;
|
|
168
|
+
|
|
165
169
|
case "CHECK_CIRCLE":
|
|
166
170
|
return (
|
|
167
171
|
<SvgIconCheckCircle
|
|
@@ -1,133 +1,134 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React, { forwardRef, useCallback } from "react";
|
|
5
|
-
import { TouchableOpacity, View } from "react-native";
|
|
6
|
-
|
|
7
|
-
// components
|
|
8
|
-
import { Typography } from "../../../../components/typography";
|
|
9
|
-
|
|
10
|
-
// commons / svg
|
|
11
|
-
import { Icons } from "../../../../common/icons-svg";
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useCallback } from "react";
|
|
5
|
+
import { TouchableOpacity, View } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import { Typography } from "../../../../components/typography";
|
|
9
|
+
|
|
10
|
+
// commons / svg
|
|
11
|
+
import { Icons } from "../../../../common/icons-svg";
|
|
12
|
+
|
|
13
|
+
// utils
|
|
14
|
+
import { formHoursMinute } from "../../../../utils/format-data";
|
|
15
|
+
|
|
16
|
+
// typings
|
|
17
|
+
import type { IActivitieRowProps } from "../../interface";
|
|
18
|
+
import { asBaseComponent } from "../../../../@types/as-base-component";
|
|
19
|
+
|
|
20
|
+
// styles
|
|
21
|
+
import { theme } from "../../../../styles/theme/theme";
|
|
22
|
+
import { styles } from "../../styles";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Componente ActivityRows para a interação da ui.
|
|
26
|
+
*/
|
|
27
|
+
const ActivityRows = forwardRef<any, IActivitieRowProps>(
|
|
28
|
+
({ index, activities, items, onAdd, onEdit, onDelete }, ref): React.ReactElement => {
|
|
29
|
+
const handleAdd = useCallback(() => onAdd(activities), [onAdd, activities]);
|
|
30
|
+
const handleEdit = useCallback(() => onEdit(activities), [onEdit, activities]);
|
|
31
|
+
const handleDelete = useCallback(() => onDelete(activities), [onDelete, activities]);
|
|
32
|
+
|
|
33
|
+
const isInvalid = formHoursMinute(activities?.duracao_segundos as string) === "00:00";
|
|
34
|
+
|
|
35
|
+
const dateStart = activities.data_inicio;
|
|
36
|
+
|
|
37
|
+
const timeText = formHoursMinute(activities?.duracao_segundos as string);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<View ref={ref} style={styles.row}>
|
|
41
|
+
<View style={styles.badge}>
|
|
42
|
+
<Typography
|
|
43
|
+
text={String(index + 1)}
|
|
44
|
+
color={theme.colors.neutral[25]}
|
|
45
|
+
size={theme.fontSizes.sm}
|
|
46
|
+
fontFamily={theme.fonts.inter_bold_700}
|
|
47
|
+
/>
|
|
48
|
+
</View>
|
|
49
|
+
|
|
50
|
+
{Boolean(index !== items?.length - 1) && (
|
|
51
|
+
<View
|
|
52
|
+
style={{
|
|
53
|
+
width: 2,
|
|
54
|
+
height: 76,
|
|
55
|
+
backgroundColor: theme.colors.blue[500],
|
|
56
|
+
position: "absolute",
|
|
57
|
+
left: 21,
|
|
58
|
+
top: 60,
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
<View style={styles.card}>
|
|
64
|
+
<Typography
|
|
65
|
+
numberOfLines={1}
|
|
66
|
+
style={styles.title}
|
|
67
|
+
text={activities.descricao ?? "Não informada"}
|
|
68
|
+
color={isInvalid ? theme.colors.red[900] : theme.colors.blue[500]}
|
|
69
|
+
size={14}
|
|
70
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
71
|
+
lineHeight={34}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<View style={[styles.pill, isInvalid ? styles.pillInvalid : styles.pillOk]}>
|
|
75
|
+
<Icons
|
|
76
|
+
icon="CALENDAR"
|
|
77
|
+
size={18}
|
|
78
|
+
color={isInvalid ? theme.colors.red[900] : theme.colors.blue[500]}
|
|
79
|
+
/>
|
|
80
|
+
<Typography
|
|
81
|
+
text={dateStart}
|
|
82
|
+
color={isInvalid ? theme.colors.red[800] : theme.colors.blue[400]}
|
|
83
|
+
size={theme.fontSizes.xs}
|
|
84
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
85
|
+
/>
|
|
86
|
+
<Typography
|
|
87
|
+
text="|"
|
|
88
|
+
color={isInvalid ? theme.colors.red[800] : theme.colors.blue[400]}
|
|
89
|
+
size={theme.fontSizes.sm}
|
|
90
|
+
style={styles.sep}
|
|
91
|
+
/>
|
|
92
|
+
<Typography
|
|
93
|
+
text={timeText}
|
|
94
|
+
color={isInvalid ? theme.colors.red[800] : theme.colors.blue[500]}
|
|
95
|
+
size={theme.fontSizes.xs}
|
|
96
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
97
|
+
/>
|
|
98
|
+
</View>
|
|
99
|
+
</View>
|
|
100
|
+
|
|
101
|
+
<View style={styles.actions}>
|
|
102
|
+
<TouchableOpacity style={styles.iconButton} onPress={handleEdit} testID="edit-activity">
|
|
103
|
+
<Icons icon="NOTE_PINCEL" size={18} color={theme.colors.blue[350]} />
|
|
104
|
+
</TouchableOpacity>
|
|
105
|
+
|
|
106
|
+
<TouchableOpacity
|
|
107
|
+
style={styles.iconButton}
|
|
108
|
+
onPress={handleAdd}
|
|
109
|
+
testID="add-after-activity"
|
|
110
|
+
>
|
|
111
|
+
{/* Não há PLUS_CONTAINER, usando PLUS como alternativa visual */}
|
|
112
|
+
<Icons icon="CARRIER" size={18} color={theme.colors.green[500]} />
|
|
113
|
+
</TouchableOpacity>
|
|
114
|
+
|
|
115
|
+
<TouchableOpacity
|
|
116
|
+
style={styles.iconButton}
|
|
117
|
+
onPress={handleDelete}
|
|
118
|
+
testID="delete-activity"
|
|
119
|
+
>
|
|
120
|
+
{/* Não há TRASH, usando X_CIRCLE como alternativa de remover */}
|
|
121
|
+
<Icons icon="X_CIRCLE" size={18} color={theme.colors.red[900]} />
|
|
122
|
+
</TouchableOpacity>
|
|
123
|
+
</View>
|
|
124
|
+
</View>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
ActivityRows.displayName = "ActivityRows";
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* EXPORTS
|
|
133
|
+
*/
|
|
134
|
+
export default asBaseComponent(ActivityRows);
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React, { forwardRef, useCallback } from "react";
|
|
5
|
-
import { View, FlatList } from "react-native";
|
|
6
|
-
|
|
7
|
-
// components
|
|
8
|
-
import ActivityRows from "./components/activite-row";
|
|
9
|
-
|
|
10
|
-
// typings
|
|
11
|
-
import type { ActivityItemModel, ActivityTimelineProps } from "./interface";
|
|
12
|
-
import { asBaseComponent } from "../../@types/as-base-component";
|
|
13
|
-
|
|
14
|
-
// styles
|
|
15
|
-
import { styles, ROW_HEIGHT } from "./styles";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Componente ActivityTimeline para a interação da ui.
|
|
19
|
-
*/
|
|
20
|
-
const ActivityTimeline = forwardRef<any, ActivityTimelineProps
|
|
21
|
-
(
|
|
22
|
-
{ data, onAdd, onEdit, onDelete, showIndexBadge = true, testID = "activity-timeline" },
|
|
23
|
-
ref
|
|
24
|
-
): React.ReactElement => {
|
|
25
|
-
const keyExtractor = useCallback((it: ActivityItemModel) => String(it.id), []);
|
|
26
|
-
|
|
27
|
-
const renderItem = useCallback(
|
|
28
|
-
({ item, index }: { item:
|
|
29
|
-
<ActivityRows
|
|
30
|
-
index={index}
|
|
31
|
-
items={data}
|
|
32
|
-
activities={item}
|
|
33
|
-
onAdd={onAdd}
|
|
34
|
-
onEdit={onEdit}
|
|
35
|
-
onDelete={onDelete}
|
|
36
|
-
showIndexBadge={showIndexBadge}
|
|
37
|
-
/>
|
|
38
|
-
),
|
|
39
|
-
[onAdd, onEdit, onDelete, showIndexBadge]
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const getItemLayout = useCallback(
|
|
43
|
-
(_: any, index: number) => ({
|
|
44
|
-
length: ROW_HEIGHT,
|
|
45
|
-
offset: ROW_HEIGHT * index,
|
|
46
|
-
index,
|
|
47
|
-
}),
|
|
48
|
-
[]
|
|
49
|
-
);
|
|
50
|
-
return (
|
|
51
|
-
<FlatList
|
|
52
|
-
ref={ref}
|
|
53
|
-
testID={testID}
|
|
54
|
-
data={data}
|
|
55
|
-
keyExtractor={keyExtractor}
|
|
56
|
-
renderItem={renderItem}
|
|
57
|
-
contentContainerStyle={styles.listContainer}
|
|
58
|
-
getItemLayout={getItemLayout}
|
|
59
|
-
initialNumToRender={10}
|
|
60
|
-
maxToRenderPerBatch={10}
|
|
61
|
-
removeClippedSubviews
|
|
62
|
-
windowSize={
|
|
63
|
-
ListEmptyComponent={<View style={{ height: 8 }} />}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* EXPORTS
|
|
71
|
-
*/
|
|
72
|
-
export default asBaseComponent(ActivityTimeline);
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useCallback } from "react";
|
|
5
|
+
import { View, FlatList } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import ActivityRows from "./components/activite-row";
|
|
9
|
+
|
|
10
|
+
// typings
|
|
11
|
+
import type { ActivityItemModel, ActivityTimelineProps, IDataActivityProps } from "./interface";
|
|
12
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
13
|
+
|
|
14
|
+
// styles
|
|
15
|
+
import { styles, ROW_HEIGHT } from "./styles";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Componente ActivityTimeline para a interação da ui.
|
|
19
|
+
*/
|
|
20
|
+
const ActivityTimeline = forwardRef<any, ActivityTimelineProps>(
|
|
21
|
+
(
|
|
22
|
+
{ data, onAdd, onEdit, onDelete, showIndexBadge = true, testID = "activity-timeline" },
|
|
23
|
+
ref
|
|
24
|
+
): React.ReactElement => {
|
|
25
|
+
const keyExtractor = useCallback((it: ActivityItemModel) => String(it.id), []);
|
|
26
|
+
|
|
27
|
+
const renderItem = useCallback(
|
|
28
|
+
({ item, index }: { item: IDataActivityProps; index: number }) => (
|
|
29
|
+
<ActivityRows
|
|
30
|
+
index={index}
|
|
31
|
+
items={data}
|
|
32
|
+
activities={item}
|
|
33
|
+
onAdd={onAdd}
|
|
34
|
+
onEdit={onEdit}
|
|
35
|
+
onDelete={onDelete}
|
|
36
|
+
showIndexBadge={showIndexBadge}
|
|
37
|
+
/>
|
|
38
|
+
),
|
|
39
|
+
[onAdd, onEdit, onDelete, showIndexBadge]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const getItemLayout = useCallback(
|
|
43
|
+
(_: any, index: number) => ({
|
|
44
|
+
length: ROW_HEIGHT,
|
|
45
|
+
offset: ROW_HEIGHT * index,
|
|
46
|
+
index,
|
|
47
|
+
}),
|
|
48
|
+
[]
|
|
49
|
+
);
|
|
50
|
+
return (
|
|
51
|
+
<FlatList
|
|
52
|
+
ref={ref}
|
|
53
|
+
testID={testID}
|
|
54
|
+
data={data as any[]}
|
|
55
|
+
keyExtractor={keyExtractor}
|
|
56
|
+
renderItem={renderItem as any}
|
|
57
|
+
contentContainerStyle={styles.listContainer}
|
|
58
|
+
getItemLayout={getItemLayout}
|
|
59
|
+
initialNumToRender={10}
|
|
60
|
+
maxToRenderPerBatch={10}
|
|
61
|
+
removeClippedSubviews
|
|
62
|
+
windowSize={10}
|
|
63
|
+
ListEmptyComponent={<View style={{ height: 8 }} />}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* EXPORTS
|
|
71
|
+
*/
|
|
72
|
+
export default asBaseComponent(ActivityTimeline);
|
|
@@ -1,53 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
OnActivity
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/**
|
|
3
|
+
* IMPORTS
|
|
4
|
+
*/
|
|
5
|
+
import type { TouchableOpacityProps } from "react-native";
|
|
6
|
+
import type { SVG_NAME } from "../../common/icons-svg/constants";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* TYPES
|
|
10
|
+
*/
|
|
11
|
+
type ActivityId = string | number;
|
|
12
|
+
|
|
13
|
+
type ActivityItemModel = {
|
|
14
|
+
id: ActivityId;
|
|
15
|
+
title: string; // "Operação com veículo", "Refeição", ...
|
|
16
|
+
date: Date | string; // pode vir Date ou string já formatada
|
|
17
|
+
time: Date | string; // idem
|
|
18
|
+
invalid?: boolean; // destaca em vermelho
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type IDataActivityProps = {
|
|
22
|
+
id?: number | string;
|
|
23
|
+
ec_tipo_atividade_id?: number;
|
|
24
|
+
duracao_segundos: string | number;
|
|
25
|
+
data_inicio: string;
|
|
26
|
+
data_fim: string;
|
|
27
|
+
descricao: string;
|
|
28
|
+
sincronizado: boolean;
|
|
29
|
+
tipo: string;
|
|
30
|
+
referencia: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type IconName = keyof typeof SVG_NAME;
|
|
34
|
+
|
|
35
|
+
type OnActivity = (item: IDataActivityProps) => void;
|
|
36
|
+
|
|
37
|
+
type ActivityTimelineProps = TouchableOpacityProps & {
|
|
38
|
+
data: IDataActivityProps[];
|
|
39
|
+
onAdd: OnActivity; // add novo após o item
|
|
40
|
+
onEdit: OnActivity;
|
|
41
|
+
onDelete: OnActivity;
|
|
42
|
+
showIndexBadge?: boolean; // mostra o “3/4/5”
|
|
43
|
+
testID?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type IActivitieRowProps = {
|
|
47
|
+
index: number;
|
|
48
|
+
activities: IDataActivityProps;
|
|
49
|
+
items: IDataActivityProps[];
|
|
50
|
+
onAdd: OnActivity;
|
|
51
|
+
onEdit: OnActivity;
|
|
52
|
+
onDelete: OnActivity;
|
|
53
|
+
showIndexBadge?: boolean;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* EXPORTS
|
|
58
|
+
*/
|
|
59
|
+
export type {
|
|
60
|
+
ActivityId,
|
|
61
|
+
ActivityItemModel,
|
|
62
|
+
IconName,
|
|
63
|
+
OnActivity,
|
|
64
|
+
ActivityTimelineProps,
|
|
65
|
+
IActivitieRowProps,
|
|
66
|
+
IDataActivityProps,
|
|
67
|
+
};
|