react-native-exp-fig 0.1.21 → 0.1.22
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/@types/as-base-component.js +12 -0
- package/lib/commonjs/@types/as-base-component.js.map +1 -0
- package/lib/commonjs/common/icons-svg/constants/index.js +2 -1
- package/lib/commonjs/common/icons-svg/constants/index.js.map +1 -1
- package/lib/commonjs/common/icons-svg/eclamation-triangle/index.js +33 -0
- package/lib/commonjs/common/icons-svg/eclamation-triangle/index.js.map +1 -0
- package/lib/commonjs/common/icons-svg/index.js +8 -0
- package/lib/commonjs/common/icons-svg/index.js.map +1 -1
- package/lib/commonjs/common/icons-svg/truck/index.js +2 -2
- package/lib/commonjs/common/icons-svg/truck/index.js.map +1 -1
- package/lib/commonjs/components/box/index.js +11 -11
- package/lib/commonjs/components/box/index.js.map +1 -1
- package/lib/commonjs/components/history-activities-card/index.js +197 -0
- package/lib/commonjs/components/history-activities-card/index.js.map +1 -0
- package/lib/commonjs/components/history-activities-card/interface.js +6 -0
- package/lib/commonjs/components/history-activities-card/interface.js.map +1 -0
- package/lib/commonjs/components/modal-change-activity/index.js +216 -0
- package/lib/commonjs/components/modal-change-activity/index.js.map +1 -0
- package/lib/commonjs/components/selects/select-option/index.js +28 -11
- package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
- package/lib/commonjs/components/selects/select-option/interface.d.js.map +1 -1
- package/lib/commonjs/components/step-indicator/index.js +45 -7
- package/lib/commonjs/components/step-indicator/index.js.map +1 -1
- package/lib/commonjs/helpers/text-utils.js +21 -0
- package/lib/commonjs/helpers/text-utils.js.map +1 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stories/history-activities-card/history-activities-card.stories.js +104 -0
- package/lib/commonjs/stories/history-activities-card/history-activities-card.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js +52 -0
- package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -0
- package/lib/commonjs/utils/get-icon-by-property/index.js.map +1 -1
- package/lib/module/@types/as-base-component.js +6 -0
- package/lib/module/@types/as-base-component.js.map +1 -0
- package/lib/module/common/icons-svg/constants/index.js +2 -1
- package/lib/module/common/icons-svg/constants/index.js.map +1 -1
- package/lib/module/common/icons-svg/eclamation-triangle/index.js +25 -0
- package/lib/module/common/icons-svg/eclamation-triangle/index.js.map +1 -0
- package/lib/module/common/icons-svg/index.js +8 -0
- package/lib/module/common/icons-svg/index.js.map +1 -1
- package/lib/module/common/icons-svg/truck/index.js +2 -2
- package/lib/module/common/icons-svg/truck/index.js.map +1 -1
- package/lib/module/components/box/index.js +10 -8
- package/lib/module/components/box/index.js.map +1 -1
- package/lib/module/components/history-activities-card/index.js +190 -0
- package/lib/module/components/history-activities-card/index.js.map +1 -0
- package/lib/module/components/history-activities-card/interface.js +2 -0
- package/lib/module/components/history-activities-card/interface.js.map +1 -0
- package/lib/module/components/modal-change-activity/index.js +207 -0
- package/lib/module/components/modal-change-activity/index.js.map +1 -0
- package/lib/module/components/selects/select-option/index.js +28 -11
- package/lib/module/components/selects/select-option/index.js.map +1 -1
- package/lib/module/components/selects/select-option/interface.d.js.map +1 -1
- package/lib/module/components/step-indicator/index.js +45 -7
- package/lib/module/components/step-indicator/index.js.map +1 -1
- package/lib/module/helpers/text-utils.js +14 -0
- package/lib/module/helpers/text-utils.js.map +1 -0
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/stories/history-activities-card/history-activities-card.stories.js +97 -0
- package/lib/module/stories/history-activities-card/history-activities-card.stories.js.map +1 -0
- package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js +45 -0
- package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -0
- package/lib/module/utils/get-icon-by-property/index.js +0 -1
- package/lib/module/utils/get-icon-by-property/index.js.map +1 -1
- package/lib/typescript/src/@types/as-base-component.d.ts +2 -0
- package/lib/typescript/src/common/icons-svg/constants/index.d.ts +1 -0
- package/lib/typescript/src/common/icons-svg/eclamation-triangle/index.d.ts +4 -0
- package/lib/typescript/src/components/box/index.d.ts +3 -5
- package/lib/typescript/src/components/history-activities-card/index.d.ts +76 -0
- package/lib/typescript/src/components/history-activities-card/interface.d.ts +120 -0
- package/lib/typescript/src/components/modal-change-activity/index.d.ts +24 -0
- package/lib/typescript/src/helpers/text-utils.d.ts +7 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/stories/history-activities-card/history-activities-card.stories.d.ts +10 -0
- package/lib/typescript/src/stories/modal-change-activity/modal-change-activity.stories.d.ts +9 -0
- package/lib/typescript/src/utils/get-icon-by-property/index.d.ts +2 -1
- package/package.json +11 -8
- package/src/@types/as-base-component.ts +9 -0
- package/src/common/icons-svg/constants/index.ts +1 -0
- package/src/common/icons-svg/eclamation-triangle/index.tsx +46 -0
- package/src/common/icons-svg/index.tsx +5 -1
- package/src/common/icons-svg/truck/index.tsx +2 -2
- package/src/components/box/index.tsx +49 -47
- package/src/components/history-activities-card/index.tsx +217 -0
- package/src/components/history-activities-card/interface.ts +147 -0
- package/src/components/modal-change-activity/index.tsx +202 -0
- package/src/components/selects/select-option/index.tsx +115 -100
- package/src/components/selects/select-option/interface.d.ts +18 -18
- package/src/components/step-indicator/index.tsx +63 -7
- package/src/helpers/text-utils.ts +15 -0
- package/src/index.ts +45 -43
- package/src/stories/history-activities-card/history-activities-card.stories.tsx +107 -0
- package/src/stories/modal-change-activity/modal-change-activity.stories.tsx +52 -0
- package/src/utils/get-icon-by-property/index.tsx +13 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef } from "react";
|
|
5
|
+
import { Image } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import { Box } from "../box";
|
|
9
|
+
import { Typography } from "../typography";
|
|
10
|
+
|
|
11
|
+
//commons/ icons
|
|
12
|
+
import { IMAGES } from "../../common/constants";
|
|
13
|
+
|
|
14
|
+
// typings
|
|
15
|
+
|
|
16
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
17
|
+
|
|
18
|
+
// styles
|
|
19
|
+
import { theme } from "../../styles/theme/theme";
|
|
20
|
+
import { getIconByProperty } from "../../utils/get-icon-by-property";
|
|
21
|
+
|
|
22
|
+
// helpers
|
|
23
|
+
import { truncateText } from "../../helpers/text-utils";
|
|
24
|
+
const HistoryActivitiesCard = /*#__PURE__*/forwardRef((props, ref) => {
|
|
25
|
+
const {
|
|
26
|
+
testID,
|
|
27
|
+
backgroundColor,
|
|
28
|
+
idAtividade,
|
|
29
|
+
name_activitie,
|
|
30
|
+
referencia,
|
|
31
|
+
type_activitie,
|
|
32
|
+
data_start,
|
|
33
|
+
data_end,
|
|
34
|
+
duration,
|
|
35
|
+
avatar
|
|
36
|
+
} = props;
|
|
37
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
38
|
+
ref: ref,
|
|
39
|
+
testID: testID,
|
|
40
|
+
width: "100%",
|
|
41
|
+
backgroundColor: theme.colors.neutral[25],
|
|
42
|
+
borderStyled: {
|
|
43
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
44
|
+
},
|
|
45
|
+
marginStyle: {
|
|
46
|
+
marginBottom: theme.margins["2xs"]
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: 30,
|
|
51
|
+
backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : theme.colors.green[400],
|
|
52
|
+
borderStyled: {
|
|
53
|
+
borderTopLeftRadius: theme.borderWidths.thin_bold,
|
|
54
|
+
borderTopRightRadius: theme.borderWidths.thin_bold,
|
|
55
|
+
borderColor: theme.colors.blue[400]
|
|
56
|
+
},
|
|
57
|
+
flexStyle: {
|
|
58
|
+
justifyContent: "center"
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
61
|
+
text: `ATIVIDADE ${!data_end ? "EM ANDAMENTO" : ""} #${idAtividade}`,
|
|
62
|
+
color: theme.colors.neutral[25],
|
|
63
|
+
size: theme.fontSizes.xs,
|
|
64
|
+
fontFamily: theme.fonts.inter_semi_bold_600,
|
|
65
|
+
fontWeight: "500",
|
|
66
|
+
lineHeight: theme.fontSizes.lg,
|
|
67
|
+
marginLeft: theme.margins["2xs"]
|
|
68
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
69
|
+
width: "100%",
|
|
70
|
+
flexStyle: {
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
justifyContent: "space-between"
|
|
73
|
+
},
|
|
74
|
+
paddingStyle: {
|
|
75
|
+
padding: theme.paddings["2xs"]
|
|
76
|
+
}
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
78
|
+
width: "100%"
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
80
|
+
flexStyle: {
|
|
81
|
+
flexDirection: "row",
|
|
82
|
+
alignItems: "center"
|
|
83
|
+
}
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
85
|
+
style: {
|
|
86
|
+
width: 45,
|
|
87
|
+
height: 45,
|
|
88
|
+
borderRadius: 10,
|
|
89
|
+
marginRight: 10
|
|
90
|
+
},
|
|
91
|
+
source: {
|
|
92
|
+
uri: avatar !== null && avatar !== void 0 ? avatar : IMAGES.IMAGE_ANONIMA
|
|
93
|
+
}
|
|
94
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
95
|
+
width: "100%"
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
97
|
+
width: "84%",
|
|
98
|
+
flexStyle: {
|
|
99
|
+
flexDirection: "row",
|
|
100
|
+
flexWrap: "wrap"
|
|
101
|
+
}
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
103
|
+
style: {
|
|
104
|
+
flexShrink: 1
|
|
105
|
+
},
|
|
106
|
+
text: `Início: `,
|
|
107
|
+
size: theme.fontSizes.xs,
|
|
108
|
+
color: theme.colors.black[10],
|
|
109
|
+
fontFamily: theme.fonts.inter_semi_bold_600
|
|
110
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
111
|
+
text: `${data_start} ás ${data_end !== null && data_end !== void 0 ? data_end : "00/00/0000 00:00"}`,
|
|
112
|
+
size: theme.fontSizes["2xs"],
|
|
113
|
+
color: theme.colors.black[180],
|
|
114
|
+
fontFamily: theme.fonts.inter_regular_400
|
|
115
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
116
|
+
flexStyle: {
|
|
117
|
+
flexDirection: "row",
|
|
118
|
+
justifyContent: "space-between"
|
|
119
|
+
},
|
|
120
|
+
width: "84%"
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
122
|
+
flexStyle: {
|
|
123
|
+
flexDirection: "row"
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
126
|
+
text: `Duração: `,
|
|
127
|
+
size: theme.fontSizes.xs,
|
|
128
|
+
color: theme.colors.black[10],
|
|
129
|
+
fontFamily: theme.fonts.inter_semi_bold_600
|
|
130
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
131
|
+
text: `${duration !== null && duration !== void 0 ? duration : "00:00"}`,
|
|
132
|
+
size: theme.fontSizes["2xs"],
|
|
133
|
+
color: theme.colors.black[180],
|
|
134
|
+
fontFamily: theme.fonts.inter_light_300
|
|
135
|
+
})), getIconByProperty(referencia, backgroundColor)))))), /*#__PURE__*/React.createElement(Box, {
|
|
136
|
+
width: "100%",
|
|
137
|
+
flexStyle: {
|
|
138
|
+
flexDirection: "row",
|
|
139
|
+
justifyContent: "space-between",
|
|
140
|
+
alignItems: "center"
|
|
141
|
+
},
|
|
142
|
+
paddingStyle: {
|
|
143
|
+
padding: theme.paddings["2xs"]
|
|
144
|
+
},
|
|
145
|
+
borderStyled: {
|
|
146
|
+
borderTopWidth: theme.borderWidths.thin_medium,
|
|
147
|
+
borderTopColor: theme.colors.neutral[200]
|
|
148
|
+
}
|
|
149
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
150
|
+
marginStyle: {
|
|
151
|
+
marginRight: 2
|
|
152
|
+
}
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
154
|
+
text: `Atividade:`,
|
|
155
|
+
size: theme.fontSizes.xs,
|
|
156
|
+
color: theme.colors.gray[700],
|
|
157
|
+
fontFamily: theme.fonts.inter_regular_400
|
|
158
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
159
|
+
text: truncateText(name_activitie !== null && name_activitie !== void 0 ? name_activitie : "Sem informação"),
|
|
160
|
+
size: theme.fontSizes.sm,
|
|
161
|
+
color: theme.colors.black[100],
|
|
162
|
+
fontFamily: theme.fonts.inter_semi_bold_600
|
|
163
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
164
|
+
flexStyle: {
|
|
165
|
+
flexDirection: "column",
|
|
166
|
+
alignItems: "flex-end",
|
|
167
|
+
justifyContent: "center"
|
|
168
|
+
}
|
|
169
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
170
|
+
text: `Tipo atividade: `,
|
|
171
|
+
size: theme.fontSizes.xs,
|
|
172
|
+
color: theme.colors.gray[700],
|
|
173
|
+
fontFamily: theme.fonts.inter_regular_400
|
|
174
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
175
|
+
text: `${type_activitie}`,
|
|
176
|
+
size: theme.fontSizes.sm,
|
|
177
|
+
color: theme.colors.black[100],
|
|
178
|
+
fontFamily: theme.fonts.inter_semi_bold_600,
|
|
179
|
+
marginLeft: 4
|
|
180
|
+
}))));
|
|
181
|
+
});
|
|
182
|
+
HistoryActivitiesCard.displayName = "HistoryActivitiesCard";
|
|
183
|
+
const HistoryActivitiesCardComponent = asBaseComponent(HistoryActivitiesCard);
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Componente Box para a interação da ui.
|
|
187
|
+
*/
|
|
188
|
+
export default HistoryActivitiesCardComponent;
|
|
189
|
+
export { HistoryActivitiesCardComponent as HistoryActivitiesCard };
|
|
190
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","Image","Box","Typography","IMAGES","asBaseComponent","theme","getIconByProperty","truncateText","HistoryActivitiesCard","props","ref","testID","backgroundColor","idAtividade","name_activitie","referencia","type_activitie","data_start","data_end","duration","avatar","createElement","width","colors","neutral","borderStyled","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","margins","height","green","borderTopLeftRadius","thin_bold","borderTopRightRadius","borderColor","blue","flexStyle","justifyContent","text","color","size","fontSizes","xs","fontFamily","fonts","inter_semi_bold_600","fontWeight","lineHeight","lg","marginLeft","flexDirection","paddingStyle","padding","paddings","alignItems","style","marginRight","source","uri","IMAGE_ANONIMA","flexWrap","flexShrink","black","inter_regular_400","inter_light_300","borderTopWidth","thin_medium","borderTopColor","gray","sm","displayName","HistoryActivitiesCardComponent"],"sources":["index.tsx"],"sourcesContent":["/**\n * IMPORTS\n */\nimport React, { forwardRef } from \"react\";\nimport { Image } from \"react-native\";\n\n// components\nimport { Box } from \"../box\";\nimport { Typography } from \"../typography\";\n\n//commons/ icons\nimport { IMAGES } from \"../../common/constants\";\n\n// typings\nimport type { ICardActivitiesWeek } from \"./interface\";\nimport { asBaseComponent } from \"../../@types/as-base-component\";\n\n// styles\nimport { theme } from \"../../styles/theme/theme\";\nimport { getIconByProperty } from \"../../utils/get-icon-by-property\";\n\n// helpers\nimport { truncateText } from \"../../helpers/text-utils\";\n\nconst HistoryActivitiesCard = forwardRef<any, ICardActivitiesWeek>(\n (props, ref): React.ReactElement => {\n const {\n testID,\n backgroundColor,\n idAtividade,\n name_activitie,\n referencia,\n type_activitie,\n data_start,\n data_end,\n duration,\n avatar,\n } = props;\n return (\n <Box\n ref={ref}\n testID={testID}\n width={\"100%\"}\n backgroundColor={theme.colors.neutral[25]}\n borderStyled={{\n borderRadius: theme.borderWidths.thick_medium,\n }}\n marginStyle={{\n marginBottom: theme.margins[\"2xs\"],\n }}\n >\n <Box\n width={\"100%\"}\n height={30}\n backgroundColor={backgroundColor ?? theme.colors.green[400]}\n borderStyled={{\n borderTopLeftRadius: theme.borderWidths.thin_bold,\n borderTopRightRadius: theme.borderWidths.thin_bold,\n borderColor: theme.colors.blue[400],\n }}\n flexStyle={{\n justifyContent: \"center\",\n }}\n >\n <Typography\n text={`ATIVIDADE ${!data_end ? \"EM ANDAMENTO\" : \"\"} #${idAtividade}`}\n color={theme.colors.neutral[25]}\n size={theme.fontSizes.xs}\n fontFamily={theme.fonts.inter_semi_bold_600}\n fontWeight={\"500\"}\n lineHeight={theme.fontSizes.lg}\n marginLeft={theme.margins[\"2xs\"]}\n />\n </Box>\n <Box\n width={\"100%\"}\n flexStyle={{\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n }}\n paddingStyle={{\n padding: theme.paddings[\"2xs\"],\n }}\n >\n <Box width={\"100%\"}>\n <Box flexStyle={{ flexDirection: \"row\", alignItems: \"center\" }}>\n <Image\n style={{\n width: 45,\n height: 45,\n borderRadius: 10,\n marginRight: 10,\n }}\n source={{ uri: avatar ?? IMAGES.IMAGE_ANONIMA }}\n />\n\n <Box width={\"100%\"}>\n <Box\n width={\"84%\"}\n flexStyle={{\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n }}\n >\n <Typography\n style={{ flexShrink: 1 }}\n text={`Início: `}\n size={theme.fontSizes.xs}\n color={theme.colors.black[10]}\n fontFamily={theme.fonts.inter_semi_bold_600}\n />\n <Typography\n text={`${data_start} ás ${data_end ?? \"00/00/0000 00:00\"}`}\n size={theme.fontSizes[\"2xs\"]}\n color={theme.colors.black[180]}\n fontFamily={theme.fonts.inter_regular_400}\n />\n </Box>\n\n <Box\n flexStyle={{\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n }}\n width={\"84%\"}\n >\n <Box flexStyle={{ flexDirection: \"row\" }}>\n <Typography\n text={`Duração: `}\n size={theme.fontSizes.xs}\n color={theme.colors.black[10]}\n fontFamily={theme.fonts.inter_semi_bold_600}\n />\n\n <Typography\n text={`${duration ?? \"00:00\"}`}\n size={theme.fontSizes[\"2xs\"]}\n color={theme.colors.black[180]}\n fontFamily={theme.fonts.inter_light_300}\n />\n </Box>\n\n {getIconByProperty(referencia, backgroundColor)}\n </Box>\n </Box>\n </Box>\n </Box>\n </Box>\n\n <Box\n width={\"100%\"}\n flexStyle={{\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n paddingStyle={{\n padding: theme.paddings[\"2xs\"],\n }}\n borderStyled={{\n borderTopWidth: theme.borderWidths.thin_medium,\n borderTopColor: theme.colors.neutral[200],\n }}\n >\n <Box marginStyle={{ marginRight: 2 }}>\n <Typography\n text={`Atividade:`}\n size={theme.fontSizes.xs}\n color={theme.colors.gray[700]}\n fontFamily={theme.fonts.inter_regular_400}\n />\n\n <Typography\n text={truncateText(name_activitie ?? \"Sem informação\")}\n size={theme.fontSizes.sm}\n color={theme.colors.black[100]}\n fontFamily={theme.fonts.inter_semi_bold_600}\n />\n </Box>\n\n <Box\n flexStyle={{\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n text={`Tipo atividade: `}\n size={theme.fontSizes.xs}\n color={theme.colors.gray[700]}\n fontFamily={theme.fonts.inter_regular_400}\n />\n\n <Typography\n text={`${type_activitie}`}\n size={theme.fontSizes.sm}\n color={theme.colors.black[100]}\n fontFamily={theme.fonts.inter_semi_bold_600}\n marginLeft={4}\n />\n </Box>\n </Box>\n </Box>\n );\n }\n);\n\nHistoryActivitiesCard.displayName = \"HistoryActivitiesCard\";\n\nconst HistoryActivitiesCardComponent = asBaseComponent(HistoryActivitiesCard);\n\n/**\n * Componente Box para a interação da ui.\n */\nexport default HistoryActivitiesCardComponent;\nexport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CAACC,mBAAoB;IAC5CI,UAAU,EAAE;EAAE,CACf,CACE,CACF,CACF,CAAC;AAEV,CACF,CAAC;AAED5C,qBAAqB,CAACiE,WAAW,GAAG,uBAAuB;AAE3D,MAAMC,8BAA8B,GAAGtE,eAAe,CAACI,qBAAqB,CAAC;;AAE7E;AACA;AACA;AACA,eAAekE,8BAA8B;AAC7C,SAASA,8BAA8B,IAAIlE,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["interface.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport type React from \"react\";\r\nimport { type DimensionValue, type ViewProps } from \"react-native\";\r\nimport type { PropertyType } from \"../../utils/get-icon-by-property\";\r\n\r\n/**\r\n * INTERFACE\r\n */\r\n\r\ntype ICardActivitiesWeek = ViewProps & {\r\n /**\r\n * props que mostra o nome do usuário\r\n */\r\n name?: string;\r\n\r\n /**\r\n * props que mostra o ciclo do relatório - DIÁRIA OU SEMANAL\r\n */\r\n ciclo?: string;\r\n\r\n /**\r\n * props que mostra a data\r\n */\r\n data_start: string;\r\n data_end?: string | null;\r\n duration: string;\r\n status?: string;\r\n name_activitie: string;\r\n referencia: PropertyType;\r\n type_activitie: string;\r\n avatar?: string;\r\n idAtividade: number;\r\n\r\n children?: React.ReactNode;\r\n\r\n /**\r\n * TestID para testes automático e identificação\r\n */\r\n testID?: string;\r\n\r\n /**\r\n * A propriedade CSS abreviada border define a borda de um elemento. Ele define os valores de largura da borda, estilo da borda e cor da borda.\r\n */\r\n borderStyled?: {\r\n borderStyle?: \"solid\" | \"dotted\" | \"dashed\";\r\n\r\n borderRadius?: number | DimensionValue;\r\n borderTopRightRadius?: number | DimensionValue;\r\n borderTopLeftRadius?: number | DimensionValue;\r\n borderBottomRightRadius?: number | DimensionValue;\r\n borderBottomLeftRadius?: number | DimensionValue;\r\n\r\n borderWidth?: number | DimensionValue;\r\n borderLeftWidth?: number | DimensionValue;\r\n borderRightWidth?: number | DimensionValue;\r\n borderTopWidth?: number | DimensionValue;\r\n borderBottomWidth?: number | DimensionValue;\r\n\r\n borderColor?: string;\r\n borderBottomColor?: string;\r\n borderLeftColor?: string;\r\n borderRightColor?: string;\r\n borderTopColor?: string;\r\n };\r\n\r\n /**\r\n * Propriedades que define a orientação do button que é usada para representar uma página. Na maioria das vezes, esse valores corresponde ao posicionamento alvo da página impressa, se aplicável.\r\n */\r\n flexStyle?: {\r\n alignItems?: \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\r\n alignSelf?: \"auto\" | \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\r\n flex?: string | number;\r\n flexDirection?: \"column\" | \"column-reverse\" | \"row\" | \"row-reverse\";\r\n flexWrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\r\n textAlign?: \"auto\" | \"center\" | \"left\" | \"right\" | \"justify\";\r\n justifyContent?:\r\n | \"flex-start\"\r\n | \"flex-end\"\r\n | \"center\"\r\n | \"space-between\"\r\n | \"space-around\"\r\n | \"space-evenly\";\r\n };\r\n\r\n /**\r\n * A propriedade margin do CSS define a área de margem nos quatro lados do elemento. É uma abreviação que define todas as margens individuais de uma só vez: margin-top, margin-right (en-US), margin-bottom, e margin-left (en-US).\r\n */\r\n marginStyle?: {\r\n margin?: number | DimensionValue;\r\n marginLeft?: number | DimensionValue;\r\n marginRight?: number | DimensionValue;\r\n marginTop?: number | DimensionValue;\r\n marginBottom?: number | DimensionValue;\r\n };\r\n\r\n /**\r\n * A propriedade padding define uma a distância entre o conteúdo de um elemento e suas bordas. É um atalho que evita definir uma distância para cada lado separadamente (padding-top, padding-right, padding-bottom, padding-left).\r\n */\r\n paddingStyle?: {\r\n padding?: number | DimensionValue;\r\n paddingLeft?: number | DimensionValue;\r\n paddingRight?: number | DimensionValue;\r\n paddingTop?: number | DimensionValue;\r\n paddingBottom?: number | DimensionValue;\r\n };\r\n\r\n /**\r\n * A propriedade CSS height define a altura de um elemento. A altura de um elemento é a distância do topo da borda superior do elemento ao fundo da borda inferior.\r\n */\r\n height?: number | DimensionValue;\r\n\r\n /**\r\n * A propriedade CSS width define a largura de um elemento. A largura de um elemento é a distância do topo da borda esquerda do elemento ao fundo da borda direita.\r\n */\r\n width?: number | DimensionValue;\r\n\r\n /**\r\n * O fundo abreviado CSS Propriedade define todas as propriedades do estilo de fundo de uma só vez, como cor, imagem, origem e tamanho ou método de repetição. As propriedades dos componentes não definidas no fundo da declaração de valor da propriedade abreviada são definidas como seus valores padrão..\r\n * A Propriedade Background está sendo utilizada para definir a cor de fundo do cabeçalho do card e do ícone check.\r\n */\r\n backgroundColor?: string;\r\n\r\n /**\r\n * Propriedade texto que sera renderizado pro usuário final\r\n */\r\n text?: string;\r\n\r\n /**\r\n * A propriedade CSS color define o valor da cor de primeiro plano do texto e das decorações de texto de um elemento e define o valor currentcolor. currentcolor pode ser usado como um valor indireto em outras propriedades e é o padrão para outras propriedades de cores, como border-color.\r\n */\r\n color?: {\r\n colorSvg?: string;\r\n colorText?: string;\r\n colorTextBold?: string;\r\n colorTextData?: string;\r\n };\r\n\r\n // Cor do ícone CHECK\r\n iconColor?: string;\r\n};\r\n\r\n/**\r\n * EXPORT\r\n */\r\nexport type { ICardActivitiesWeek };\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
// libs RN
|
|
6
|
+
import { Modal, View } from "react-native";
|
|
7
|
+
|
|
8
|
+
// componentes internos
|
|
9
|
+
import { Box } from "../box";
|
|
10
|
+
import { Typography } from "../typography";
|
|
11
|
+
import { SelectOption } from "../selects/select-option";
|
|
12
|
+
import { Button } from "../button";
|
|
13
|
+
|
|
14
|
+
// styles / theme
|
|
15
|
+
import { theme } from "../../styles/theme/theme";
|
|
16
|
+
|
|
17
|
+
// assets / icons
|
|
18
|
+
import { Icons } from "../../common/icons-svg";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* TYPES
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* CONSTANTS
|
|
26
|
+
*/
|
|
27
|
+
const options = [{
|
|
28
|
+
label: "Selecione atividade",
|
|
29
|
+
value: "none",
|
|
30
|
+
key: 0
|
|
31
|
+
}, {
|
|
32
|
+
label: "Descanso",
|
|
33
|
+
value: "descanso",
|
|
34
|
+
key: 5
|
|
35
|
+
}, {
|
|
36
|
+
label: "Repouso Noturno",
|
|
37
|
+
value: "repouso_noturno",
|
|
38
|
+
key: 6
|
|
39
|
+
}, {
|
|
40
|
+
label: "Refeição",
|
|
41
|
+
value: "refeição",
|
|
42
|
+
key: 7
|
|
43
|
+
}, {
|
|
44
|
+
label: "Repouso Semanal",
|
|
45
|
+
value: "repouso_semanal",
|
|
46
|
+
key: 9
|
|
47
|
+
}];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* COMPONENT
|
|
51
|
+
*/
|
|
52
|
+
export const ModalChangeActivity = ({
|
|
53
|
+
visible,
|
|
54
|
+
onClose,
|
|
55
|
+
modalConfirm,
|
|
56
|
+
descricao
|
|
57
|
+
}) => {
|
|
58
|
+
const [isLoading] = React.useState(false);
|
|
59
|
+
const initial = (descricao !== null && descricao !== void 0 ? descricao : "").toLowerCase().replace(/\s+/g, "_");
|
|
60
|
+
const [selectedOption, setSelectedOption] = React.useState(initial || "none");
|
|
61
|
+
const handleConfirm = () => {
|
|
62
|
+
const selected = options.find(opt => opt.value === selectedOption);
|
|
63
|
+
if (selected && selected.value !== "none") {
|
|
64
|
+
modalConfirm({
|
|
65
|
+
label: selected.label,
|
|
66
|
+
value: selected.value,
|
|
67
|
+
key: selected.key
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
onClose();
|
|
71
|
+
};
|
|
72
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
73
|
+
animationType: "fade",
|
|
74
|
+
transparent: true,
|
|
75
|
+
visible: visible
|
|
76
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
77
|
+
style: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
backgroundColor: "rgba(0,0,0,0.6)"
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
84
|
+
width: 346,
|
|
85
|
+
backgroundColor: theme.colors.orange[500],
|
|
86
|
+
borderStyled: {
|
|
87
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
88
|
+
},
|
|
89
|
+
paddingStyle: {
|
|
90
|
+
paddingLeft: theme.paddings["2xs"],
|
|
91
|
+
paddingRight: theme.paddings["2xs"],
|
|
92
|
+
paddingTop: theme.paddings.sm,
|
|
93
|
+
paddingBottom: theme.paddings.sm
|
|
94
|
+
}
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
96
|
+
marginStyle: {
|
|
97
|
+
marginBottom: theme.margins["2xs"],
|
|
98
|
+
marginLeft: theme.margins["1xs"]
|
|
99
|
+
},
|
|
100
|
+
flexStyle: {
|
|
101
|
+
flexDirection: "row",
|
|
102
|
+
alignItems: "center"
|
|
103
|
+
}
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
105
|
+
icon: "EXCLAMATION_TRIANGLE",
|
|
106
|
+
color: theme.colors.black[10],
|
|
107
|
+
background: theme.colors.yellow[50],
|
|
108
|
+
size: 22
|
|
109
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
110
|
+
text: "Alterar Atividade",
|
|
111
|
+
color: "#fff",
|
|
112
|
+
marginLeft: theme.margins["2xs"],
|
|
113
|
+
fontFamily: theme.fonts.inter_bold_700,
|
|
114
|
+
size: theme.fontSizes.md
|
|
115
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
116
|
+
backgroundColor: theme.colors.neutral[300],
|
|
117
|
+
paddingStyle: {
|
|
118
|
+
padding: theme.paddings.xs
|
|
119
|
+
},
|
|
120
|
+
borderStyled: {
|
|
121
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
122
|
+
}
|
|
123
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
124
|
+
flexStyle: {
|
|
125
|
+
flexDirection: "row",
|
|
126
|
+
justifyContent: "flex-start"
|
|
127
|
+
},
|
|
128
|
+
width: "90%"
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
130
|
+
text: `Deseja realmente alterar sua atividade de ${descricao || "atividade atual"}?`,
|
|
131
|
+
color: theme.colors.black[25],
|
|
132
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
133
|
+
size: theme.fontSizes.xs,
|
|
134
|
+
style: {
|
|
135
|
+
flexWrap: "wrap",
|
|
136
|
+
maxWidth: "100%"
|
|
137
|
+
}
|
|
138
|
+
})), /*#__PURE__*/React.createElement(SelectOption, {
|
|
139
|
+
titleLabel: "Selecione atividade",
|
|
140
|
+
sizeTitleLabel: theme.fontSizes.xs,
|
|
141
|
+
dataOption: options,
|
|
142
|
+
handleSelectDown: opt => {
|
|
143
|
+
const option = options.find(o => o.label === opt || o.value === opt);
|
|
144
|
+
if (option) setSelectedOption(option.value);
|
|
145
|
+
},
|
|
146
|
+
backgroundColor: theme.colors.neutral[300]
|
|
147
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
148
|
+
marginStyle: {
|
|
149
|
+
marginTop: theme.margins["1xs"]
|
|
150
|
+
},
|
|
151
|
+
flexStyle: {
|
|
152
|
+
flexDirection: "row",
|
|
153
|
+
justifyContent: "space-between"
|
|
154
|
+
}
|
|
155
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
156
|
+
title: "CANCELAR",
|
|
157
|
+
onPress: onClose,
|
|
158
|
+
width: "48%",
|
|
159
|
+
height: 36,
|
|
160
|
+
isLoading: isLoading,
|
|
161
|
+
disabled: isLoading,
|
|
162
|
+
backgroundColor: theme.colors.neutral[300],
|
|
163
|
+
buttonTextStyle: {
|
|
164
|
+
color: theme.colors.blue[100],
|
|
165
|
+
fontFamily: "Inter-Medium",
|
|
166
|
+
fontSize: theme.fontSizes.xs,
|
|
167
|
+
fontWeight: "500"
|
|
168
|
+
},
|
|
169
|
+
flexStyle: {
|
|
170
|
+
flexDirection: "row",
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
justifyContent: "center",
|
|
173
|
+
textAlign: "center"
|
|
174
|
+
},
|
|
175
|
+
borderStyled: {
|
|
176
|
+
borderWidth: theme.borderWidths.thin,
|
|
177
|
+
borderColor: theme.colors.blue[100],
|
|
178
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
179
|
+
}
|
|
180
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
181
|
+
title: "CONFIRMAR",
|
|
182
|
+
onPress: handleConfirm,
|
|
183
|
+
width: "48%",
|
|
184
|
+
height: 36,
|
|
185
|
+
isLoading: isLoading,
|
|
186
|
+
disabled: isLoading,
|
|
187
|
+
backgroundColor: theme.colors.blue[100],
|
|
188
|
+
buttonTextStyle: {
|
|
189
|
+
color: "#fff",
|
|
190
|
+
fontFamily: "Inter-Medium",
|
|
191
|
+
fontSize: theme.fontSizes.xs,
|
|
192
|
+
fontWeight: "500"
|
|
193
|
+
},
|
|
194
|
+
flexStyle: {
|
|
195
|
+
flexDirection: "row",
|
|
196
|
+
alignItems: "center",
|
|
197
|
+
justifyContent: "center",
|
|
198
|
+
textAlign: "center"
|
|
199
|
+
},
|
|
200
|
+
borderStyled: {
|
|
201
|
+
borderWidth: theme.borderWidths.thin,
|
|
202
|
+
borderColor: theme.colors.blue[100],
|
|
203
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
204
|
+
}
|
|
205
|
+
}))))));
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Modal","View","Box","Typography","SelectOption","Button","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":["/**\r\n * IMPORTS\r\n */\r\nimport React from \"react\";\r\n// libs RN\r\nimport { Modal, View } from \"react-native\";\r\n\r\n// componentes internos\r\nimport { Box } from \"../box\";\r\nimport { Typography } from \"../typography\";\r\nimport { SelectOption } from \"../selects/select-option\";\r\nimport { Button } from \"../button\";\r\n\r\n// styles / theme\r\nimport { theme } from \"../../styles/theme/theme\";\r\n\r\n// assets / icons\r\nimport { Icons } from \"../../common/icons-svg\";\r\n\r\n/**\r\n * TYPES\r\n */\r\ninterface IModalChangeActivityProps {\r\n visible: boolean;\r\n onClose: () => void;\r\n modalConfirm: (newData: { label: string; value: string; key: number }) => void;\r\n dataRegistro: string;\r\n descricao: string;\r\n imagemUrl?: string;\r\n}\r\n\r\n/**\r\n * CONSTANTS\r\n */\r\nconst options = [\r\n { label: \"Selecione atividade\", value: \"none\", key: 0 },\r\n { label: \"Descanso\", value: \"descanso\", key: 5 },\r\n { label: \"Repouso Noturno\", value: \"repouso_noturno\", key: 6 },\r\n { label: \"Refeição\", value: \"refeição\", key: 7 },\r\n { label: \"Repouso Semanal\", value: \"repouso_semanal\", key: 9 },\r\n];\r\n\r\n/**\r\n * COMPONENT\r\n */\r\nexport const ModalChangeActivity: React.FC<IModalChangeActivityProps> = ({\r\n visible,\r\n onClose,\r\n modalConfirm,\r\n descricao,\r\n}) => {\r\n const [isLoading] = React.useState(false);\r\n\r\n const initial = (descricao ?? \"\").toLowerCase().replace(/\\s+/g, \"_\");\r\n const [selectedOption, setSelectedOption] = React.useState(initial || \"none\");\r\n\r\n const handleConfirm = () => {\r\n const selected = options.find((opt) => opt.value === selectedOption);\r\n if (selected && selected.value !== \"none\") {\r\n modalConfirm({\r\n label: selected.label,\r\n value: selected.value,\r\n key: selected.key,\r\n });\r\n }\r\n onClose();\r\n };\r\n\r\n return (\r\n <Modal 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={346}\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: theme.margins[\"2xs\"], marginLeft: theme.margins[\"1xs\"] }}\r\n flexStyle={{ flexDirection: \"row\", alignItems: \"center\" }}\r\n >\r\n <Icons\r\n icon=\"EXCLAMATION_TRIANGLE\"\r\n color={theme.colors.black[10]}\r\n background={theme.colors.yellow[50]}\r\n size={22}\r\n />\r\n <Typography\r\n text=\"Alterar Atividade\"\r\n color=\"#fff\"\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={{ padding: theme.paddings.xs }}\r\n borderStyled={{ borderRadius: theme.borderWidths.thick_medium }}\r\n >\r\n <Box\r\n flexStyle={{ flexDirection: \"row\", justifyContent: \"flex-start\" }}\r\n width={\"90%\"}\r\n >\r\n <Typography\r\n text={`Deseja realmente alterar sua atividade de ${descricao || \"atividade atual\"}?`}\r\n color={theme.colors.black[25]}\r\n fontFamily={theme.fonts.inter_medium_500}\r\n size={theme.fontSizes.xs}\r\n style={{ flexWrap: \"wrap\", maxWidth: \"100%\" }}\r\n />\r\n </Box>\r\n\r\n <SelectOption\r\n titleLabel=\"Selecione atividade\"\r\n sizeTitleLabel={theme.fontSizes.xs}\r\n dataOption={options}\r\n handleSelectDown={(opt) => {\r\n const option = options.find((o) => o.label === opt || o.value === opt);\r\n if (option) setSelectedOption(option.value);\r\n }}\r\n backgroundColor={theme.colors.neutral[300]}\r\n />\r\n\r\n <Box\r\n marginStyle={{ marginTop: theme.margins[\"1xs\"]}}\r\n flexStyle={{ flexDirection: \"row\", justifyContent: \"space-between\" }}\r\n >\r\n <Button\r\n title=\"CANCELAR\"\r\n onPress={onClose}\r\n width={\"48%\"}\r\n height={36}\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={handleConfirm}\r\n width={\"48%\"}\r\n height={36}\r\n isLoading={isLoading}\r\n disabled={isLoading}\r\n backgroundColor={theme.colors.blue[100]}\r\n buttonTextStyle={{\r\n color: \"#fff\",\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB;AACA,SAASC,KAAK,EAAEC,IAAI,QAAQ,cAAc;;AAE1C;AACA,SAASC,GAAG,QAAQ,QAAQ;AAC5B,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,MAAM,QAAQ,WAAW;;AAElC;AACA,SAASC,KAAK,QAAQ,0BAA0B;;AAEhD;AACA,SAASC,KAAK,QAAQ,wBAAwB;;AAE9C;AACA;AACA;;AAUA;AACA;AACA;AACA,MAAMC,OAAO,GAAG,CACd;EAAEC,KAAK,EAAE,qBAAqB;EAAEC,KAAK,EAAE,MAAM;EAAEC,GAAG,EAAE;AAAE,CAAC,EACvD;EAAEF,KAAK,EAAE,UAAU;EAAEC,KAAK,EAAE,UAAU;EAAEC,GAAG,EAAE;AAAE,CAAC,EAChD;EAAEF,KAAK,EAAE,iBAAiB;EAAEC,KAAK,EAAE,iBAAiB;EAAEC,GAAG,EAAE;AAAE,CAAC,EAC9D;EAAEF,KAAK,EAAE,UAAU;EAAEC,KAAK,EAAE,UAAU;EAAEC,GAAG,EAAE;AAAE,CAAC,EAChD;EAAEF,KAAK,EAAE,iBAAiB;EAAEC,KAAK,EAAE,iBAAiB;EAAEC,GAAG,EAAE;AAAE,CAAC,CAC/D;;AAED;AACA;AACA;AACA,OAAO,MAAMC,mBAAwD,GAAGA,CAAC;EACvEC,OAAO;EACPC,OAAO;EACPC,YAAY;EACZC;AACF,CAAC,KA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CAAE;IACxCD,eAAe,EAAE;MACf5B,KAAK,EAAE,MAAM;MACbM,UAAU,EAAE,cAAc;MAC1BwB,QAAQ,EAAEjF,KAAK,CAAC4D,SAAS,CAACI,EAAE;MAC5BkB,UAAU,EAAE;IACd,CAAE;IACFlC,SAAS,EAAE;MACTC,aAAa,EAAE,KAAK;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":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { useState } from "react";
|
|
@@ -12,15 +12,16 @@ import { styles } from "./styles";
|
|
|
12
12
|
import { Icons } from "../../../common/icons-svg";
|
|
13
13
|
import { theme } from "../../../styles/theme/theme";
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Componente SelectOption para a interação da ui.
|
|
15
|
+
/**
|
|
16
|
+
* Componente SelectOption para a interação da ui.
|
|
17
17
|
*/
|
|
18
18
|
const SelectOption = ({
|
|
19
19
|
dataOption,
|
|
20
20
|
handleSelectDown,
|
|
21
21
|
titleLabel,
|
|
22
22
|
sizeTitleLabel,
|
|
23
|
-
colortitleLabel
|
|
23
|
+
colortitleLabel,
|
|
24
|
+
backgroundColor
|
|
24
25
|
}) => {
|
|
25
26
|
var _dataOption$, _dataOption$find;
|
|
26
27
|
const [selectedValue, setSelectedValue] = useState(((_dataOption$ = dataOption[0]) === null || _dataOption$ === void 0 ? void 0 : _dataOption$.value) || "");
|
|
@@ -35,7 +36,8 @@ const SelectOption = ({
|
|
|
35
36
|
handleSelectDown,
|
|
36
37
|
titleLabel,
|
|
37
38
|
sizeTitleLabel,
|
|
38
|
-
colortitleLabel
|
|
39
|
+
colortitleLabel,
|
|
40
|
+
backgroundColor
|
|
39
41
|
};
|
|
40
42
|
return /*#__PURE__*/React.createElement(View, {
|
|
41
43
|
style: styles(styleProps).container
|
|
@@ -43,7 +45,9 @@ const SelectOption = ({
|
|
|
43
45
|
style: styles(styleProps).label
|
|
44
46
|
}, `${titleLabel !== null && titleLabel !== void 0 ? titleLabel : "Selecione uma opção"}`, ":"), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
45
47
|
testID: "select-box",
|
|
46
|
-
style: styles(styleProps).selectBox,
|
|
48
|
+
style: [styles(styleProps).selectBox, backgroundColor && {
|
|
49
|
+
backgroundColor
|
|
50
|
+
}],
|
|
47
51
|
onPress: () => setModalVisible(true)
|
|
48
52
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
49
53
|
style: styles(styleProps).selectedText
|
|
@@ -59,7 +63,13 @@ const SelectOption = ({
|
|
|
59
63
|
}, /*#__PURE__*/React.createElement(View, {
|
|
60
64
|
style: styles(styleProps).modalOverlay
|
|
61
65
|
}, /*#__PURE__*/React.createElement(View, {
|
|
62
|
-
style:
|
|
66
|
+
style: {
|
|
67
|
+
width: "90%",
|
|
68
|
+
backgroundColor: "#fff",
|
|
69
|
+
borderRadius: 8,
|
|
70
|
+
padding: 16,
|
|
71
|
+
maxHeight: "80%"
|
|
72
|
+
}
|
|
63
73
|
}, /*#__PURE__*/React.createElement(View, {
|
|
64
74
|
style: {
|
|
65
75
|
width: "100%",
|
|
@@ -78,7 +88,14 @@ const SelectOption = ({
|
|
|
78
88
|
renderItem: ({
|
|
79
89
|
item
|
|
80
90
|
}) => /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
81
|
-
style:
|
|
91
|
+
style: {
|
|
92
|
+
width: "100%",
|
|
93
|
+
paddingVertical: 12,
|
|
94
|
+
paddingHorizontal: 8,
|
|
95
|
+
alignItems: "flex-start",
|
|
96
|
+
borderBottomWidth: 1,
|
|
97
|
+
borderColor: "#eee"
|
|
98
|
+
},
|
|
82
99
|
onPress: () => handleSelect(item.value)
|
|
83
100
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
84
101
|
style: styles(styleProps).optionText
|
|
@@ -86,8 +103,8 @@ const SelectOption = ({
|
|
|
86
103
|
})))));
|
|
87
104
|
};
|
|
88
105
|
|
|
89
|
-
/**
|
|
90
|
-
* EXPORTS
|
|
106
|
+
/**
|
|
107
|
+
* EXPORTS
|
|
91
108
|
*/
|
|
92
109
|
export { SelectOption };
|
|
93
110
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","Text","TouchableOpacity","Modal","FlatList","styles","Icons","theme","SelectOption","dataOption","handleSelectDown","titleLabel","sizeTitleLabel","colortitleLabel","_dataOption$","_dataOption$find","selectedValue","setSelectedValue","value","modalVisible","setModalVisible","handleSelect","styleProps","createElement","style","container","label","testID","selectBox","onPress","selectedText","find","item","size","fontSizes","color","colors","blue","icon","visible","transparent","animationType","modalOverlay","
|
|
1
|
+
{"version":3,"names":["React","useState","View","Text","TouchableOpacity","Modal","FlatList","styles","Icons","theme","SelectOption","dataOption","handleSelectDown","titleLabel","sizeTitleLabel","colortitleLabel","backgroundColor","_dataOption$","_dataOption$find","selectedValue","setSelectedValue","value","modalVisible","setModalVisible","handleSelect","styleProps","createElement","style","container","label","testID","selectBox","onPress","selectedText","find","item","size","fontSizes","color","colors","blue","icon","visible","transparent","animationType","modalOverlay","width","borderRadius","padding","maxHeight","alignItems","data","keyExtractor","renderItem","paddingVertical","paddingHorizontal","borderBottomWidth","borderColor","optionText"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React from \"react\";\r\nimport { useState } from \"react\";\r\nimport { View, Text, TouchableOpacity, Modal, FlatList } from \"react-native\";\r\n\r\n// typings\r\nimport { ISelectDropDownProps } from \"./interface\";\r\n\r\n// styles\r\nimport { styles } from \"./styles\";\r\nimport { Icons } from \"../../../common/icons-svg\";\r\nimport { theme } from \"../../../styles/theme/theme\";\r\n\r\n/**\r\n * Componente SelectOption para a interação da ui.\r\n */\r\nconst SelectOption: React.FC<ISelectDropDownProps> = ({\r\n dataOption,\r\n handleSelectDown,\r\n titleLabel,\r\n sizeTitleLabel,\r\n colortitleLabel,\r\n backgroundColor,\r\n}: ISelectDropDownProps) => {\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\r\n return (\r\n <View 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, backgroundColor && { backgroundColor },]}\r\n onPress={() => setModalVisible(true)}\r\n >\r\n <Text style={styles(styleProps).selectedText}>\r\n {dataOption.find((item) => item.value === selectedValue)?.label}\r\n </Text>\r\n\r\n <Icons\r\n size={theme.fontSizes[\"md\"]}\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={{\r\n width: \"90%\",\r\n backgroundColor: \"#fff\",\r\n borderRadius: 8,\r\n padding: 16,\r\n maxHeight: \"80%\",\r\n }}>\r\n <View style={{ width: \"100%\", alignItems: \"flex-end\" }}>\r\n <TouchableOpacity testID=\"close-icon\" onPress={() => setModalVisible(false)}>\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={{\r\n width: \"100%\",\r\n paddingVertical: 12,\r\n paddingHorizontal: 8,\r\n alignItems: \"flex-start\",\r\n borderBottomWidth: 1,\r\n borderColor: \"#eee\",\r\n }}\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 * EXPORTS\r\n */\r\nexport { SelectOption };\r\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,cAAc;;AAE5E;;AAGA;AACA,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,KAAK,QAAQ,2BAA2B;AACjD,SAASC,KAAK,QAAQ,6BAA6B;;AAEnD;AACA;AACA;AACA,MAAMC,YAA4C,GAAGA,CAAC;EACpDC,UAAU;EACVC,gBAAgB;EAChBC,UAAU;EACVC,cAAc;EACdC,eAAe;EACfC;AACoB,CAAC,KAAK;EAAA,IAAAC,YAAA,EAAAC,gBAAA;EAC1B,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGnB,QAAQ,CAAC,EAAA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,IAAKA,IAAI,CAACd,KAAM;IACnCgC,UAAU,EAAEA,CAAC;MAAElB;IAAK,CAAC,kBACnBnC,KAAA,CAAA0B,aAAA,CAACtB,gBAAgB;MACfuB,KAAK,EAAE;QACLmB,KAAK,EAAE,MAAM;QACbQ,eAAe,EAAE,EAAE;QACnBC,iBAAiB,EAAE,CAAC;QACpBL,UAAU,EAAE,YAAY;QACxBM,iBAAiB,EAAE,CAAC;QACpBC,WAAW,EAAE;MACf,CAAE;MACFzB,OAAO,EAAEA,CAAA,KAAMR,YAAY,CAACW,IAAI,CAACd,KAAK;IAAE,gBAExCrB,KAAA,CAAA0B,aAAA,CAACvB,IAAI;MAACwB,KAAK,EAAEpB,MAAM,CAACkB,UAAU,CAAC,CAACiC;IAAW,GAAEvB,IAAI,CAACN,KAAY,CAC9C;EAClB,CACH,CACG,CACF,CACD,CACH,CAAC;AAEX,CAAC;;AAED;AACA;AACA;AACA,SAASnB,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\n * IMPORTS\n */\ntype ISelectDropDownProps = {\n dataOption: any[];\n titleLabel: string;\n sizeTitleLabel?: number;\n colortitleLabel?: string;\n\n /**retorna o valor selecionado */\n // eslint-disable-next-line no-unused-vars\n handleSelectDown: (value: string) => void;\n};\n\n/**\n * EXPORTS\n */\nexport { ISelectDropDownProps };\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\ntype ISelectDropDownProps = {\r\n dataOption: any[];\r\n titleLabel: string;\r\n sizeTitleLabel?: number;\r\n colortitleLabel?: string;\r\n backgroundColor?: string;\r\n /**retorna o valor selecionado */\r\n // eslint-disable-next-line no-unused-vars\r\n handleSelectDown: (value: string) => void;\r\n};\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { ISelectDropDownProps };\r\n"],"mappings":"","ignoreList":[]}
|