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.
Files changed (122) hide show
  1. package/lib/commonjs/components/capture-photo/index.js +4 -4
  2. package/lib/commonjs/components/card-report/index.js +139 -127
  3. package/lib/commonjs/components/card-report/index.js.map +1 -1
  4. package/lib/commonjs/components/card-with-draw-coil/index.js +5 -5
  5. package/lib/commonjs/components/card-with-draw-coil/index.js.map +1 -1
  6. package/lib/commonjs/components/coil-removel-code/index.js +5 -5
  7. package/lib/commonjs/components/coil-removel-code/index.js.map +1 -1
  8. package/lib/commonjs/components/history-activities-card/index.js +15 -18
  9. package/lib/commonjs/components/history-activities-card/index.js.map +1 -1
  10. package/lib/commonjs/components/resume-raking/index.js +79 -0
  11. package/lib/commonjs/components/resume-raking/index.js.map +1 -0
  12. package/lib/commonjs/components/resume-raking/interface.js +2 -0
  13. package/lib/commonjs/components/resume-raking/interface.js.map +1 -0
  14. package/lib/commonjs/components/resume-raking/styles.js +2 -0
  15. package/lib/commonjs/components/resume-raking/styles.js.map +1 -0
  16. package/lib/commonjs/components/travel-history/index.js +248 -237
  17. package/lib/commonjs/components/travel-history/index.js.map +1 -1
  18. package/lib/commonjs/components/user-profile/index.js +1 -1
  19. package/lib/commonjs/components/user-profile/index.js.map +1 -1
  20. package/lib/commonjs/components/weekly-table/helpers/calcular-total-horas.js +48 -10
  21. package/lib/commonjs/components/weekly-table/helpers/calcular-total-horas.js.map +1 -1
  22. package/lib/commonjs/components/weekly-table/index.js +9 -10
  23. package/lib/commonjs/components/weekly-table/index.js.map +1 -1
  24. package/lib/commonjs/index.js +11 -4
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/styles/theme/theme.js +1 -0
  27. package/lib/commonjs/styles/theme/theme.js.map +1 -1
  28. package/lib/module/components/capture-photo/index.js +4 -4
  29. package/lib/module/components/card-report/index.js +139 -127
  30. package/lib/module/components/card-report/index.js.map +1 -1
  31. package/lib/module/components/card-with-draw-coil/index.js +5 -5
  32. package/lib/module/components/card-with-draw-coil/index.js.map +1 -1
  33. package/lib/module/components/coil-removel-code/index.js +5 -5
  34. package/lib/module/components/coil-removel-code/index.js.map +1 -1
  35. package/lib/module/components/history-activities-card/index.js +13 -16
  36. package/lib/module/components/history-activities-card/index.js.map +1 -1
  37. package/lib/module/components/resume-raking/index.js +72 -0
  38. package/lib/module/components/resume-raking/index.js.map +1 -0
  39. package/lib/module/components/resume-raking/interface.js +2 -0
  40. package/lib/module/components/resume-raking/interface.js.map +1 -0
  41. package/lib/module/components/resume-raking/styles.js +2 -0
  42. package/lib/module/components/resume-raking/styles.js.map +1 -0
  43. package/lib/module/components/travel-history/index.js +248 -237
  44. package/lib/module/components/travel-history/index.js.map +1 -1
  45. package/lib/module/components/user-profile/index.js +1 -1
  46. package/lib/module/components/user-profile/index.js.map +1 -1
  47. package/lib/module/components/weekly-table/helpers/calcular-total-horas.js +46 -9
  48. package/lib/module/components/weekly-table/helpers/calcular-total-horas.js.map +1 -1
  49. package/lib/module/components/weekly-table/index.js +10 -11
  50. package/lib/module/components/weekly-table/index.js.map +1 -1
  51. package/lib/module/index.js +1 -0
  52. package/lib/module/index.js.map +1 -1
  53. package/lib/module/styles/theme/theme.js +1 -0
  54. package/lib/module/styles/theme/theme.js.map +1 -1
  55. package/lib/typescript/commonjs/src/components/capture-photo/index.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/components/card-report/index.d.ts +1 -0
  57. package/lib/typescript/commonjs/src/components/card-report/index.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/components/card-with-draw-coil/index.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/components/history-activities-card/index.d.ts +1 -0
  60. package/lib/typescript/commonjs/src/components/history-activities-card/index.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/src/components/history-activities-card/interface.d.ts +2 -0
  62. package/lib/typescript/commonjs/src/components/history-activities-card/interface.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/components/resume-raking/index.d.ts +8 -0
  64. package/lib/typescript/commonjs/src/components/resume-raking/index.d.ts.map +1 -0
  65. package/lib/typescript/commonjs/src/components/resume-raking/interface.d.ts +13 -0
  66. package/lib/typescript/commonjs/src/components/resume-raking/interface.d.ts.map +1 -0
  67. package/lib/typescript/commonjs/src/components/resume-raking/styles.d.ts +1 -0
  68. package/lib/typescript/commonjs/src/components/resume-raking/styles.d.ts.map +1 -0
  69. package/lib/typescript/commonjs/src/components/travel-history/index.d.ts +1 -0
  70. package/lib/typescript/commonjs/src/components/travel-history/index.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/components/weekly-table/helpers/calcular-total-horas.d.ts +2 -1
  72. package/lib/typescript/commonjs/src/components/weekly-table/helpers/calcular-total-horas.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/components/weekly-table/index.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  75. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/src/styles/global/theme-provider.d.ts +1 -0
  77. package/lib/typescript/commonjs/src/styles/global/theme-provider.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/src/styles/theme/theme.d.ts +1 -0
  79. package/lib/typescript/commonjs/src/styles/theme/theme.d.ts.map +1 -1
  80. package/lib/typescript/module/src/components/capture-photo/index.d.ts.map +1 -1
  81. package/lib/typescript/module/src/components/card-report/index.d.ts +1 -0
  82. package/lib/typescript/module/src/components/card-report/index.d.ts.map +1 -1
  83. package/lib/typescript/module/src/components/card-with-draw-coil/index.d.ts.map +1 -1
  84. package/lib/typescript/module/src/components/history-activities-card/index.d.ts +1 -0
  85. package/lib/typescript/module/src/components/history-activities-card/index.d.ts.map +1 -1
  86. package/lib/typescript/module/src/components/history-activities-card/interface.d.ts +2 -0
  87. package/lib/typescript/module/src/components/history-activities-card/interface.d.ts.map +1 -1
  88. package/lib/typescript/module/src/components/resume-raking/index.d.ts +8 -0
  89. package/lib/typescript/module/src/components/resume-raking/index.d.ts.map +1 -0
  90. package/lib/typescript/module/src/components/resume-raking/interface.d.ts +13 -0
  91. package/lib/typescript/module/src/components/resume-raking/interface.d.ts.map +1 -0
  92. package/lib/typescript/module/src/components/resume-raking/styles.d.ts +1 -0
  93. package/lib/typescript/module/src/components/resume-raking/styles.d.ts.map +1 -0
  94. package/lib/typescript/module/src/components/travel-history/index.d.ts +1 -0
  95. package/lib/typescript/module/src/components/travel-history/index.d.ts.map +1 -1
  96. package/lib/typescript/module/src/components/weekly-table/helpers/calcular-total-horas.d.ts +2 -1
  97. package/lib/typescript/module/src/components/weekly-table/helpers/calcular-total-horas.d.ts.map +1 -1
  98. package/lib/typescript/module/src/components/weekly-table/index.d.ts.map +1 -1
  99. package/lib/typescript/module/src/index.d.ts +1 -0
  100. package/lib/typescript/module/src/index.d.ts.map +1 -1
  101. package/lib/typescript/module/src/styles/global/theme-provider.d.ts +1 -0
  102. package/lib/typescript/module/src/styles/global/theme-provider.d.ts.map +1 -1
  103. package/lib/typescript/module/src/styles/theme/theme.d.ts +1 -0
  104. package/lib/typescript/module/src/styles/theme/theme.d.ts.map +1 -1
  105. package/package.json +1 -1
  106. package/src/components/capture-photo/index.tsx +133 -133
  107. package/src/components/card-report/index.tsx +175 -168
  108. package/src/components/card-report/interface.d.ts +140 -136
  109. package/src/components/card-with-draw-coil/index.tsx +165 -165
  110. package/src/components/coil-removel-code/index.tsx +50 -50
  111. package/src/components/history-activities-card/index.tsx +211 -209
  112. package/src/components/history-activities-card/interface.ts +147 -145
  113. package/src/components/resume-raking/index.tsx +75 -0
  114. package/src/components/resume-raking/interface.ts +14 -0
  115. package/src/components/resume-raking/styles.ts +0 -0
  116. package/src/components/travel-history/index.tsx +330 -314
  117. package/src/components/travel-history/interface.d.ts +153 -149
  118. package/src/components/user-profile/index.tsx +1 -1
  119. package/src/components/weekly-table/helpers/calcular-total-horas.ts +89 -50
  120. package/src/components/weekly-table/index.tsx +138 -142
  121. package/src/index.tsx +1 -0
  122. 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 { handlecalcularTotalHoras } from "./helpers/calcular-total-horas";
