react-native-exp-fig 0.1.25 → 0.1.27
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/input-text-counter/index.js +66 -0
- package/lib/commonjs/components/input-text-counter/index.js.map +1 -0
- package/lib/commonjs/components/input-text-counter/interface.d.js.map +1 -0
- package/lib/commonjs/components/input-text-counter/styles.js +42 -0
- package/lib/commonjs/components/input-text-counter/styles.js.map +1 -0
- package/lib/commonjs/components/modal-create-activitie/index.js +202 -0
- package/lib/commonjs/components/modal-create-activitie/index.js.map +1 -0
- package/lib/commonjs/components/modal-create-activitie/interface.js +2 -0
- package/lib/commonjs/components/modal-create-activitie/interface.js.map +1 -0
- package/lib/commonjs/components/modal-create-activitie/styles.js +42 -0
- package/lib/commonjs/components/modal-create-activitie/styles.js.map +1 -0
- package/lib/commonjs/components/modal-journey-rectification/index.js +202 -0
- package/lib/commonjs/components/modal-journey-rectification/index.js.map +1 -0
- package/lib/commonjs/components/modal-journey-rectification/interface.d.js +2 -0
- package/lib/commonjs/components/modal-journey-rectification/interface.d.js.map +1 -0
- package/lib/commonjs/components/modal-journey-rectification/styles.js +42 -0
- package/lib/commonjs/components/modal-journey-rectification/styles.js.map +1 -0
- package/lib/commonjs/components/{modal-activities → modals/modal-activities}/data-activities/index.js +2 -2
- package/lib/commonjs/components/modals/modal-activities/data-activities/index.js.map +1 -0
- package/lib/commonjs/components/{modal-activities → modals/modal-activities}/index.js +8 -8
- package/lib/commonjs/components/modals/modal-activities/index.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activities/interface.d.js +6 -0
- package/lib/commonjs/components/modals/modal-activities/interface.d.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activity-reason/index.js +161 -0
- package/lib/commonjs/components/modals/modal-activity-reason/index.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activity-reason/interface.d.js +2 -0
- package/lib/commonjs/components/modals/modal-activity-reason/interface.d.js.map +1 -0
- package/lib/commonjs/components/{modal-change-activity → modals/modal-change-activity}/index.js +7 -7
- package/lib/commonjs/components/modals/modal-change-activity/index.js.map +1 -0
- package/lib/commonjs/components/selects/select-date-and-hours/index.js +95 -0
- package/lib/commonjs/components/selects/select-date-and-hours/index.js.map +1 -0
- package/lib/commonjs/components/selects/select-date-and-hours/interface.js +6 -0
- package/lib/commonjs/components/selects/select-date-and-hours/interface.js.map +1 -0
- package/lib/commonjs/components/selects/select-date-and-hours/styles.js +33 -0
- package/lib/commonjs/components/selects/select-date-and-hours/styles.js.map +1 -0
- package/lib/commonjs/components/selects/select-option/index.js +41 -39
- package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/index.js +10 -10
- package/lib/commonjs/components/step-indicator/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/interface.d.js.map +1 -1
- package/lib/commonjs/index.js +32 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stories/input-text-counter/input-text-counter.stories.js +259 -0
- package/lib/commonjs/stories/input-text-counter/input-text-counter.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-activities/modal-activities.stories.js +1 -1
- package/lib/commonjs/stories/modal-activities/modal-activities.stories.js.map +1 -1
- package/lib/commonjs/stories/modal-activity-reason/modal-activity-reason.stories.js +198 -0
- package/lib/commonjs/stories/modal-activity-reason/modal-activity-reason.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js +3 -3
- package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -1
- package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js +86 -0
- package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js +172 -0
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -0
- package/lib/commonjs/stories/select-option/select-option.stories.js +3 -2
- package/lib/commonjs/stories/select-option/select-option.stories.js.map +1 -1
- package/lib/commonjs/stories/step-indicator/step-indicator.stories.js +2 -1
- package/lib/commonjs/stories/step-indicator/step-indicator.stories.js.map +1 -1
- package/lib/commonjs/styles/theme/theme.js +18 -2
- package/lib/commonjs/styles/theme/theme.js.map +1 -1
- package/lib/commonjs/utils/options-activity/index.js +27 -0
- package/lib/commonjs/utils/options-activity/index.js.map +1 -0
- 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/input-text-counter/index.js +63 -0
- package/lib/module/components/input-text-counter/index.js.map +1 -0
- package/lib/module/components/input-text-counter/interface.d.js.map +1 -0
- package/lib/module/components/input-text-counter/styles.js +37 -0
- package/lib/module/components/input-text-counter/styles.js.map +1 -0
- package/lib/module/components/modal-create-activitie/index.js +192 -0
- package/lib/module/components/modal-create-activitie/index.js.map +1 -0
- package/lib/module/components/modal-create-activitie/interface.js +2 -0
- package/lib/module/components/modal-create-activitie/interface.js.map +1 -0
- package/lib/module/components/modal-create-activitie/styles.js +37 -0
- package/lib/module/components/modal-create-activitie/styles.js.map +1 -0
- package/lib/module/components/modal-journey-rectification/index.js +192 -0
- package/lib/module/components/modal-journey-rectification/index.js.map +1 -0
- package/lib/module/components/modal-journey-rectification/interface.d.js +2 -0
- package/lib/module/components/modal-journey-rectification/interface.d.js.map +1 -0
- package/lib/module/components/modal-journey-rectification/styles.js +37 -0
- package/lib/module/components/modal-journey-rectification/styles.js.map +1 -0
- package/lib/module/components/{modal-activities → modals/modal-activities}/data-activities/index.js +2 -2
- package/lib/module/components/modals/modal-activities/data-activities/index.js.map +1 -0
- package/lib/module/components/{modal-activities → modals/modal-activities}/index.js +8 -8
- package/lib/module/components/modals/modal-activities/index.js.map +1 -0
- package/lib/module/components/modals/modal-activities/interface.d.js +2 -0
- package/lib/module/components/modals/modal-activities/interface.d.js.map +1 -0
- package/lib/module/components/modals/modal-activity-reason/index.js +151 -0
- package/lib/module/components/modals/modal-activity-reason/index.js.map +1 -0
- package/lib/module/components/modals/modal-activity-reason/interface.d.js +2 -0
- package/lib/module/components/modals/modal-activity-reason/interface.d.js.map +1 -0
- package/lib/module/components/{modal-change-activity → modals/modal-change-activity}/index.js +6 -6
- package/lib/module/components/modals/modal-change-activity/index.js.map +1 -0
- package/lib/module/components/selects/select-date-and-hours/index.js +86 -0
- package/lib/module/components/selects/select-date-and-hours/index.js.map +1 -0
- package/lib/module/components/selects/select-date-and-hours/interface.js +2 -0
- package/lib/module/components/selects/select-date-and-hours/interface.js.map +1 -0
- package/lib/module/components/selects/select-date-and-hours/styles.js +28 -0
- package/lib/module/components/selects/select-date-and-hours/styles.js.map +1 -0
- package/lib/module/components/selects/select-option/index.js +41 -42
- package/lib/module/components/selects/select-option/index.js.map +1 -1
- package/lib/module/components/step-indicator/index.js +10 -10
- package/lib/module/components/step-indicator/index.js.map +1 -1
- package/lib/module/components/step-indicator/interface.d.js.map +1 -1
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/stories/input-text-counter/input-text-counter.stories.js +253 -0
- package/lib/module/stories/input-text-counter/input-text-counter.stories.js.map +1 -0
- package/lib/module/stories/modal-activities/modal-activities.stories.js +1 -1
- package/lib/module/stories/modal-activities/modal-activities.stories.js.map +1 -1
- package/lib/module/stories/modal-activity-reason/modal-activity-reason.stories.js +193 -0
- package/lib/module/stories/modal-activity-reason/modal-activity-reason.stories.js.map +1 -0
- package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js +3 -3
- package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -1
- package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js +78 -0
- package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -0
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js +168 -0
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -0
- package/lib/module/stories/select-option/select-option.stories.js +1 -1
- package/lib/module/stories/select-option/select-option.stories.js.map +1 -1
- package/lib/module/stories/step-indicator/step-indicator.stories.js +2 -1
- package/lib/module/stories/step-indicator/step-indicator.stories.js.map +1 -1
- package/lib/module/styles/theme/theme.js +18 -2
- package/lib/module/styles/theme/theme.js.map +1 -1
- package/lib/module/utils/options-activity/index.js +22 -0
- package/lib/module/utils/options-activity/index.js.map +1 -0
- package/lib/module/utils/text-limit/index.js +30 -0
- package/lib/module/utils/text-limit/index.js.map +1 -0
- package/lib/typescript/src/components/input-text-counter/index.d.ts +33 -0
- package/lib/typescript/src/components/input-text-counter/styles.d.ts +34 -0
- package/lib/typescript/src/components/modal-create-activitie/index.d.ts +7 -0
- package/lib/typescript/src/components/modal-create-activitie/interface.d.ts +18 -0
- package/lib/typescript/src/components/modal-create-activitie/styles.d.ts +32 -0
- package/lib/typescript/src/components/modal-journey-rectification/index.d.ts +7 -0
- package/lib/typescript/src/components/modal-journey-rectification/styles.d.ts +32 -0
- package/lib/typescript/src/components/modals/modal-activity-reason/index.d.ts +7 -0
- package/lib/typescript/src/components/selects/select-date-and-hours/index.d.ts +12 -0
- package/lib/typescript/src/components/selects/select-date-and-hours/interface.d.ts +21 -0
- package/lib/typescript/src/components/selects/select-date-and-hours/styles.d.ts +24 -0
- package/lib/typescript/src/components/selects/select-option/index.d.ts +3 -6
- package/lib/typescript/src/index.d.ts +7 -3
- package/lib/typescript/src/stories/input-text-counter/input-text-counter.stories.d.ts +17 -0
- package/lib/typescript/src/stories/modal-activities/modal-activities.stories.d.ts +1 -1
- package/lib/typescript/src/stories/modal-activity-reason/modal-activity-reason.stories.d.ts +15 -0
- package/lib/typescript/src/stories/modal-change-activity/modal-change-activity.stories.d.ts +1 -1
- package/lib/typescript/src/stories/modal-create-activitie/modal-create-activitie.stories.d.ts +12 -0
- package/lib/typescript/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts +34 -0
- package/lib/typescript/src/stories/select-option/select-option.stories.d.ts +1 -1
- package/lib/typescript/src/styles/global/theme-provider.d.ts +16 -0
- package/lib/typescript/src/styles/theme/theme.d.ts +16 -0
- package/lib/typescript/src/utils/options-activity/index.d.ts +20 -0
- package/lib/typescript/src/utils/text-limit/index.d.ts +13 -0
- package/package.json +1 -1
- package/src/components/input-text-counter/index.tsx +64 -0
- package/src/components/input-text-counter/interface.d.ts +41 -0
- package/src/components/input-text-counter/styles.ts +38 -0
- package/src/components/modal-create-activitie/index.tsx +211 -0
- package/src/components/modal-create-activitie/interface.ts +22 -0
- package/src/components/modal-create-activitie/styles.ts +24 -0
- package/src/components/modal-journey-rectification/index.tsx +211 -0
- package/src/components/modal-journey-rectification/interface.d.ts +22 -0
- package/src/components/modal-journey-rectification/styles.ts +24 -0
- package/src/components/{modal-activities → modals/modal-activities}/data-activities/index.ts +65 -65
- package/src/components/{modal-activities → modals/modal-activities}/index.tsx +137 -137
- package/src/components/{modal-activities → modals/modal-activities}/interface.d.ts +32 -32
- package/src/components/modals/modal-activity-reason/index.tsx +162 -0
- package/src/components/modals/modal-activity-reason/interface.d.ts +10 -0
- package/src/components/{modal-change-activity → modals/modal-change-activity}/index.tsx +6 -6
- package/src/components/selects/select-date-and-hours/index.tsx +97 -0
- package/src/components/selects/select-date-and-hours/interface.ts +31 -0
- package/src/components/selects/select-date-and-hours/styles.ts +24 -0
- package/src/components/selects/select-option/index.tsx +50 -41
- package/src/components/step-indicator/index.tsx +235 -235
- package/src/components/step-indicator/interface.d.ts +2 -2
- package/src/index.ts +49 -45
- package/src/stories/input-text-counter/input-text-counter.stories.tsx +232 -0
- package/src/stories/modal-activities/modal-activities.stories.tsx +64 -64
- package/src/stories/modal-activity-reason/modal-activity-reason.stories.tsx +192 -0
- package/src/stories/modal-change-activity/modal-change-activity.stories.tsx +49 -49
- package/src/stories/modal-create-activitie/modal-create-activitie.stories.tsx +82 -0
- package/src/stories/modal-journey-rectification/modal-journey-rectification.stories.tsx +161 -0
- package/src/stories/select-option/select-option.stories.tsx +1 -1
- package/src/stories/step-indicator/step-indicator.stories.tsx +2 -1
- package/src/styles/theme/theme.ts +17 -0
- package/src/utils/options-activity/index.ts +14 -0
- package/src/utils/text-limit/index.ts +28 -0
- package/lib/commonjs/components/modal-activities/data-activities/index.js.map +0 -1
- package/lib/commonjs/components/modal-activities/index.js.map +0 -1
- package/lib/commonjs/components/modal-activities/interface.d.js.map +0 -1
- package/lib/commonjs/components/modal-change-activity/index.js.map +0 -1
- package/lib/module/components/modal-activities/data-activities/index.js.map +0 -1
- package/lib/module/components/modal-activities/index.js.map +0 -1
- package/lib/module/components/modal-activities/interface.d.js.map +0 -1
- package/lib/module/components/modal-change-activity/index.js.map +0 -1
- /package/lib/commonjs/components/{modal-activities → input-text-counter}/interface.d.js +0 -0
- /package/lib/module/components/{modal-activities → input-text-counter}/interface.d.js +0 -0
- /package/lib/typescript/src/components/{modal-activities → modals/modal-activities}/data-activities/index.d.ts +0 -0
- /package/lib/typescript/src/components/{modal-activities → modals/modal-activities}/index.d.ts +0 -0
- /package/lib/typescript/src/components/{modal-change-activity → modals/modal-change-activity}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport { ModalProps } from \"react-native\";\r\n\r\n// typing\r\nimport { IGlobalCss } from \"../../../styles/global/interface\";\r\n\r\ninterface IActivity {\r\n id: number;\r\n referencia: string;\r\n cor_hex: string;\r\n descricao: string;\r\n tipo: \"trabalho\" | \"descanso\";\r\n}\r\n\r\ninterface IModalActivities extends ModalProps, IGlobalCss {\r\n /** função que fecha modal */\r\n onClose: () => void;\r\n\r\n /** tipo de atividades */\r\n activityType: IActivity[\"tipo\"];\r\n\r\n /** função que manda atividade selecionada */\r\n // eslint-disable-next-line no-unused-vars\r\n handleActivity: (activity: IActivity) => void;\r\n}\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { IModalActivities, IActivity };\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import { Modal, View } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import Box from "../../box";
|
|
9
|
+
import { Typography } from "../../typography";
|
|
10
|
+
import { Button } from "../../button";
|
|
11
|
+
import InputTextCounter from "../../input-text-counter";
|
|
12
|
+
|
|
13
|
+
// commons / svg
|
|
14
|
+
import { Icons } from "../../../common/icons-svg";
|
|
15
|
+
|
|
16
|
+
// typings
|
|
17
|
+
|
|
18
|
+
// styles
|
|
19
|
+
import { theme } from "../../../styles/theme/theme";
|
|
20
|
+
const ModalActivityReason = ({
|
|
21
|
+
visible,
|
|
22
|
+
onClose,
|
|
23
|
+
modalConfirm,
|
|
24
|
+
textTitle,
|
|
25
|
+
testID
|
|
26
|
+
}) => {
|
|
27
|
+
const [isLoading] = useState(false);
|
|
28
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
29
|
+
testID: testID,
|
|
30
|
+
animationType: "fade",
|
|
31
|
+
transparent: true,
|
|
32
|
+
visible: visible
|
|
33
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
34
|
+
style: {
|
|
35
|
+
flex: 1,
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
backgroundColor: "rgba(0,0,0,0.6)"
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
41
|
+
width: "90%",
|
|
42
|
+
backgroundColor: theme.colors.orange[500],
|
|
43
|
+
borderStyled: {
|
|
44
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
45
|
+
},
|
|
46
|
+
paddingStyle: {
|
|
47
|
+
paddingLeft: theme.paddings["2xs"],
|
|
48
|
+
paddingRight: theme.paddings["2xs"],
|
|
49
|
+
paddingTop: theme.paddings.sm,
|
|
50
|
+
paddingBottom: theme.paddings.sm
|
|
51
|
+
}
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
53
|
+
marginStyle: {
|
|
54
|
+
marginBottom: 10,
|
|
55
|
+
marginLeft: 4
|
|
56
|
+
},
|
|
57
|
+
flexStyle: {
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
alignItems: "center"
|
|
60
|
+
}
|
|
61
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
62
|
+
icon: "EXCLAMATION_TRIANGLE",
|
|
63
|
+
color: theme.colors.orange[500],
|
|
64
|
+
background: theme.colors.neutral[300],
|
|
65
|
+
size: 22
|
|
66
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
67
|
+
text: `${textTitle !== null && textTitle !== void 0 ? textTitle : "Motivo da exclusão"}`,
|
|
68
|
+
color: theme.colors.neutral[25],
|
|
69
|
+
marginLeft: theme.margins["2xs"],
|
|
70
|
+
fontFamily: theme.fonts.inter_bold_700,
|
|
71
|
+
size: theme.fontSizes.md
|
|
72
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
73
|
+
backgroundColor: theme.colors.neutral[300],
|
|
74
|
+
paddingStyle: {
|
|
75
|
+
padding: theme.paddings.xs
|
|
76
|
+
},
|
|
77
|
+
borderStyled: {
|
|
78
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
79
|
+
}
|
|
80
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
81
|
+
width: "100%"
|
|
82
|
+
}, /*#__PURE__*/React.createElement(InputTextCounter, {
|
|
83
|
+
label: `${textTitle || "Motivo da exclusão"}`,
|
|
84
|
+
placeholderTextColor: "#9B9B9B",
|
|
85
|
+
placeholder: "Motivo da exclus\xE3o"
|
|
86
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
87
|
+
marginStyle: {
|
|
88
|
+
marginTop: 4
|
|
89
|
+
},
|
|
90
|
+
flexStyle: {
|
|
91
|
+
flexDirection: "row",
|
|
92
|
+
justifyContent: "space-between"
|
|
93
|
+
}
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
95
|
+
title: "CANCELAR",
|
|
96
|
+
onPress: onClose,
|
|
97
|
+
width: "48%",
|
|
98
|
+
height: 40,
|
|
99
|
+
isLoading: isLoading,
|
|
100
|
+
disabled: isLoading,
|
|
101
|
+
backgroundColor: theme.colors.neutral[300],
|
|
102
|
+
buttonTextStyle: {
|
|
103
|
+
color: theme.colors.blue[100],
|
|
104
|
+
fontFamily: "Inter-Medium",
|
|
105
|
+
fontSize: theme.fontSizes.xs,
|
|
106
|
+
fontWeight: "500"
|
|
107
|
+
},
|
|
108
|
+
flexStyle: {
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "center",
|
|
112
|
+
textAlign: "center"
|
|
113
|
+
},
|
|
114
|
+
borderStyled: {
|
|
115
|
+
borderWidth: theme.borderWidths.thin,
|
|
116
|
+
borderColor: theme.colors.blue[100],
|
|
117
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
118
|
+
}
|
|
119
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
120
|
+
title: "CONFIRMAR",
|
|
121
|
+
onPress: () => {
|
|
122
|
+
modalConfirm(true);
|
|
123
|
+
onClose();
|
|
124
|
+
},
|
|
125
|
+
width: "48%",
|
|
126
|
+
height: 40,
|
|
127
|
+
isLoading: isLoading,
|
|
128
|
+
disabled: isLoading,
|
|
129
|
+
backgroundColor: theme.colors.blue[500],
|
|
130
|
+
buttonTextStyle: {
|
|
131
|
+
color: theme.colors.neutral[25],
|
|
132
|
+
fontFamily: "Inter-Medium",
|
|
133
|
+
fontSize: theme.fontSizes.xs,
|
|
134
|
+
fontWeight: "500"
|
|
135
|
+
},
|
|
136
|
+
flexStyle: {
|
|
137
|
+
flexDirection: "row",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
justifyContent: "center",
|
|
140
|
+
textAlign: "center"
|
|
141
|
+
},
|
|
142
|
+
borderStyled: {
|
|
143
|
+
borderWidth: theme.borderWidths.thin,
|
|
144
|
+
borderColor: theme.colors.blue[100],
|
|
145
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
146
|
+
}
|
|
147
|
+
}))))));
|
|
148
|
+
};
|
|
149
|
+
ModalActivityReason.displayName = "ModalActivityReason";
|
|
150
|
+
export default ModalActivityReason;
|
|
151
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","Modal","View","Box","Typography","Button","InputTextCounter","Icons","theme","ModalActivityReason","visible","onClose","modalConfirm","textTitle","testID","isLoading","createElement","animationType","transparent","style","flex","justifyContent","alignItems","backgroundColor","width","colors","orange","borderStyled","borderRadius","borderWidths","thick_medium","paddingStyle","paddingLeft","paddings","paddingRight","paddingTop","sm","paddingBottom","marginStyle","marginBottom","marginLeft","flexStyle","flexDirection","icon","color","background","neutral","size","text","margins","fontFamily","fonts","inter_bold_700","fontSizes","md","padding","xs","label","placeholderTextColor","placeholder","marginTop","title","onPress","height","disabled","buttonTextStyle","blue","fontSize","fontWeight","textAlign","borderWidth","thin","borderColor","displayName"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React, { useState } from \"react\";\r\nimport { Modal, View } from \"react-native\";\r\n\r\n// components\r\nimport Box from \"../../box\";\r\nimport { Typography } from \"../../typography\";\r\nimport { Button } from \"../../button\";\r\n\r\nimport InputTextCounter from \"../../input-text-counter\";\r\n\r\n// commons / svg\r\nimport { Icons } from \"../../../common/icons-svg\";\r\n\r\n// typings\r\nimport type { IModalActivityReasonProps } from \"./interface\";\r\n\r\n// styles\r\nimport { theme } from \"../../../styles/theme/theme\";\r\n\r\nconst ModalActivityReason: React.FC<IModalActivityReasonProps> = ({\r\n visible,\r\n onClose,\r\n modalConfirm,\r\n textTitle,\r\n testID,\r\n}) => {\r\n const [isLoading] = useState(false);\r\n\r\n return (\r\n <Modal testID={testID} animationType=\"fade\" transparent visible={visible}>\r\n <View\r\n style={{\r\n flex: 1,\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n backgroundColor: \"rgba(0,0,0,0.6)\",\r\n }}\r\n >\r\n <Box\r\n width={\"90%\"}\r\n backgroundColor={theme.colors.orange[500]}\r\n borderStyled={{\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n paddingStyle={{\r\n paddingLeft: theme.paddings[\"2xs\"],\r\n paddingRight: theme.paddings[\"2xs\"],\r\n paddingTop: theme.paddings.sm,\r\n paddingBottom: theme.paddings.sm,\r\n }}\r\n >\r\n <Box\r\n marginStyle={{ marginBottom: 10, marginLeft: 4 }}\r\n flexStyle={{ flexDirection: \"row\", alignItems: \"center\" }}\r\n >\r\n <Icons\r\n icon=\"EXCLAMATION_TRIANGLE\"\r\n color={theme.colors.orange[500]}\r\n background={theme.colors.neutral[300]}\r\n size={22}\r\n />\r\n <Typography\r\n text={`${textTitle ?? \"Motivo da exclusão\"}`}\r\n color={theme.colors.neutral[25]}\r\n marginLeft={theme.margins[\"2xs\"]}\r\n fontFamily={theme.fonts.inter_bold_700}\r\n size={theme.fontSizes.md}\r\n />\r\n </Box>\r\n\r\n <Box\r\n backgroundColor={theme.colors.neutral[300]}\r\n paddingStyle={{\r\n padding: theme.paddings.xs,\r\n }}\r\n borderStyled={{\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n >\r\n <Box width=\"100%\">\r\n <InputTextCounter\r\n label={`${textTitle || \"Motivo da exclusão\"}`}\r\n placeholderTextColor=\"#9B9B9B\"\r\n placeholder=\"Motivo da exclusão\"\r\n />\r\n </Box>\r\n <Box\r\n marginStyle={{ marginTop: 4 }}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n justifyContent: \"space-between\",\r\n }}\r\n >\r\n <Button\r\n title=\"CANCELAR\"\r\n onPress={onClose}\r\n width={\"48%\"}\r\n height={40}\r\n isLoading={isLoading}\r\n disabled={isLoading}\r\n backgroundColor={theme.colors.neutral[300]}\r\n buttonTextStyle={{\r\n color: theme.colors.blue[100],\r\n fontFamily: \"Inter-Medium\",\r\n fontSize: theme.fontSizes.xs,\r\n fontWeight: \"500\",\r\n }}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n textAlign: \"center\",\r\n }}\r\n borderStyled={{\r\n borderWidth: theme.borderWidths.thin,\r\n borderColor: theme.colors.blue[100],\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n />\r\n <Button\r\n title=\"CONFIRMAR\"\r\n onPress={() => {\r\n modalConfirm(true);\r\n onClose();\r\n }}\r\n width={\"48%\"}\r\n height={40}\r\n isLoading={isLoading}\r\n disabled={isLoading}\r\n backgroundColor={theme.colors.blue[500]}\r\n buttonTextStyle={{\r\n color: theme.colors.neutral[25],\r\n fontFamily: \"Inter-Medium\",\r\n fontSize: theme.fontSizes.xs,\r\n fontWeight: \"500\",\r\n }}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n textAlign: \"center\",\r\n }}\r\n borderStyled={{\r\n borderWidth: theme.borderWidths.thin,\r\n borderColor: theme.colors.blue[100],\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n />\r\n </Box>\r\n </Box>\r\n </Box>\r\n </View>\r\n </Modal>\r\n );\r\n};\r\n\r\nModalActivityReason.displayName = \"ModalActivityReason\";\r\n\r\nexport default ModalActivityReason;\r\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,KAAK,EAAEC,IAAI,QAAQ,cAAc;;AAE1C;AACA,OAAOC,GAAG,MAAM,WAAW;AAC3B,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAOC,gBAAgB,MAAM,0BAA0B;;AAEvD;AACA,SAASC,KAAK,QAAQ,2BAA2B;;AAEjD;;AAGA;AACA,SAASC,KAAK,QAAQ,6BAA6B;AAEn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AE,CAAC;MAC/BI,UAAU,EAAE,cAAc;MAC1BiB,QAAQ,EAAE3D,KAAK,CAAC6C,SAAS,CAACG,EAAE;MAC5BY,UAAU,EAAE;IACd,CAAE;IACF3B,SAAS,EAAE;MACTC,aAAa,EAAE,KAAK;MACpBpB,UAAU,EAAE,QAAQ;MACpBD,cAAc,EAAE,QAAQ;MACxBgD,SAAS,EAAE;IACb,CAAE;IACF1C,YAAY,EAAE;MACZ2C,WAAW,EAAE9D,KAAK,CAACqB,YAAY,CAAC0C,IAAI;MACpCC,WAAW,EAAEhE,KAAK,CAACiB,MAAM,CAACyC,IAAI,CAAC,GAAG,CAAC;MACnCtC,YAAY,EAAEpB,KAAK,CAACqB,YAAY,CAACC;IACnC;EAAE,CACH,CACE,CACF,CACF,CACD,CACD,CAAC;AAEZ,CAAC;AAEDrB,mBAAmB,CAACgE,WAAW,GAAG,qBAAqB;AAEvD,eAAehE,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/* eslint-disable no-unused-vars */\r\ninterface IModalActivityReasonProps {\r\n visible: boolean;\r\n onClose: () => void;\r\n modalConfirm: (value: true) => void;\r\n textTitle?: string;\r\n testID?: string;\r\n}\r\n\r\nexport type { IModalActivityReasonProps };\r\n"],"mappings":"","ignoreList":[]}
|
package/lib/module/components/{modal-change-activity → modals/modal-change-activity}/index.js
RENAMED
|
@@ -7,16 +7,16 @@ import React from "react";
|
|
|
7
7
|
import { Modal, View } from "react-native";
|
|
8
8
|
|
|
9
9
|
// componentes internos
|
|
10
|
-
import Box from "
|
|
11
|
-
import { Typography } from "
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
10
|
+
import Box from "../../box";
|
|
11
|
+
import { Typography } from "../../typography";
|
|
12
|
+
import { Button } from "../../button";
|
|
13
|
+
import SelectOption from "../../selects/select-option";
|
|
14
14
|
|
|
15
15
|
// styles / theme
|
|
16
|
-
import { theme } from "
|
|
16
|
+
import { theme } from "../../../styles/theme/theme";
|
|
17
17
|
|
|
18
18
|
// assets / icons
|
|
19
|
-
import { Icons } from "
|
|
19
|
+
import { Icons } from "../../../common/icons-svg";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* TYPES
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Modal","View","Box","Typography","Button","SelectOption","theme","Icons","options","label","value","key","ModalChangeActivity","visible","onClose","modalConfirm","descricao","isLoading","useState","initial","toLowerCase","replace","selectedOption","setSelectedOption","handleConfirm","selected","find","opt","createElement","animationType","transparent","style","flex","justifyContent","alignItems","backgroundColor","width","colors","orange","borderStyled","borderRadius","borderWidths","thick_medium","paddingStyle","paddingLeft","paddings","paddingRight","paddingTop","sm","paddingBottom","marginStyle","marginBottom","margins","marginLeft","flexStyle","flexDirection","icon","color","black","background","yellow","size","text","fontFamily","fonts","inter_bold_700","fontSizes","md","neutral","padding","xs","inter_medium_500","flexWrap","maxWidth","titleLabel","sizeTitleLabel","dataOption","handleSelectDown","option","o","marginTop","title","onPress","height","disabled","buttonTextStyle","blue","fontSize","fontWeight","textAlign","borderWidth","thin","borderColor"],"sources":["index.tsx"],"sourcesContent":["/* eslint-disable no-unused-vars */\n/**\n * IMPORTS\n */\nimport React from \"react\";\n// libs RN\nimport { Modal, View } from \"react-native\";\n\n// componentes internos\nimport Box from \"../../box\";\nimport { Typography } from \"../../typography\";\nimport { Button } from \"../../button\";\nimport SelectOption from \"../../selects/select-option\";\n\n// styles / theme\nimport { theme } from \"../../../styles/theme/theme\";\n\n// assets / icons\nimport { Icons } from \"../../../common/icons-svg\";\n\n/**\n * TYPES\n */\ninterface IModalChangeActivityProps {\n visible: boolean;\n onClose: () => void;\n modalConfirm: (newData: { label: string; value: string; key: number }) => void;\n descricao: string;\n}\n\n/**\n * CONSTANTS\n */\nconst options = [\n { label: \"Selecione atividade\", value: \"none\", key: 0 },\n { label: \"Descanso\", value: \"descanso\", key: 5 },\n { label: \"Repouso Noturno\", value: \"repouso_noturno\", key: 6 },\n { label: \"Refeição\", value: \"refeição\", key: 7 },\n { label: \"Repouso Semanal\", value: \"repouso_semanal\", key: 9 },\n];\n\n/**\n * COMPONENT\n */\nexport const ModalChangeActivity: React.FC<IModalChangeActivityProps> = ({\n visible,\n onClose,\n modalConfirm,\n descricao,\n}) => {\n const [isLoading] = React.useState(false);\n\n const initial = (descricao ?? \"\").toLowerCase().replace(/\\s+/g, \"_\");\n const [selectedOption, setSelectedOption] = React.useState(initial || \"none\");\n\n const handleConfirm = () => {\n const selected = options.find((opt) => opt.value === selectedOption);\n if (selected && selected.value !== \"none\") {\n modalConfirm({\n label: selected.label,\n value: selected.value,\n key: selected.key,\n });\n }\n onClose();\n };\n\n return (\n <Modal animationType=\"fade\" transparent visible={visible}>\n <View\n style={{\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"rgba(0,0,0,0.6)\",\n }}\n >\n <Box\n width={346}\n backgroundColor={theme.colors.orange[500]}\n borderStyled={{\n borderRadius: theme.borderWidths.thick_medium,\n }}\n paddingStyle={{\n paddingLeft: theme.paddings[\"2xs\"],\n paddingRight: theme.paddings[\"2xs\"],\n paddingTop: theme.paddings.sm,\n paddingBottom: theme.paddings.sm,\n }}\n >\n <Box\n marginStyle={{ marginBottom: theme.margins[\"2xs\"], marginLeft: theme.margins[\"1xs\"] }}\n flexStyle={{ flexDirection: \"row\", alignItems: \"center\" }}\n >\n <Icons\n icon=\"EXCLAMATION_TRIANGLE\"\n color={theme.colors.black[10]}\n background={theme.colors.yellow[50]}\n size={22}\n />\n <Typography\n text=\"Alterar Atividade\"\n color=\"#fff\"\n marginLeft={theme.margins[\"2xs\"]}\n fontFamily={theme.fonts.inter_bold_700}\n size={theme.fontSizes.md}\n />\n </Box>\n\n <Box\n backgroundColor={theme.colors.neutral[300]}\n paddingStyle={{ padding: theme.paddings.xs }}\n borderStyled={{ borderRadius: theme.borderWidths.thick_medium }}\n >\n <Box flexStyle={{ flexDirection: \"row\", justifyContent: \"flex-start\" }} width={\"90%\"}>\n <Typography\n text={`Deseja realmente alterar sua atividade de ${descricao || \"atividade atual\"}?`}\n color={theme.colors.black[25]}\n fontFamily={theme.fonts.inter_medium_500}\n size={theme.fontSizes.xs}\n style={{ flexWrap: \"wrap\", maxWidth: \"100%\" }}\n />\n </Box>\n\n <SelectOption\n titleLabel=\"Selecione atividade\"\n sizeTitleLabel={theme.fontSizes.xs}\n dataOption={options}\n handleSelectDown={(opt) => {\n const option = options.find((o) => o.label === opt || o.value === opt);\n if (option) setSelectedOption(option.value);\n }}\n backgroundColor={theme.colors.neutral[300]}\n />\n\n <Box\n marginStyle={{ marginTop: theme.margins[\"1xs\"] }}\n flexStyle={{ flexDirection: \"row\", justifyContent: \"space-between\" }}\n >\n <Button\n title=\"CANCELAR\"\n onPress={onClose}\n width={\"48%\"}\n height={36}\n isLoading={isLoading}\n disabled={isLoading}\n backgroundColor={theme.colors.neutral[300]}\n buttonTextStyle={{\n color: theme.colors.blue[100],\n fontFamily: \"Inter-Medium\",\n fontSize: theme.fontSizes.xs,\n fontWeight: \"500\",\n }}\n flexStyle={{\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textAlign: \"center\",\n }}\n borderStyled={{\n borderWidth: theme.borderWidths.thin,\n borderColor: theme.colors.blue[100],\n borderRadius: theme.borderWidths.thick_medium,\n }}\n />\n <Button\n title=\"CONFIRMAR\"\n onPress={handleConfirm}\n width={\"48%\"}\n height={36}\n isLoading={isLoading}\n disabled={isLoading}\n backgroundColor={theme.colors.blue[100]}\n buttonTextStyle={{\n color: \"#fff\",\n fontFamily: \"Inter-Medium\",\n fontSize: theme.fontSizes.xs,\n fontWeight: \"500\",\n }}\n flexStyle={{\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textAlign: \"center\",\n }}\n borderStyled={{\n borderWidth: theme.borderWidths.thin,\n borderColor: theme.colors.blue[100],\n borderRadius: theme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AAK;MACpBrB,UAAU,EAAE,QAAQ;MACpBD,cAAc,EAAE,QAAQ;MACxBwD,SAAS,EAAE;IACb,CAAE;IACFlD,YAAY,EAAE;MACZmD,WAAW,EAAEpF,KAAK,CAACmC,YAAY,CAACkD,IAAI;MACpCC,WAAW,EAAEtF,KAAK,CAAC+B,MAAM,CAACiD,IAAI,CAAC,GAAG,CAAC;MACnC9C,YAAY,EAAElC,KAAK,CAACmC,YAAY,CAACC;IACnC;EAAE,CACH,CACE,CACF,CACF,CACD,CACD,CAAC;AAEZ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useState } from "react";
|
|
5
|
+
import { View, TouchableOpacity } from "react-native";
|
|
6
|
+
import DateTimePicker from "@react-native-community/datetimepicker";
|
|
7
|
+
|
|
8
|
+
// seus componentes
|
|
9
|
+
import Box from "../../box";
|
|
10
|
+
import { Typography } from "../../typography";
|
|
11
|
+
|
|
12
|
+
// commons / svg
|
|
13
|
+
import { Icons } from "../../../common/icons-svg";
|
|
14
|
+
|
|
15
|
+
// typings
|
|
16
|
+
|
|
17
|
+
import { asBaseComponent } from "../../../@types/as-base-component";
|
|
18
|
+
|
|
19
|
+
// styles
|
|
20
|
+
import { theme } from "../../../styles/theme/theme";
|
|
21
|
+
import { styles } from "./styles";
|
|
22
|
+
import { formatDate, formHoursMinute } from "../../../utils/format-data";
|
|
23
|
+
const ActivityFields = /*#__PURE__*/forwardRef(({
|
|
24
|
+
value,
|
|
25
|
+
icon,
|
|
26
|
+
onPressConfirm,
|
|
27
|
+
disabled = false
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
30
|
+
const [pickerDate, setPickerDate] = useState(new Date());
|
|
31
|
+
const isCalendar = (icon !== null && icon !== void 0 ? icon : "CALENDAR") === "CALENDAR";
|
|
32
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
activeOpacity: 0.7,
|
|
35
|
+
style: [styles.field, {
|
|
36
|
+
borderColor: theme.colors.gray[700],
|
|
37
|
+
backgroundColor: theme.colors.neutral[300],
|
|
38
|
+
opacity: disabled ? 0.7 : 1
|
|
39
|
+
}],
|
|
40
|
+
onPress: () => setModalVisible(true),
|
|
41
|
+
disabled: disabled
|
|
42
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
43
|
+
style: styles.row
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
45
|
+
width: "10%",
|
|
46
|
+
height: 45,
|
|
47
|
+
flexStyle: {
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
justifyContent: "center"
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
52
|
+
icon: icon ? icon : "CALENDAR",
|
|
53
|
+
color: theme.colors.black[100],
|
|
54
|
+
size: 18
|
|
55
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
56
|
+
width: "90%",
|
|
57
|
+
height: 45,
|
|
58
|
+
flexStyle: {
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center"
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
63
|
+
text: String(value),
|
|
64
|
+
color: theme.colors.blue[500],
|
|
65
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
66
|
+
size: theme.fontSizes.md,
|
|
67
|
+
marginRight: 44
|
|
68
|
+
})))), modalVisible && /*#__PURE__*/React.createElement(DateTimePicker, {
|
|
69
|
+
value: pickerDate,
|
|
70
|
+
mode: isCalendar ? "date" : "time",
|
|
71
|
+
is24Hour: true,
|
|
72
|
+
onChange: (event, date) => {
|
|
73
|
+
if ((event === null || event === void 0 ? void 0 : event.type) === "set" && date) {
|
|
74
|
+
setPickerDate(date);
|
|
75
|
+
const seconds = date.getHours() * 3600 + date.getMinutes() * 60;
|
|
76
|
+
const nextValue = isCalendar ? formatDate(date) : formHoursMinute(String(seconds));
|
|
77
|
+
// @ts-ignore genérico aceita string
|
|
78
|
+
onPressConfirm(nextValue);
|
|
79
|
+
}
|
|
80
|
+
setModalVisible(false);
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
ActivityFields.displayName = "ActivityFields";
|
|
85
|
+
export default asBaseComponent(ActivityFields);
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useState","View","TouchableOpacity","DateTimePicker","Box","Typography","Icons","asBaseComponent","theme","styles","formatDate","formHoursMinute","ActivityFields","value","icon","onPressConfirm","disabled","ref","modalVisible","setModalVisible","pickerDate","setPickerDate","Date","isCalendar","createElement","Fragment","activeOpacity","style","field","borderColor","colors","gray","backgroundColor","neutral","opacity","onPress","row","width","height","flexStyle","alignItems","justifyContent","color","black","size","text","String","blue","fontFamily","fonts","inter_medium_500","fontSizes","md","marginRight","mode","is24Hour","onChange","event","date","type","seconds","getHours","getMinutes","nextValue","displayName"],"sources":["index.tsx"],"sourcesContent":["/**\n * IMPORTS\n */\nimport React, { forwardRef, useState } from \"react\";\n\nimport { View, TouchableOpacity } from \"react-native\";\nimport DateTimePicker from \"@react-native-community/datetimepicker\";\n\n// seus componentes\nimport Box from \"../../box\";\nimport { Typography } from \"../../typography\";\n\n// commons / svg\nimport { Icons } from \"../../../common/icons-svg\";\n\n// typings\nimport type { IActivityFieldsProps } from \"./interface\";\nimport { asBaseComponent } from \"../../../@types/as-base-component\";\n\n// styles\nimport { theme } from \"../../../styles/theme/theme\";\nimport { styles } from \"./styles\";\nimport { formatDate, formHoursMinute } from \"../../../utils/format-data\";\n\nconst ActivityFields = forwardRef<any, IActivityFieldsProps<any>>(\n ({ value, icon, onPressConfirm, disabled = false }, ref): React.ReactElement => {\n const [modalVisible, setModalVisible] = useState(false);\n const [pickerDate, setPickerDate] = useState<Date>(new Date());\n\n const isCalendar = (icon ?? \"CALENDAR\") === \"CALENDAR\";\n\n return (\n <>\n <TouchableOpacity\n ref={ref}\n activeOpacity={0.7}\n style={[\n styles.field,\n {\n borderColor: theme.colors.gray[700],\n backgroundColor: theme.colors.neutral[300],\n opacity: disabled ? 0.7 : 1,\n },\n ]}\n onPress={() => setModalVisible(true)}\n disabled={disabled}\n >\n <View style={styles.row}>\n <Box\n width={\"10%\"}\n height={45}\n flexStyle={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n <Icons icon={icon ? icon : \"CALENDAR\"} color={theme.colors.black[100]} size={18} />\n </Box>\n\n <Box\n width={\"90%\"}\n height={45}\n flexStyle={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n <Typography\n text={String(value)}\n color={theme.colors.blue[500]}\n fontFamily={theme.fonts.inter_medium_500}\n size={theme.fontSizes.md}\n marginRight={44}\n />\n </Box>\n </View>\n </TouchableOpacity>\n\n {modalVisible && (\n <DateTimePicker\n value={pickerDate}\n mode={isCalendar ? \"date\" : \"time\"}\n is24Hour\n onChange={(event: any, date?: Date) => {\n if (event?.type === \"set\" && date) {\n setPickerDate(date);\n const seconds = date.getHours() * 3600 + date.getMinutes() * 60;\n const nextValue = isCalendar ? formatDate(date) : formHoursMinute(String(seconds));\n // @ts-ignore genérico aceita string\n onPressConfirm(nextValue);\n }\n setModalVisible(false);\n }}\n />\n )}\n </>\n );\n }\n);\n\nActivityFields.displayName = \"ActivityFields\";\n\nexport default asBaseComponent(ActivityFields);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACrD,OAAOC,cAAc,MAAM,wCAAwC;;AAEnE;AACA,OAAOC,GAAG,MAAM,WAAW;AAC3B,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA,SAASC,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UAAU,CAAC,CAAC,GAAG,EAAE;QAC/D,MAAMC,SAAS,GAAGxC,UAAU,GAAGb,UAAU,CAACgD,IAAI,CAAC,GAAG/C,eAAe,CAACmC,MAAM,CAACc,OAAO,CAAC,CAAC;QAClF;QACA7C,cAAc,CAACgD,SAAS,CAAC;MAC3B;MACA5C,eAAe,CAAC,KAAK,CAAC;IACxB;EAAE,CACH,CAEH,CAAC;AAEP,CACF,CAAC;AAEDP,cAAc,CAACoD,WAAW,GAAG,gBAAgB;AAE7C,eAAezD,eAAe,CAACK,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["interface.ts"],"sourcesContent":["/* eslint-disable no-unused-vars */\r\n/**\r\n * IMPORTS\r\n */\r\n\r\nimport type { TouchableOpacityProps } from \"react-native\";\r\n\r\n// commons / svg\r\nimport type { SVG_NAME } from \"../../../common/icons-svg/constants\";\r\n\r\ntype IActivityFieldsProps<T> = TouchableOpacityProps & {\r\n /** Valor exibido e retornado no onPressConfirm */\r\n value: T | null;\r\n\r\n /** Ícone à esquerda (padrão: 'CALENDAR') */\r\n icon: keyof typeof SVG_NAME;\r\n\r\n /** Desabilita interação */\r\n disabled?: boolean;\r\n\r\n /** Cor do texto (opcional) */\r\n textColor?: string;\r\n\r\n /** Clique confirma e devolve o value */\r\n onPressConfirm: (value: T) => void;\r\n};\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport type { IActivityFieldsProps };\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { StyleSheet } from "react-native";
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
field: {
|
|
8
|
+
width: "100%",
|
|
9
|
+
height: 45,
|
|
10
|
+
borderRadius: 12,
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
paddingHorizontal: 12,
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
marginTop: 10,
|
|
15
|
+
marginBottom: 16
|
|
16
|
+
},
|
|
17
|
+
row: {
|
|
18
|
+
flexDirection: "row",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "space-around"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* EXPORTS
|
|
26
|
+
*/
|
|
27
|
+
export { styles };
|
|
28
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","styles","create","field","width","height","borderRadius","borderWidth","paddingHorizontal","justifyContent","marginTop","marginBottom","row","flexDirection","alignItems"],"sources":["styles.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\n\r\nimport { StyleSheet } from \"react-native\";\r\n\r\nconst styles = StyleSheet.create({\r\n field: {\r\n width: \"100%\",\r\n height: 45,\r\n borderRadius: 12,\r\n borderWidth: 1,\r\n paddingHorizontal: 12,\r\n justifyContent: \"center\",\r\n marginTop: 10,\r\n marginBottom: 16,\r\n },\r\n row: { flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-around\" },\r\n});\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { styles };\r\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,cAAc;AAEzC,MAAMC,MAAM,GAAGD,UAAU,CAACE,MAAM,CAAC;EAC/BC,KAAK,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,iBAAiB,EAAE,EAAE;IACrBC,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACDC,GAAG,EAAE;IAAEC,aAAa,EAAE,KAAK;IAAEC,UAAU,EAAE,QAAQ;IAAEL,cAAc,EAAE;EAAe;AACpF,CAAC,CAAC;;AAEF;AACA;AACA;AACA,SAASR,MAAM","ignoreList":[]}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* IMPORTS
|
|
3
3
|
*/
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { useState } from "react";
|
|
4
|
+
import React, { forwardRef, useState } from "react";
|
|
6
5
|
import { View, Text, TouchableOpacity, Modal, FlatList } from "react-native";
|
|
7
6
|
|
|
8
|
-
//
|
|
7
|
+
// commons / svg
|
|
8
|
+
import { Icons } from "../../../common/icons-svg";
|
|
9
|
+
|
|
10
|
+
// utils
|
|
11
|
+
import { handleLimitTextdisplayByAmount } from "../../../utils/text-limit";
|
|
9
12
|
|
|
13
|
+
// typings
|
|
14
|
+
import { asBaseComponent } from "../../../@types/as-base-component";
|
|
10
15
|
// styles
|
|
11
16
|
import { styles } from "./styles";
|
|
12
|
-
import { Icons } from "../../../common/icons-svg";
|
|
13
17
|
import { theme } from "../../../styles/theme/theme";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Componente SelectOption para a interação da ui.
|
|
17
|
-
*/
|
|
18
|
-
const SelectOption = ({
|
|
19
|
-
dataOption,
|
|
20
|
-
handleSelectDown,
|
|
21
|
-
titleLabel,
|
|
22
|
-
sizeTitleLabel,
|
|
23
|
-
colortitleLabel,
|
|
24
|
-
backgroundColor
|
|
25
|
-
}) => {
|
|
18
|
+
const SelectOption = /*#__PURE__*/forwardRef((props, ref) => {
|
|
26
19
|
var _dataOption$, _dataOption$find;
|
|
20
|
+
const {
|
|
21
|
+
dataOption,
|
|
22
|
+
handleSelectDown,
|
|
23
|
+
titleLabel,
|
|
24
|
+
sizeTitleLabel,
|
|
25
|
+
colortitleLabel,
|
|
26
|
+
backgroundColor
|
|
27
|
+
} = props;
|
|
27
28
|
const [selectedValue, setSelectedValue] = useState(((_dataOption$ = dataOption[0]) === null || _dataOption$ === void 0 ? void 0 : _dataOption$.value) || "");
|
|
28
29
|
const [modalVisible, setModalVisible] = useState(false);
|
|
29
30
|
const handleSelect = value => {
|
|
@@ -40,19 +41,22 @@ const SelectOption = ({
|
|
|
40
41
|
backgroundColor
|
|
41
42
|
};
|
|
42
43
|
return /*#__PURE__*/React.createElement(View, {
|
|
44
|
+
ref: ref,
|
|
43
45
|
style: styles(styleProps).container
|
|
44
46
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
45
47
|
style: styles(styleProps).label
|
|
46
48
|
}, `${titleLabel !== null && titleLabel !== void 0 ? titleLabel : "Selecione uma opção"}`, ":"), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
47
49
|
testID: "select-box",
|
|
48
|
-
style:
|
|
49
|
-
backgroundColor
|
|
50
|
-
}],
|
|
50
|
+
style: styles(styleProps).selectBox,
|
|
51
51
|
onPress: () => setModalVisible(true)
|
|
52
52
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
53
|
-
style: styles(styleProps).selectedText
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
style: styles(styleProps).selectedText,
|
|
54
|
+
numberOfLines: 1
|
|
55
|
+
}, `${handleLimitTextdisplayByAmount({
|
|
56
|
+
limit: 42,
|
|
57
|
+
text: (_dataOption$find = dataOption.find(item => item.value === selectedValue)) === null || _dataOption$find === void 0 ? void 0 : _dataOption$find.label
|
|
58
|
+
})}`), /*#__PURE__*/React.createElement(Icons, {
|
|
59
|
+
size: theme.fontSizes["xs"],
|
|
56
60
|
color: theme.colors.blue[500],
|
|
57
61
|
icon: "ARROW_DROP_DOWN"
|
|
58
62
|
})), /*#__PURE__*/React.createElement(Modal, {
|
|
@@ -63,21 +67,23 @@ const SelectOption = ({
|
|
|
63
67
|
}, /*#__PURE__*/React.createElement(View, {
|
|
64
68
|
style: styles(styleProps).modalOverlay
|
|
65
69
|
}, /*#__PURE__*/React.createElement(View, {
|
|
66
|
-
style:
|
|
67
|
-
width: "90%",
|
|
68
|
-
backgroundColor: "#fff",
|
|
69
|
-
borderRadius: 8,
|
|
70
|
-
padding: 16,
|
|
71
|
-
maxHeight: "80%"
|
|
72
|
-
}
|
|
70
|
+
style: styles(styleProps).modalContainer
|
|
73
71
|
}, /*#__PURE__*/React.createElement(View, {
|
|
74
72
|
style: {
|
|
75
73
|
width: "100%",
|
|
76
|
-
alignItems: "flex-end"
|
|
74
|
+
alignItems: "flex-end",
|
|
75
|
+
height: 40,
|
|
76
|
+
paddingRight: 8
|
|
77
77
|
}
|
|
78
78
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
79
79
|
testID: "close-icon",
|
|
80
|
-
onPress: () => setModalVisible(false)
|
|
80
|
+
onPress: () => setModalVisible(false),
|
|
81
|
+
style: {
|
|
82
|
+
width: 40,
|
|
83
|
+
height: 45,
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
justifyContent: "center"
|
|
86
|
+
}
|
|
81
87
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
82
88
|
size: theme.fontSizes["md"],
|
|
83
89
|
color: theme.colors.blue[500],
|
|
@@ -88,23 +94,16 @@ const SelectOption = ({
|
|
|
88
94
|
renderItem: ({
|
|
89
95
|
item
|
|
90
96
|
}) => /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
91
|
-
style:
|
|
92
|
-
width: "100%",
|
|
93
|
-
paddingVertical: 12,
|
|
94
|
-
paddingHorizontal: 8,
|
|
95
|
-
alignItems: "flex-start",
|
|
96
|
-
borderBottomWidth: 1,
|
|
97
|
-
borderColor: "#eee"
|
|
98
|
-
},
|
|
97
|
+
style: styles(styleProps).option,
|
|
99
98
|
onPress: () => handleSelect(item.value)
|
|
100
99
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
101
100
|
style: styles(styleProps).optionText
|
|
102
101
|
}, item.label))
|
|
103
102
|
})))));
|
|
104
|
-
};
|
|
103
|
+
});
|
|
105
104
|
|
|
106
105
|
/**
|
|
107
|
-
*
|
|
106
|
+
* Componente SelectOption para a interação da ui.
|
|
108
107
|
*/
|
|
109
|
-
export
|
|
108
|
+
export default asBaseComponent(SelectOption);
|
|
110
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","Text","TouchableOpacity","Modal","FlatList","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useState","View","Text","TouchableOpacity","Modal","FlatList","Icons","handleLimitTextdisplayByAmount","asBaseComponent","styles","theme","SelectOption","props","ref","_dataOption$","_dataOption$find","dataOption","handleSelectDown","titleLabel","sizeTitleLabel","colortitleLabel","backgroundColor","selectedValue","setSelectedValue","value","modalVisible","setModalVisible","handleSelect","styleProps","createElement","style","container","label","testID","selectBox","onPress","selectedText","numberOfLines","limit","text","find","item","size","fontSizes","color","colors","blue","icon","visible","transparent","animationType","modalOverlay","modalContainer","width","alignItems","height","paddingRight","justifyContent","data","keyExtractor","renderItem","option","optionText"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React, { forwardRef, useState } from \"react\";\r\nimport { View, Text, TouchableOpacity, Modal, FlatList } from \"react-native\";\r\n\r\n// commons / svg\r\nimport { Icons } from \"../../../common/icons-svg\";\r\n\r\n// utils\r\nimport { handleLimitTextdisplayByAmount } from \"../../../utils/text-limit\";\r\n\r\n// typings\r\nimport { asBaseComponent } from \"../../../@types/as-base-component\";\r\nimport type { ISelectDropDownProps } from \"./interface\";\r\n\r\n// styles\r\nimport { styles } from \"./styles\";\r\nimport { theme } from \"../../../styles/theme/theme\";\r\n\r\nconst SelectOption = forwardRef<any, ISelectDropDownProps>((props, ref): React.ReactElement => {\r\n const {\r\n dataOption,\r\n handleSelectDown,\r\n titleLabel,\r\n sizeTitleLabel,\r\n colortitleLabel,\r\n backgroundColor,\r\n } = props;\r\n\r\n const [selectedValue, setSelectedValue] = useState(dataOption[0]?.value || \"\");\r\n const [modalVisible, setModalVisible] = useState(false);\r\n\r\n const handleSelect = (value: string) => {\r\n setSelectedValue(value);\r\n setModalVisible(false);\r\n handleSelectDown(value);\r\n };\r\n\r\n const styleProps = {\r\n dataOption,\r\n handleSelectDown,\r\n titleLabel,\r\n sizeTitleLabel,\r\n colortitleLabel,\r\n backgroundColor,\r\n } as ISelectDropDownProps;\r\n return (\r\n <View ref={ref} style={styles(styleProps).container}>\r\n {/* Titulo para exibir o label */}\r\n <Text style={styles(styleProps).label}>{`${titleLabel ?? \"Selecione uma opção\"}`}:</Text>\r\n\r\n {/* Botão para abrir o modal */}\r\n <TouchableOpacity\r\n testID=\"select-box\"\r\n style={styles(styleProps).selectBox}\r\n onPress={() => setModalVisible(true)}\r\n >\r\n <Text style={styles(styleProps).selectedText} numberOfLines={1}>\r\n {`${handleLimitTextdisplayByAmount({\r\n limit: 42,\r\n text: dataOption.find((item) => item.value === selectedValue)?.label!,\r\n })}`}\r\n </Text>\r\n\r\n <Icons\r\n size={theme.fontSizes[\"xs\"]}\r\n color={theme.colors.blue[500]}\r\n icon={\"ARROW_DROP_DOWN\"}\r\n />\r\n </TouchableOpacity>\r\n\r\n {/* Modal para exibir as opções */}\r\n <Modal testID=\"modal-container\" visible={modalVisible} transparent animationType=\"fade\">\r\n <View style={styles(styleProps).modalOverlay}>\r\n <View style={styles(styleProps).modalContainer}>\r\n <View\r\n style={{\r\n width: \"100%\",\r\n alignItems: \"flex-end\",\r\n height: 40,\r\n paddingRight: 8,\r\n }}\r\n >\r\n <TouchableOpacity\r\n testID=\"close-icon\"\r\n onPress={() => setModalVisible(false)}\r\n style={{\r\n width: 40,\r\n height: 45,\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n }}\r\n >\r\n <Icons\r\n size={theme.fontSizes[\"md\"]}\r\n color={theme.colors.blue[500]}\r\n icon={\"CLOSED\"}\r\n />\r\n </TouchableOpacity>\r\n </View>\r\n <FlatList\r\n data={dataOption || []}\r\n keyExtractor={(item) => item.value}\r\n renderItem={({ item }) => (\r\n <TouchableOpacity\r\n style={styles(styleProps).option}\r\n onPress={() => handleSelect(item.value)}\r\n >\r\n <Text style={styles(styleProps).optionText}>{item.label}</Text>\r\n </TouchableOpacity>\r\n )}\r\n />\r\n </View>\r\n </View>\r\n </Modal>\r\n </View>\r\n );\r\n});\r\n\r\n/**\r\n * Componente SelectOption para a interação da ui.\r\n */\r\nexport default asBaseComponent(SelectOption);\r\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,cAAc;;AAE5E;AACA,SAASC,KAAK,QAAQ,2BAA2B;;AAEjD;AACA,SAASC,8BAA8B,QAAQ,2BAA2B;;AAE1E;AACA,SAASC,eAAe,QAAQ,mCAAmC;AAGnE;AACA,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,KAAK,QAAQ,6BAA6B;AAEnD,MAAMC,YAAY,gBAAGZ,UAAU,CAA4B,CAACa,KAAK,EAAEC,GAAG,KAAyB;EAAA,IAAAC,YAAA,EAAAC,gBAAA;EAC7F,MAAM;IACJC,UAAU;IACVC,gBAAgB;IAChBC,UAAU;IACVC,cAAc;IACdC,eAAe;IACfC;EACF,CAAC,GAAGT,KAAK;EAET,MAAM,CAACU,aAAa,EAAEC,gBAAgB,CAAC,GAAGvB,QAAQ,CAAC,EAAAc,YAAA,GAAAE,UAAU,CAAC,CAAC,CAAC,cAAAF,YAAA,uBAAbA,YAAA,CAAeU,KAAK,KAAI,EAAE,CAAC;EAC9E,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAG1B,QAAQ,CAAC,KAAK,CAAC;EAEvD,MAAM2B,YAAY,GAAIH,KAAa,IAAK;IACtCD,gBAAgB,CAACC,KAAK,CAAC;IACvBE,eAAe,CAAC,KAAK,CAAC;IACtBT,gBAAgB,CAACO,KAAK,CAAC;EACzB,CAAC;EAED,MAAMI,UAAU,GAAG;IACjBZ,UAAU;IACVC,gBAAgB;IAChBC,UAAU;IACVC,cAAc;IACdC,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K;IAAE,gBAExC1B,KAAA,CAAA+B,aAAA,CAAC3B,IAAI;MAAC4B,KAAK,EAAErB,MAAM,CAACmB,UAAU,CAAC,CAACkC;IAAW,GAAErB,IAAI,CAACT,KAAY,CAC9C;EAClB,CACH,CACG,CACF,CACD,CACH,CAAC;AAEX,CAAC,CAAC;;AAEF;AACA;AACA;AACA,eAAexB,eAAe,CAACG,YAAY,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { View, Text, TouchableOpacity } from "react-native";
|
|
@@ -16,10 +16,10 @@ import { getIconKeyByValue } from "./helpers/get-icon-by-status";
|
|
|
16
16
|
import { styles } from "./styles";
|
|
17
17
|
import { formHoursMinute } from "../../utils/format-data";
|
|
18
18
|
import { theme } from "../../styles/theme/theme";
|
|
19
|
-
import { ModalChangeActivity } from "../modal-change-activity";
|
|
19
|
+
import { ModalChangeActivity } from "../modals/modal-change-activity";
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Componente StepIndicator para a interação da ui.
|
|
21
|
+
/**
|
|
22
|
+
* Componente StepIndicator para a interação da ui.
|
|
23
23
|
*/
|
|
24
24
|
const StepIndicator = ({
|
|
25
25
|
data = [],
|
|
@@ -48,8 +48,8 @@ const StepIndicator = ({
|
|
|
48
48
|
const updatedStep = {
|
|
49
49
|
...stepData[currentStepIndex],
|
|
50
50
|
descricao: newData.label,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
referencia: newData.value,
|
|
52
|
+
ec_tipo_atividade_id: newData.key
|
|
53
53
|
};
|
|
54
54
|
const newSteps = stepData.map((item, index) => index === currentStepIndex ? updatedStep : item);
|
|
55
55
|
setStepData(newSteps);
|
|
@@ -68,7 +68,7 @@ const StepIndicator = ({
|
|
|
68
68
|
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
69
69
|
testID: "step-indicator",
|
|
70
70
|
activeOpacity: 0.7,
|
|
71
|
-
key: history.
|
|
71
|
+
key: history === null || history === void 0 ? void 0 : history.id,
|
|
72
72
|
style: styles({}).containerIndicator,
|
|
73
73
|
disabled: !canEdit,
|
|
74
74
|
onPress: () => handleOnPressActivitie(history, index)
|
|
@@ -180,8 +180,8 @@ const StepIndicator = ({
|
|
|
180
180
|
return /*#__PURE__*/React.createElement(React.Fragment, null, handleRenderComponent(type));
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
/**
|
|
184
|
-
* EXPORTS
|
|
183
|
+
/**
|
|
184
|
+
* EXPORTS
|
|
185
185
|
*/
|
|
186
186
|
export default StepIndicator;
|
|
187
187
|
//# sourceMappingURL=index.js.map
|