react-native-exp-fig 0.1.33 → 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/common/icons-svg/modal-activities/index.js +8 -0
- package/lib/commonjs/common/icons-svg/modal-activities/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/components/modals/modal-activities/data-activities/index.js +6 -6
- package/lib/commonjs/components/modals/modal-activities/data-activities/index.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/commonjs/utils/get-icon-by-property/index.js +6 -1
- package/lib/commonjs/utils/get-icon-by-property/index.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/common/icons-svg/modal-activities/index.js +8 -0
- package/lib/module/common/icons-svg/modal-activities/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/components/modals/modal-activities/data-activities/index.js +6 -6
- package/lib/module/components/modals/modal-activities/data-activities/index.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/module/utils/get-icon-by-property/index.js +6 -1
- package/lib/module/utils/get-icon-by-property/index.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/common/icons-svg/modal-activities/index.d.ts +2 -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/lib/typescript/src/utils/get-icon-by-property/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/common/icons-svg/modal-activities/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/components/modals/modal-activities/data-activities/index.ts +6 -6
- package/src/stories/activity-timeline/activity-timeline.stories.tsx +99 -90
- package/src/utils/get-icon-by-property/index.tsx +5 -1
|
@@ -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
|
+
};
|
|
@@ -16,9 +16,9 @@ const baseActivities: Record<string, IActivity[]> = {
|
|
|
16
16
|
trabalho: [
|
|
17
17
|
{
|
|
18
18
|
id: 1,
|
|
19
|
-
referencia: "
|
|
19
|
+
referencia: "operacao_veiculo",
|
|
20
20
|
cor_hex: "#000000",
|
|
21
|
-
descricao: "
|
|
21
|
+
descricao: "Operação com Veículo",
|
|
22
22
|
tipo: "trabalho",
|
|
23
23
|
},
|
|
24
24
|
{
|
|
@@ -83,15 +83,15 @@ export const activitiesByDriverType: Record<string, Record<string, IActivity[]>>
|
|
|
83
83
|
carregador: {
|
|
84
84
|
trabalho: [
|
|
85
85
|
{
|
|
86
|
-
id:
|
|
87
|
-
referencia: "
|
|
86
|
+
id: 22,
|
|
87
|
+
referencia: "em_operacao_carregamento",
|
|
88
88
|
cor_hex: "#000000",
|
|
89
|
-
descricao: "Em
|
|
89
|
+
descricao: "Em operação - Carregamento",
|
|
90
90
|
tipo: "trabalho",
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
id: 21,
|
|
94
|
-
referencia: "
|
|
94
|
+
referencia: "tempo_disposicao",
|
|
95
95
|
cor_hex: "#000000",
|
|
96
96
|
descricao: "Tempo à Disposição",
|
|
97
97
|
tipo: "trabalho",
|