13
- import { handleCalcularJornada } from "./helpers/calcular-jornada";
14
-
15
- // typings
16
- import type { WeekCalendarProps } from "./interface";
17
-
18
- // styles
19
- import { theme } from "../../styles/theme/theme";
20
- import { asBaseComponent } from "../../@types/as-base-component";
21
-
22
- const WeeklyTable = forwardRef<any, WeekCalendarProps>((props, ref): React.ReactElement => {
23
- const { semana } = props;
24
-
25
- const totalHoras = handlecalcularTotalHoras(semana);
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
- paddingStyle={{ padding: 0 }}
87
- backgroundColor={index % 2 === 0 ? theme.colors.neutral[50] : theme.colors.neutral[300]}
88
- >
89
- <RowTable texto={dia.dia ?? "-"} customWidth={colWidths.dia} />
90
- <RowTable texto={dia.entrada ?? "-"} customWidth={colWidths.data} />
91
- <RowTable
92
- texto={handleCalcularJornada(dia.entrada, dia.saida)}
93
- customWidth={colWidths.jorna}
94
- />
95
- <RowTable texto={(dia.kms ?? 0).toString()} customWidth={colWidths.kms} />
96
- <RowTable texto={(dia.picos ?? 0).toString()} customWidth={colWidths.picos} />
97
- <RowTable texto={(dia.falhas ?? 0).toString()} customWidth={colWidths.falhas} />
98
- </Box>
99
- ))}
100
-
101
- {/* Linha de totais */}
102
- <Box
103
- flexStyle={{ flexDirection: "row" }}
104
- backgroundColor={theme.colors.neutral[300]}
105
- borderStyled={{
106
- borderBottomLeftRadius: theme.borderWidths.thin_bold,
107
- borderBottomRightRadius: theme.borderWidths.thin_bold,
108
- borderColor: theme.colors.blue[400],
109
- }}
110
- >
111
- <RowTable texto="TOTAL" bold customWidth={screenWidth * 0.28} />
112
- <RowTable
113
- texto={totalHoras}
114
- customWidth={screenWidth * 0.14}
115
- color={theme.colors.green[250]}
116
- bold
117
- />
118
- <RowTable
119
- texto={totalKms.toLocaleString("pt-BR")}
120
- customWidth={screenWidth * 0.14}
121
- color={theme.colors.green[250]}
122
- bold
123
- />
124
- <RowTable
125
- texto={totalPicos.toString()}
126
- customWidth={screenWidth * 0.14}
127
- color={theme.colors.green[250]}
128
- bold
129
- />
130
- <RowTable
131
- texto={totalFalhas.toString()}
132
- customWidth={screenWidth * 0.18}
133
- color={theme.colors.green[250]}
134
- bold
135
- />
136
- </Box>
137
- </Box>
138
- </ScrollView>
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";
@@ -50,6 +50,7 @@ const colors = {
50
50
  950: "#94a3b8",
51
51
  },
52
52
  green: {
53
+ 100: "#D4EDDA",
53
54
  200: "#25BA76",
54
55
  250: "#20AD48",
55
56
  400: "#49C63E",