jornada-ui 0.4.12 → 0.4.14
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/components/coil-removel-code/index.js +4 -3
- package/lib/commonjs/components/coil-removel-code/index.js.map +1 -1
- package/lib/commonjs/components/list-devices/components/list-device-empty/index.js +68 -0
- package/lib/commonjs/components/list-devices/components/list-device-empty/index.js.map +1 -0
- package/lib/commonjs/components/list-devices/components/list-device-render-item/index.js +77 -0
- package/lib/commonjs/components/list-devices/components/list-device-render-item/index.js.map +1 -0
- package/lib/commonjs/components/list-devices/index.js +33 -58
- package/lib/commonjs/components/list-devices/index.js.map +1 -1
- package/lib/commonjs/components/list-devices/interface.js +2 -0
- package/lib/commonjs/components/list-devices/interface.js.map +1 -0
- package/lib/commonjs/components/list-devices/styles.js +14 -3
- package/lib/commonjs/components/list-devices/styles.js.map +1 -1
- package/lib/commonjs/components/modals/modal-to-confimations/index.js +1 -1
- package/lib/commonjs/components/modals/modal-to-confimations/index.js.map +1 -1
- package/lib/commonjs/components/selects/select-option/index.js +22 -7
- package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/index.js +54 -40
- package/lib/commonjs/components/step-indicator/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/styles.js.map +1 -1
- package/lib/commonjs/components/trip-details-card/index.js +8 -9
- package/lib/commonjs/components/trip-details-card/index.js.map +1 -1
- package/lib/commonjs/stories/step-indicator/step-indicator.stories.js +1 -0
- package/lib/commonjs/stories/step-indicator/step-indicator.stories.js.map +1 -1
- package/lib/commonjs/utils/text-limit/index.js +37 -0
- package/lib/commonjs/utils/text-limit/index.js.map +1 -0
- package/lib/module/components/coil-removel-code/index.js +4 -3
- package/lib/module/components/coil-removel-code/index.js.map +1 -1
- package/lib/module/components/list-devices/components/list-device-empty/index.js +63 -0
- package/lib/module/components/list-devices/components/list-device-empty/index.js.map +1 -0
- package/lib/module/components/list-devices/components/list-device-render-item/index.js +74 -0
- package/lib/module/components/list-devices/components/list-device-render-item/index.js.map +1 -0
- package/lib/module/components/list-devices/index.js +36 -61
- package/lib/module/components/list-devices/index.js.map +1 -1
- package/lib/module/components/list-devices/interface.js +2 -0
- package/lib/module/components/list-devices/interface.js.map +1 -0
- package/lib/module/components/list-devices/styles.js +14 -3
- package/lib/module/components/list-devices/styles.js.map +1 -1
- package/lib/module/components/modals/modal-to-confimations/index.js +1 -1
- package/lib/module/components/modals/modal-to-confimations/index.js.map +1 -1
- package/lib/module/components/selects/select-option/index.js +22 -7
- package/lib/module/components/selects/select-option/index.js.map +1 -1
- package/lib/module/components/step-indicator/index.js +55 -41
- package/lib/module/components/step-indicator/index.js.map +1 -1
- package/lib/module/components/step-indicator/styles.js.map +1 -1
- package/lib/module/components/trip-details-card/index.js +11 -11
- package/lib/module/components/trip-details-card/index.js.map +1 -1
- package/lib/module/stories/step-indicator/step-indicator.stories.js +1 -0
- package/lib/module/stories/step-indicator/step-indicator.stories.js.map +1 -1
- package/lib/module/utils/text-limit/index.js +32 -0
- package/lib/module/utils/text-limit/index.js.map +1 -0
- package/lib/typescript/commonjs/src/components/coil-removel-code/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-render-item/index.d.ts +22 -0
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-render-item/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/list-devices/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/list-devices/interface.d.ts +29 -0
- package/lib/typescript/commonjs/src/components/list-devices/interface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/list-devices/styles.d.ts +5 -5
- package/lib/typescript/commonjs/src/components/list-devices/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/selects/select-option/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/step-indicator/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/step-indicator/styles.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/step-indicator/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/trip-details-card/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/stories/step-indicator/step-indicator.stories.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/text-limit/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/utils/text-limit/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/coil-removel-code/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts +10 -0
- package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/list-devices/components/list-device-render-item/index.d.ts +22 -0
- package/lib/typescript/module/src/components/list-devices/components/list-device-render-item/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/list-devices/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/list-devices/interface.d.ts +29 -0
- package/lib/typescript/module/src/components/list-devices/interface.d.ts.map +1 -0
- package/lib/typescript/module/src/components/list-devices/styles.d.ts +5 -5
- package/lib/typescript/module/src/components/list-devices/styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/selects/select-option/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/step-indicator/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/step-indicator/styles.d.ts +2 -2
- package/lib/typescript/module/src/components/step-indicator/styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/trip-details-card/index.d.ts.map +1 -1
- package/lib/typescript/module/src/stories/step-indicator/step-indicator.stories.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/text-limit/index.d.ts +14 -0
- package/lib/typescript/module/src/utils/text-limit/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/coil-removel-code/index.tsx +8 -3
- package/src/components/coil-removel-code/interface.d.ts +14 -13
- package/src/components/list-devices/components/list-device-empty/index.tsx +60 -0
- package/src/components/list-devices/components/list-device-render-item/index.tsx +86 -0
- package/src/components/list-devices/index.tsx +71 -102
- package/src/components/list-devices/{interface.d.ts → interface.ts} +36 -36
- package/src/components/list-devices/styles.ts +73 -68
- package/src/components/modals/modal-to-confimations/index.tsx +1 -1
- package/src/components/selects/select-option/index.tsx +124 -95
- package/src/components/step-indicator/index.tsx +56 -36
- package/src/components/step-indicator/interface.d.ts +14 -3
- package/src/components/step-indicator/styles.ts +2 -2
- package/src/components/trip-details-card/index.tsx +267 -270
- package/src/stories/step-indicator/step-indicator.stories.tsx +1 -0
- package/src/utils/text-limit/index.ts +28 -0
- package/lib/commonjs/components/list-devices/interface.d.js +0 -2
- package/lib/commonjs/components/list-devices/interface.d.js.map +0 -1
- package/lib/module/components/list-devices/interface.d.js +0 -2
- package/lib/module/components/list-devices/interface.d.js.map +0 -1
|
@@ -1,95 +1,124 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React, { forwardRef, useState } from "react";
|
|
5
|
-
import { View, Text, TouchableOpacity, Modal, FlatList } from "react-native";
|
|
6
|
-
|
|
7
|
-
// commons / svg
|
|
8
|
-
import { Icons } from "../../../common/icons-svg";
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useState } from "react";
|
|
5
|
+
import { View, Text, TouchableOpacity, Modal, FlatList } from "react-native";
|
|
6
|
+
|
|
7
|
+
// commons / svg
|
|
8
|
+
import { Icons } from "../../../common/icons-svg";
|
|
9
|
+
|
|
10
|
+
// utils
|
|
11
|
+
import { handleLimitTextdisplayByAmount } from "../../../utils/text-limit";
|
|
12
|
+
|
|
13
|
+
// typings
|
|
14
|
+
import { asBaseComponent } from "../../../@types/as-base-component";
|
|
15
|
+
import type { ISelectDropDownProps } from "./interface";
|
|
16
|
+
|
|
17
|
+
// styles
|
|
18
|
+
import { styles } from "./styles";
|
|
19
|
+
import { theme } from "../../../styles/theme/theme";
|
|
20
|
+
|
|
21
|
+
const SelectOption = forwardRef<any, ISelectDropDownProps>((props, ref): React.ReactElement => {
|
|
22
|
+
const {
|
|
23
|
+
dataOption,
|
|
24
|
+
handleSelectDown,
|
|
25
|
+
titleLabel,
|
|
26
|
+
sizeTitleLabel,
|
|
27
|
+
colortitleLabel,
|
|
28
|
+
backgroundColor,
|
|
29
|
+
} = props;
|
|
30
|
+
|
|
31
|
+
const [selectedValue, setSelectedValue] = useState(dataOption[0]?.value || "");
|
|
32
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
33
|
+
|
|
34
|
+
const handleSelect = (value: string) => {
|
|
35
|
+
setSelectedValue(value);
|
|
36
|
+
setModalVisible(false);
|
|
37
|
+
handleSelectDown(value);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const styleProps = {
|
|
41
|
+
dataOption,
|
|
42
|
+
handleSelectDown,
|
|
43
|
+
titleLabel,
|
|
44
|
+
sizeTitleLabel,
|
|
45
|
+
colortitleLabel,
|
|
46
|
+
backgroundColor,
|
|
47
|
+
} as ISelectDropDownProps;
|
|
48
|
+
return (
|
|
49
|
+
<View ref={ref} style={styles(styleProps).container}>
|
|
50
|
+
{/* Titulo para exibir o label */}
|
|
51
|
+
<Text style={styles(styleProps).label}>{`${titleLabel ?? "Selecione uma opção"}`}:</Text>
|
|
52
|
+
|
|
53
|
+
{/* Botão para abrir o modal */}
|
|
54
|
+
<TouchableOpacity
|
|
55
|
+
testID="select-box"
|
|
56
|
+
style={styles(styleProps).selectBox}
|
|
57
|
+
onPress={() => setModalVisible(true)}
|
|
58
|
+
>
|
|
59
|
+
<Text style={styles(styleProps).selectedText} numberOfLines={1}>
|
|
60
|
+
{`${handleLimitTextdisplayByAmount({
|
|
61
|
+
limit: 42,
|
|
62
|
+
text: dataOption.find((item) => item.value === selectedValue)?.label!,
|
|
63
|
+
})}`}
|
|
64
|
+
</Text>
|
|
65
|
+
|
|
66
|
+
<Icons
|
|
67
|
+
size={theme.fontSizes["xs"]}
|
|
68
|
+
color={theme.colors.blue[500]}
|
|
69
|
+
icon={"ARROW_DROP_DOWN"}
|
|
70
|
+
/>
|
|
71
|
+
</TouchableOpacity>
|
|
72
|
+
|
|
73
|
+
{/* Modal para exibir as opções */}
|
|
74
|
+
<Modal testID="modal-container" visible={modalVisible} transparent animationType="fade">
|
|
75
|
+
<View style={styles(styleProps).modalOverlay}>
|
|
76
|
+
<View style={styles(styleProps).modalContainer}>
|
|
77
|
+
<View
|
|
78
|
+
style={{
|
|
79
|
+
width: "100%",
|
|
80
|
+
alignItems: "flex-end",
|
|
81
|
+
height: 40,
|
|
82
|
+
paddingRight: 8,
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<TouchableOpacity
|
|
86
|
+
testID="close-icon"
|
|
87
|
+
onPress={() => setModalVisible(false)}
|
|
88
|
+
style={{
|
|
89
|
+
width: 40,
|
|
90
|
+
height: 45,
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
justifyContent: "center",
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<Icons
|
|
96
|
+
size={theme.fontSizes["md"]}
|
|
97
|
+
color={theme.colors.blue[500]}
|
|
98
|
+
icon={"CLOSED"}
|
|
99
|
+
/>
|
|
100
|
+
</TouchableOpacity>
|
|
101
|
+
</View>
|
|
102
|
+
<FlatList
|
|
103
|
+
data={dataOption || []}
|
|
104
|
+
keyExtractor={(item) => item.value}
|
|
105
|
+
renderItem={({ item }) => (
|
|
106
|
+
<TouchableOpacity
|
|
107
|
+
style={styles(styleProps).option}
|
|
108
|
+
onPress={() => handleSelect(item.value)}
|
|
109
|
+
>
|
|
110
|
+
<Text style={styles(styleProps).optionText}>{item.label}</Text>
|
|
111
|
+
</TouchableOpacity>
|
|
112
|
+
)}
|
|
113
|
+
/>
|
|
114
|
+
</View>
|
|
115
|
+
</View>
|
|
116
|
+
</Modal>
|
|
117
|
+
</View>
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Componente SelectOption para a interação da ui.
|
|
123
|
+
*/
|
|
124
|
+
export default asBaseComponent(SelectOption);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* IMPORTS
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
|
-
import { View, Text } from "react-native";
|
|
5
|
+
import { View, Text, TouchableOpacity } from "react-native";
|
|
6
6
|
|
|
7
7
|
// commons / svg
|
|
8
8
|
import { Icons } from "../../common/icons-svg";
|
|
@@ -30,49 +30,69 @@ const StepIndicator: React.FC<IStepIndicator> = ({
|
|
|
30
30
|
textColorDescription,
|
|
31
31
|
titleColor,
|
|
32
32
|
titleNumberColor,
|
|
33
|
+
handleOnPressActivitie,
|
|
33
34
|
}) => {
|
|
34
35
|
const StepDefault = () => {
|
|
35
36
|
return (
|
|
36
37
|
<>
|
|
37
38
|
{data!.length > 0 &&
|
|
38
|
-
data!.map((history, index) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
data!.map((history, index) => {
|
|
40
|
+
// pegando primeira atividade pelo index
|
|
41
|
+
const isFirst = index === 0;
|
|
42
|
+
//pegando o tipo de atividade
|
|
43
|
+
const isEditableType = history.tipo === "descanso";
|
|
44
|
+
|
|
45
|
+
// pegando o valor para saber se atividade ta ou não sincronizada
|
|
46
|
+
const isSynced = history?.sincronizado === true;
|
|
47
|
+
|
|
48
|
+
const canEdit = isFirst && isEditableType && isSynced;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<TouchableOpacity
|
|
52
|
+
testID="step-indicator"
|
|
53
|
+
activeOpacity={0.7}
|
|
54
|
+
key={history.id}
|
|
55
|
+
style={styles({}).containerIndicator}
|
|
56
|
+
disabled={!canEdit}
|
|
57
|
+
onPress={() => handleOnPressActivitie(history as any)}
|
|
58
|
+
>
|
|
59
|
+
<View style={styles({ sincronizado: history.sincronizado }).containerBall}>
|
|
60
|
+
{data!?.length > 1 && index < data!?.length - 1 && (
|
|
61
|
+
<View
|
|
62
|
+
style={{
|
|
63
|
+
width: 2,
|
|
64
|
+
height: 84,
|
|
65
|
+
marginTop: 116,
|
|
66
|
+
position: "relative",
|
|
67
|
+
backgroundColor: history.sincronizado
|
|
68
|
+
? theme.colors.blue[500]
|
|
69
|
+
: theme.colors.orange[150],
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
<Text style={styles({ titleNumberColor }).titleNumber}>
|
|
74
|
+
{data!?.length - index}
|
|
75
|
+
</Text>
|
|
76
|
+
</View>
|
|
58
77
|
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
<View style={styles({}).containerMain}>
|
|
79
|
+
<Text style={styles({ titleColor }).title}>{history?.descricao}</Text>
|
|
61
80
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
{history?.data_inicio && (
|
|
82
|
+
<Text style={styles({ textColorDescription }).titleDescription}>
|
|
83
|
+
{`Inicio: ${history.data_inicio} ás ${history.data_fim}`}
|
|
84
|
+
</Text>
|
|
85
|
+
)}
|
|
67
86
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
{history.duracao_segundos && (
|
|
88
|
+
<Text style={styles({ textColorDescription }).titleDescription}>
|
|
89
|
+
Duração: {formHoursMinute(history?.duracao_segundos as string)}
|
|
90
|
+
</Text>
|
|
91
|
+
)}
|
|
92
|
+
</View>
|
|
93
|
+
</TouchableOpacity>
|
|
94
|
+
);
|
|
95
|
+
})}
|
|
76
96
|
</>
|
|
77
97
|
);
|
|
78
98
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
1
2
|
/**
|
|
2
3
|
* IMPORTS
|
|
3
4
|
*/
|
|
@@ -9,7 +10,17 @@ type IData = {
|
|
|
9
10
|
data_fim: string;
|
|
10
11
|
descricao: string;
|
|
11
12
|
sincronizado;
|
|
13
|
+
tipo: string;
|
|
14
|
+
referencia: string;
|
|
12
15
|
};
|
|
16
|
+
|
|
17
|
+
type IStyleProps = {
|
|
18
|
+
sincronizado?: boolean;
|
|
19
|
+
titleColor?: string;
|
|
20
|
+
titleNumberColor?: string;
|
|
21
|
+
textColorDescription?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
13
24
|
interface IStepIndicator {
|
|
14
25
|
/**dados que vão ser renderizados */
|
|
15
26
|
data?: IData[];
|
|
@@ -26,10 +37,10 @@ interface IStepIndicator {
|
|
|
26
37
|
/**cor do texto da descrição */
|
|
27
38
|
textColorDescription?: string;
|
|
28
39
|
|
|
29
|
-
/**
|
|
30
|
-
|
|
40
|
+
/**params para lidar com selecionamento de atividade única */
|
|
41
|
+
handleOnPressActivitie: (data: IData) => void;
|
|
31
42
|
}
|
|
32
43
|
/**
|
|
33
44
|
* EXPORTS
|
|
34
45
|
*/
|
|
35
|
-
export { type IStepIndicator };
|
|
46
|
+
export { type IStepIndicator, IStyleProps };
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import { StyleSheet } from "react-native";
|
|
6
6
|
|
|
7
7
|
// typings
|
|
8
|
-
import { type
|
|
8
|
+
import { type IStyleProps } from "./interface";
|
|
9
9
|
|
|
10
10
|
// styles
|
|
11
11
|
import { theme } from "../../styles/theme/theme";
|
|
12
12
|
|
|
13
|
-
const styles = (props:
|
|
13
|
+
const styles = (props: IStyleProps) =>
|
|
14
14
|
StyleSheet.create({
|
|
15
15
|
containerIndicator: {
|
|
16
16
|
width: "100%",
|