jornada-ui 0.4.8 → 0.4.9
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/card-maintenance/index.js +23 -16
- package/lib/commonjs/components/card-maintenance/index.js.map +1 -1
- package/lib/commonjs/components/card-maintenance/interface.d.js +4 -0
- package/lib/commonjs/components/modal-maintenance/index.js +28 -6
- package/lib/commonjs/components/modal-maintenance/index.js.map +1 -1
- package/lib/commonjs/utils/get-status-color/index.js +35 -0
- package/lib/commonjs/utils/get-status-color/index.js.map +1 -0
- package/lib/module/components/card-maintenance/index.js +24 -17
- package/lib/module/components/card-maintenance/index.js.map +1 -1
- package/lib/module/components/card-maintenance/interface.d.js +2 -0
- package/lib/module/components/modal-maintenance/index.js +28 -6
- package/lib/module/components/modal-maintenance/index.js.map +1 -1
- package/lib/module/utils/get-status-color/index.js +32 -0
- package/lib/module/utils/get-status-color/index.js.map +1 -0
- package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/modal-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/get-status-color/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/utils/get-status-color/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/card-maintenance/index.d.ts +1 -1
- package/lib/typescript/module/src/components/card-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/modal-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/get-status-color/index.d.ts +14 -0
- package/lib/typescript/module/src/utils/get-status-color/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/card-maintenance/index.tsx +145 -146
- package/src/components/card-maintenance/interface.d.ts +33 -8
- package/src/components/modal-maintenance/index.tsx +184 -160
- package/src/components/modal-maintenance/interface.d.ts +17 -16
- package/src/utils/get-status-color/index.ts +31 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/card-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/card-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAcpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;;AA+HpD,wBAAgD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAM1D,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAiKtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Function that will map property types to corresponding icons in SVG 🛠️.
|
|
6
|
+
* @param propertyType
|
|
7
|
+
* @returns SVG
|
|
8
|
+
*/
|
|
9
|
+
declare const getStatusColorHex: (propertyType: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* EXPORTS
|
|
12
|
+
*/
|
|
13
|
+
export { getStatusColorHex };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/get-status-color/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,iBAAkB,MAAM,WAc9C,CAAC;AAEF;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,146 +1,145 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React, { useState } from "react";
|
|
5
|
-
|
|
6
|
-
import { Image, View, TouchableOpacity } from "react-native";
|
|
7
|
-
|
|
8
|
-
import ModalMaintenance from "../modal-maintenance";
|
|
9
|
-
|
|
10
|
-
// components
|
|
11
|
-
import Box from "../../components/box";
|
|
12
|
-
import Typography from "../../components/typography";
|
|
13
|
-
|
|
14
|
-
// theme
|
|
15
|
-
import { theme } from "../../styles/theme/theme";
|
|
16
|
-
|
|
17
|
-
// typings
|
|
18
|
-
import type { ICardMaintenance } from "./interface";
|
|
19
|
-
import { asBaseComponent } from "../../@types/as-base-component";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
cavalo,
|
|
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
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
export default asBaseComponent(CardMaintenance);
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { Image, View, TouchableOpacity } from "react-native";
|
|
7
|
+
|
|
8
|
+
import ModalMaintenance from "../modal-maintenance";
|
|
9
|
+
|
|
10
|
+
// components
|
|
11
|
+
import Box from "../../components/box";
|
|
12
|
+
import Typography from "../../components/typography";
|
|
13
|
+
|
|
14
|
+
// theme
|
|
15
|
+
import { theme } from "../../styles/theme/theme";
|
|
16
|
+
|
|
17
|
+
// typings
|
|
18
|
+
import type { ICardMaintenance } from "./interface";
|
|
19
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
20
|
+
import { getStatusColorHex } from "../../utils/get-status-color";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* COMPONENT
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const CardMaintenance = forwardRef<any, ICardMaintenance>((props, ref): React.ReactElement => {
|
|
27
|
+
const { numero, dataRegistro, cavalo, imagemUrl, descricao, status, titutlo } = props;
|
|
28
|
+
const [showModal, setShowModal] = useState(false);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<TouchableOpacity ref={ref} onPress={() => setShowModal(true)} activeOpacity={0.9}>
|
|
33
|
+
<Box
|
|
34
|
+
width={"100%"}
|
|
35
|
+
flexStyle={{ flexDirection: "row" }}
|
|
36
|
+
backgroundColor={theme.colors.neutral[25]}
|
|
37
|
+
borderStyled={{
|
|
38
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
39
|
+
}}
|
|
40
|
+
marginStyle={{ marginBottom: theme.margins.xs }}
|
|
41
|
+
>
|
|
42
|
+
<View
|
|
43
|
+
style={{
|
|
44
|
+
width: 15,
|
|
45
|
+
backgroundColor: getStatusColorHex(status) ?? theme.colors.green[250],
|
|
46
|
+
borderTopLeftRadius: theme.borderWidths.thick_medium,
|
|
47
|
+
borderBottomLeftRadius: theme.borderWidths.thick_medium,
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings["2xs"] }}>
|
|
51
|
+
<Box
|
|
52
|
+
marginStyle={{ marginTop: 4 }}
|
|
53
|
+
flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
|
|
54
|
+
>
|
|
55
|
+
<Typography
|
|
56
|
+
text={`${titutlo ?? "LAVAGEM"} #`}
|
|
57
|
+
color={theme.colors.black[25]}
|
|
58
|
+
fontFamily={theme.fonts.inter_bold}
|
|
59
|
+
size={theme.fontSizes.md}
|
|
60
|
+
/>
|
|
61
|
+
<Typography
|
|
62
|
+
text={`${numero}`}
|
|
63
|
+
color={theme.colors.black[25]}
|
|
64
|
+
fontFamily={theme.fonts.inter_bold}
|
|
65
|
+
size={theme.fontSizes.md}
|
|
66
|
+
/>
|
|
67
|
+
</Box>
|
|
68
|
+
|
|
69
|
+
<Box
|
|
70
|
+
marginStyle={{ marginTop: 4 }}
|
|
71
|
+
flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
|
|
72
|
+
>
|
|
73
|
+
<Typography
|
|
74
|
+
text={`Data de registro: `}
|
|
75
|
+
color={theme.colors.black[25]}
|
|
76
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
77
|
+
size={theme.fontSizes.xs}
|
|
78
|
+
/>
|
|
79
|
+
<Typography
|
|
80
|
+
text={`${dataRegistro}`}
|
|
81
|
+
color={theme.colors.gray[700]}
|
|
82
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
83
|
+
size={theme.fontSizes.xs}
|
|
84
|
+
/>
|
|
85
|
+
</Box>
|
|
86
|
+
|
|
87
|
+
<Box
|
|
88
|
+
marginStyle={{ marginTop: 4, marginBottom: 8 }}
|
|
89
|
+
flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
|
|
90
|
+
>
|
|
91
|
+
<Typography
|
|
92
|
+
text={`Cavalo: `}
|
|
93
|
+
color={theme.colors.black[25]}
|
|
94
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
95
|
+
size={theme.fontSizes.xs}
|
|
96
|
+
/>
|
|
97
|
+
<Typography
|
|
98
|
+
text={`${cavalo}`}
|
|
99
|
+
color={theme.colors.gray[700]}
|
|
100
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
101
|
+
size={theme.fontSizes.xs}
|
|
102
|
+
/>
|
|
103
|
+
</Box>
|
|
104
|
+
|
|
105
|
+
<Box
|
|
106
|
+
borderStyled={{
|
|
107
|
+
borderWidth: 1,
|
|
108
|
+
borderColor: theme.colors.black[25],
|
|
109
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
110
|
+
}}
|
|
111
|
+
flexStyle={{
|
|
112
|
+
justifyContent: "center",
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<Image
|
|
117
|
+
source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
|
|
118
|
+
style={{
|
|
119
|
+
width: "100%",
|
|
120
|
+
height: 139,
|
|
121
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
122
|
+
}}
|
|
123
|
+
resizeMode="cover"
|
|
124
|
+
/>
|
|
125
|
+
</Box>
|
|
126
|
+
</Box>
|
|
127
|
+
</Box>
|
|
128
|
+
</TouchableOpacity>
|
|
129
|
+
|
|
130
|
+
<ModalMaintenance
|
|
131
|
+
visible={showModal}
|
|
132
|
+
onClose={() => setShowModal(false)}
|
|
133
|
+
imagemUrl={imagemUrl}
|
|
134
|
+
dataRegistro={dataRegistro}
|
|
135
|
+
descricao={descricao}
|
|
136
|
+
numero={7}
|
|
137
|
+
status={status}
|
|
138
|
+
/>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
CardMaintenance.displayName = "CardMaintenance";
|
|
144
|
+
|
|
145
|
+
export default asBaseComponent(CardMaintenance);
|
|
@@ -1,8 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
interface ICardMaintenance {
|
|
5
|
+
/**título do card */
|
|
6
|
+
titutlo?: string;
|
|
7
|
+
|
|
8
|
+
/**número da manutenção */
|
|
9
|
+
numero: number;
|
|
10
|
+
|
|
11
|
+
/**data de registro da manutenção */
|
|
12
|
+
dataRegistro: string;
|
|
13
|
+
|
|
14
|
+
/**identificação do cavalo que realizou a manutenção */
|
|
15
|
+
cavalo: string;
|
|
16
|
+
|
|
17
|
+
/**cor da barra lateral do card */
|
|
18
|
+
corBarra?: string;
|
|
19
|
+
|
|
20
|
+
/**image capturada para informar a manutenção */
|
|
21
|
+
imagemUrl?: string;
|
|
22
|
+
|
|
23
|
+
/**descrição da solicitação de manutençao */
|
|
24
|
+
descricao: string;
|
|
25
|
+
|
|
26
|
+
/**status da manutenção */
|
|
27
|
+
status: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* EXPORTS
|
|
32
|
+
*/
|
|
33
|
+
export { ICardMaintenance };
|