jornada-ui 0.4.4 → 0.4.6
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/capture-photo/index.js +4 -4
- package/lib/commonjs/components/card-report/index.js +139 -127
- package/lib/commonjs/components/card-report/index.js.map +1 -1
- package/lib/commonjs/components/card-with-draw-coil/index.js +5 -5
- package/lib/commonjs/components/card-with-draw-coil/index.js.map +1 -1
- package/lib/commonjs/components/coil-removel-code/index.js +5 -5
- package/lib/commonjs/components/coil-removel-code/index.js.map +1 -1
- package/lib/commonjs/components/history-activities-card/index.js +15 -18
- package/lib/commonjs/components/history-activities-card/index.js.map +1 -1
- package/lib/commonjs/components/resume-raking/index.js +79 -0
- package/lib/commonjs/components/resume-raking/index.js.map +1 -0
- package/lib/commonjs/components/resume-raking/interface.js +2 -0
- package/lib/commonjs/components/resume-raking/interface.js.map +1 -0
- package/lib/commonjs/components/resume-raking/styles.js +2 -0
- package/lib/commonjs/components/resume-raking/styles.js.map +1 -0
- package/lib/commonjs/components/travel-history/index.js +248 -237
- package/lib/commonjs/components/travel-history/index.js.map +1 -1
- package/lib/commonjs/components/user-profile/index.js +1 -1
- package/lib/commonjs/components/user-profile/index.js.map +1 -1
- package/lib/commonjs/components/weekly-table/helpers/calcular-total-horas.js +48 -10
- package/lib/commonjs/components/weekly-table/helpers/calcular-total-horas.js.map +1 -1
- package/lib/commonjs/components/weekly-table/index.js +9 -10
- package/lib/commonjs/components/weekly-table/index.js.map +1 -1
- package/lib/commonjs/index.js +11 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/theme/theme.js +1 -0
- package/lib/commonjs/styles/theme/theme.js.map +1 -1
- package/lib/module/components/capture-photo/index.js +4 -4
- package/lib/module/components/card-report/index.js +139 -127
- package/lib/module/components/card-report/index.js.map +1 -1
- package/lib/module/components/card-with-draw-coil/index.js +5 -5
- package/lib/module/components/card-with-draw-coil/index.js.map +1 -1
- package/lib/module/components/coil-removel-code/index.js +5 -5
- package/lib/module/components/coil-removel-code/index.js.map +1 -1
- package/lib/module/components/history-activities-card/index.js +13 -16
- package/lib/module/components/history-activities-card/index.js.map +1 -1
- package/lib/module/components/resume-raking/index.js +72 -0
- package/lib/module/components/resume-raking/index.js.map +1 -0
- package/lib/module/components/resume-raking/interface.js +2 -0
- package/lib/module/components/resume-raking/interface.js.map +1 -0
- package/lib/module/components/resume-raking/styles.js +2 -0
- package/lib/module/components/resume-raking/styles.js.map +1 -0
- package/lib/module/components/travel-history/index.js +248 -237
- package/lib/module/components/travel-history/index.js.map +1 -1
- package/lib/module/components/user-profile/index.js +1 -1
- package/lib/module/components/user-profile/index.js.map +1 -1
- package/lib/module/components/weekly-table/helpers/calcular-total-horas.js +46 -9
- package/lib/module/components/weekly-table/helpers/calcular-total-horas.js.map +1 -1
- package/lib/module/components/weekly-table/index.js +10 -11
- package/lib/module/components/weekly-table/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/theme/theme.js +1 -0
- package/lib/module/styles/theme/theme.js.map +1 -1
- package/lib/typescript/commonjs/src/components/capture-photo/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/card-report/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/card-report/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/card-with-draw-coil/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/history-activities-card/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/history-activities-card/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/history-activities-card/interface.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/history-activities-card/interface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/resume-raking/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/components/resume-raking/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/resume-raking/interface.d.ts +13 -0
- package/lib/typescript/commonjs/src/components/resume-raking/interface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/resume-raking/styles.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/resume-raking/styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/travel-history/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/travel-history/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/weekly-table/helpers/calcular-total-horas.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/weekly-table/helpers/calcular-total-horas.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/weekly-table/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/styles/global/theme-provider.d.ts +1 -0
- package/lib/typescript/commonjs/src/styles/global/theme-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/styles/theme/theme.d.ts +1 -0
- package/lib/typescript/commonjs/src/styles/theme/theme.d.ts.map +1 -1
- package/lib/typescript/module/src/components/capture-photo/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/card-report/index.d.ts +1 -0
- package/lib/typescript/module/src/components/card-report/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/card-with-draw-coil/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/history-activities-card/index.d.ts +1 -0
- package/lib/typescript/module/src/components/history-activities-card/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/history-activities-card/interface.d.ts +2 -0
- package/lib/typescript/module/src/components/history-activities-card/interface.d.ts.map +1 -1
- package/lib/typescript/module/src/components/resume-raking/index.d.ts +8 -0
- package/lib/typescript/module/src/components/resume-raking/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/resume-raking/interface.d.ts +13 -0
- package/lib/typescript/module/src/components/resume-raking/interface.d.ts.map +1 -0
- package/lib/typescript/module/src/components/resume-raking/styles.d.ts +1 -0
- package/lib/typescript/module/src/components/resume-raking/styles.d.ts.map +1 -0
- package/lib/typescript/module/src/components/travel-history/index.d.ts +1 -0
- package/lib/typescript/module/src/components/travel-history/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/weekly-table/helpers/calcular-total-horas.d.ts +2 -1
- package/lib/typescript/module/src/components/weekly-table/helpers/calcular-total-horas.d.ts.map +1 -1
- package/lib/typescript/module/src/components/weekly-table/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/styles/global/theme-provider.d.ts +1 -0
- package/lib/typescript/module/src/styles/global/theme-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/styles/theme/theme.d.ts +1 -0
- package/lib/typescript/module/src/styles/theme/theme.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/capture-photo/index.tsx +133 -133
- package/src/components/card-report/index.tsx +175 -168
- package/src/components/card-report/interface.d.ts +140 -136
- package/src/components/card-with-draw-coil/index.tsx +165 -165
- package/src/components/coil-removel-code/index.tsx +50 -50
- package/src/components/history-activities-card/index.tsx +211 -209
- package/src/components/history-activities-card/interface.ts +147 -145
- package/src/components/resume-raking/index.tsx +75 -0
- package/src/components/resume-raking/interface.ts +14 -0
- package/src/components/resume-raking/styles.ts +0 -0
- package/src/components/travel-history/index.tsx +330 -314
- package/src/components/travel-history/interface.d.ts +153 -149
- package/src/components/user-profile/index.tsx +1 -1
- package/src/components/weekly-table/helpers/calcular-total-horas.ts +89 -50
- package/src/components/weekly-table/index.tsx +138 -142
- package/src/index.tsx +1 -0
- package/src/styles/theme/theme.ts +1 -0
|
@@ -1,142 +1,138 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React, { forwardRef } from "react";
|
|
5
|
-
import { Dimensions, ScrollView } from "react-native";
|
|
6
|
-
|
|
7
|
-
// components
|
|
8
|
-
import Box from "../box";
|
|
9
|
-
import { RowTable } from "./components/row-table";
|
|
10
|
-
|
|
11
|
-
// helpers
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const totalKms = semana.reduce((acc, d) => acc + (d.kms ?? 0), 0);
|
|
27
|
-
const totalPicos = semana.reduce((acc, d) => acc + (d.picos ?? 0), 0);
|
|
28
|
-
const totalFalhas = semana.reduce((acc, d) => acc + (d.falhas ?? 0), 0);
|
|
29
|
-
|
|
30
|
-
const { width: screenWidth } = Dimensions.get("window");
|
|
31
|
-
const colWidths = {
|
|
32
|
-
dia: screenWidth * 0.14,
|
|
33
|
-
data: screenWidth * 0.14,
|
|
34
|
-
jorna: screenWidth * 0.14,
|
|
35
|
-
kms: screenWidth * 0.14,
|
|
36
|
-
picos: screenWidth * 0.14,
|
|
37
|
-
falhas: screenWidth * 0.18,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<ScrollView horizontal ref={ref}>
|
|
42
|
-
<Box width={"100%"}>
|
|
43
|
-
{/* Cabeçalho */}
|
|
44
|
-
<Box
|
|
45
|
-
flexStyle={{ flexDirection: "row" }}
|
|
46
|
-
backgroundColor={theme.colors.blue[400]}
|
|
47
|
-
borderStyled={{
|
|
48
|
-
borderTopLeftRadius: theme.borderWidths.thin_bold,
|
|
49
|
-
borderTopRightRadius: theme.borderWidths.thin_bold,
|
|
50
|
-
borderColor: theme.colors.blue[400],
|
|
51
|
-
}}
|
|
52
|
-
>
|
|
53
|
-
<RowTable texto="DIA" bold color={theme.colors.neutral[25]} customWidth={colWidths.dia} />
|
|
54
|
-
<RowTable
|
|
55
|
-
texto="DATA"
|
|
56
|
-
bold
|
|
57
|
-
color={theme.colors.neutral[25]}
|
|
58
|
-
customWidth={colWidths.data}
|
|
59
|
-
/>
|
|
60
|
-
<RowTable
|
|
61
|
-
texto="JORNA"
|
|
62
|
-
bold
|
|
63
|
-
color={theme.colors.neutral[25]}
|
|
64
|
-
customWidth={colWidths.jorna}
|
|
65
|
-
/>
|
|
66
|
-
<RowTable texto="KMs" bold color={theme.colors.neutral[25]} customWidth={colWidths.kms} />
|
|
67
|
-
<RowTable
|
|
68
|
-
texto="PICOS"
|
|
69
|
-
bold
|
|
70
|
-
color={theme.colors.neutral[25]}
|
|
71
|
-
customWidth={colWidths.picos}
|
|
72
|
-
/>
|
|
73
|
-
<RowTable
|
|
74
|
-
texto="FALHAS"
|
|
75
|
-
bold
|
|
76
|
-
color={theme.colors.neutral[25]}
|
|
77
|
-
customWidth={colWidths.falhas}
|
|
78
|
-
/>
|
|
79
|
-
</Box>
|
|
80
|
-
|
|
81
|
-
{/* Linhas com os dados */}
|
|
82
|
-
{semana.map((dia, index) => (
|
|
83
|
-
<Box
|
|
84
|
-
key={index}
|
|
85
|
-
flexStyle={{ flexDirection: "row", justifyContent: "center" }}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<RowTable texto={dia.
|
|
90
|
-
<RowTable texto={dia.
|
|
91
|
-
<RowTable
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
export default asBaseComponent(React.memo(WeeklyTable));
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef } from "react";
|
|
5
|
+
import { Dimensions, ScrollView } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import Box from "../box";
|
|
9
|
+
import { RowTable } from "./components/row-table";
|
|
10
|
+
|
|
11
|
+
// helpers
|
|
12
|
+
import { handleCalcularTotalHoras } from "./helpers/calcular-total-horas";
|
|
13
|
+
|
|
14
|
+
// typings
|
|
15
|
+
import type { WeekCalendarProps } from "./interface";
|
|
16
|
+
|
|
17
|
+
// styles
|
|
18
|
+
import { theme } from "../../styles/theme/theme";
|
|
19
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
20
|
+
|
|
21
|
+
const WeeklyTable = forwardRef<any, WeekCalendarProps>((props, ref): React.ReactElement => {
|
|
22
|
+
const { semana } = props;
|
|
23
|
+
|
|
24
|
+
const totalHoras = handleCalcularTotalHoras(semana);
|
|
25
|
+
|
|
26
|
+
const totalKms = semana.reduce((acc, d) => acc + (d.kms ?? 0), 0);
|
|
27
|
+
const totalPicos = semana.reduce((acc, d) => acc + (d.picos ?? 0), 0);
|
|
28
|
+
const totalFalhas = semana.reduce((acc, d) => acc + (d.falhas ?? 0), 0);
|
|
29
|
+
|
|
30
|
+
const { width: screenWidth } = Dimensions.get("window");
|
|
31
|
+
const colWidths = {
|
|
32
|
+
dia: screenWidth * 0.14,
|
|
33
|
+
data: screenWidth * 0.14,
|
|
34
|
+
jorna: screenWidth * 0.14,
|
|
35
|
+
kms: screenWidth * 0.14,
|
|
36
|
+
picos: screenWidth * 0.14,
|
|
37
|
+
falhas: screenWidth * 0.18,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ScrollView horizontal ref={ref} contentContainerStyle={{ width: "100%" }}>
|
|
42
|
+
<Box width={"100%"}>
|
|
43
|
+
{/* Cabeçalho */}
|
|
44
|
+
<Box
|
|
45
|
+
flexStyle={{ flexDirection: "row" }}
|
|
46
|
+
backgroundColor={theme.colors.blue[400]}
|
|
47
|
+
borderStyled={{
|
|
48
|
+
borderTopLeftRadius: theme.borderWidths.thin_bold,
|
|
49
|
+
borderTopRightRadius: theme.borderWidths.thin_bold,
|
|
50
|
+
borderColor: theme.colors.blue[400],
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<RowTable texto="DIA" bold color={theme.colors.neutral[25]} customWidth={colWidths.dia} />
|
|
54
|
+
<RowTable
|
|
55
|
+
texto="DATA"
|
|
56
|
+
bold
|
|
57
|
+
color={theme.colors.neutral[25]}
|
|
58
|
+
customWidth={colWidths.data}
|
|
59
|
+
/>
|
|
60
|
+
<RowTable
|
|
61
|
+
texto="JORNA"
|
|
62
|
+
bold
|
|
63
|
+
color={theme.colors.neutral[25]}
|
|
64
|
+
customWidth={colWidths.jorna}
|
|
65
|
+
/>
|
|
66
|
+
<RowTable texto="KMs" bold color={theme.colors.neutral[25]} customWidth={colWidths.kms} />
|
|
67
|
+
<RowTable
|
|
68
|
+
texto="PICOS"
|
|
69
|
+
bold
|
|
70
|
+
color={theme.colors.neutral[25]}
|
|
71
|
+
customWidth={colWidths.picos}
|
|
72
|
+
/>
|
|
73
|
+
<RowTable
|
|
74
|
+
texto="FALHAS"
|
|
75
|
+
bold
|
|
76
|
+
color={theme.colors.neutral[25]}
|
|
77
|
+
customWidth={colWidths.falhas}
|
|
78
|
+
/>
|
|
79
|
+
</Box>
|
|
80
|
+
|
|
81
|
+
{/* Linhas com os dados */}
|
|
82
|
+
{semana.map((dia, index) => (
|
|
83
|
+
<Box
|
|
84
|
+
key={index}
|
|
85
|
+
flexStyle={{ flexDirection: "row", justifyContent: "center" }}
|
|
86
|
+
backgroundColor={index % 2 === 0 ? theme.colors.neutral[50] : theme.colors.neutral[300]}
|
|
87
|
+
>
|
|
88
|
+
<RowTable texto={dia.dia ?? "-"} customWidth={colWidths.dia} />
|
|
89
|
+
<RowTable texto={dia.entrada ?? "-"} customWidth={colWidths.data} />
|
|
90
|
+
<RowTable texto={dia.saida ?? "-"} customWidth={colWidths.jorna} />
|
|
91
|
+
<RowTable texto={(dia.kms ?? 0).toString()} customWidth={colWidths.kms} />
|
|
92
|
+
<RowTable texto={(dia.picos ?? 0).toString()} customWidth={colWidths.picos} />
|
|
93
|
+
<RowTable texto={(dia.falhas ?? 0).toString()} customWidth={colWidths.falhas} />
|
|
94
|
+
</Box>
|
|
95
|
+
))}
|
|
96
|
+
|
|
97
|
+
{/* Linha de totais */}
|
|
98
|
+
<Box
|
|
99
|
+
flexStyle={{ flexDirection: "row" }}
|
|
100
|
+
backgroundColor={theme.colors.green[100]}
|
|
101
|
+
borderStyled={{
|
|
102
|
+
borderBottomLeftRadius: theme.borderWidths.thin_bold,
|
|
103
|
+
borderBottomRightRadius: theme.borderWidths.thin_bold,
|
|
104
|
+
borderColor: theme.colors.blue[400],
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<RowTable texto="TOTAL" bold customWidth={screenWidth * 0.28} />
|
|
108
|
+
<RowTable
|
|
109
|
+
texto={totalHoras}
|
|
110
|
+
customWidth={screenWidth * 0.14}
|
|
111
|
+
color={theme.colors.green[200]}
|
|
112
|
+
bold
|
|
113
|
+
/>
|
|
114
|
+
<RowTable
|
|
115
|
+
texto={totalKms.toLocaleString("pt-BR")}
|
|
116
|
+
customWidth={screenWidth * 0.14}
|
|
117
|
+
color={theme.colors.green[250]}
|
|
118
|
+
bold
|
|
119
|
+
/>
|
|
120
|
+
<RowTable
|
|
121
|
+
texto={totalPicos.toString()}
|
|
122
|
+
customWidth={screenWidth * 0.14}
|
|
123
|
+
color={theme.colors.green[250]}
|
|
124
|
+
bold
|
|
125
|
+
/>
|
|
126
|
+
<RowTable
|
|
127
|
+
texto={totalFalhas.toString()}
|
|
128
|
+
customWidth={screenWidth * 0.18}
|
|
129
|
+
color={theme.colors.green[250]}
|
|
130
|
+
bold
|
|
131
|
+
/>
|
|
132
|
+
</Box>
|
|
133
|
+
</Box>
|
|
134
|
+
</ScrollView>
|
|
135
|
+
);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export default asBaseComponent(React.memo(WeeklyTable));
|
package/src/index.tsx
CHANGED
|
@@ -39,6 +39,7 @@ export { default as TravelHistory } from "./components/travel-history";
|
|
|
39
39
|
export { default as BottomMessageConexion } from "./components/bottom-message-conexion";
|
|
40
40
|
export { default as ToastMessage } from "./components/toast-message";
|
|
41
41
|
export { default as ModalTypeActivities } from "./components/modal-type-activities";
|
|
42
|
+
export { default as ResumeRaking } from "./components/resume-raking";
|
|
42
43
|
|
|
43
44
|
// adicionar o storybook + teste
|
|
44
45
|
export { default as WeeklyHoursBalance } from "./components/weekly-hours-balance";
|