vpt-sebraeds 0.0.1
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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/components/Accordion/index.d.ts +9 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/Accordion/index.js +123 -0
- package/dist/components/AccordionAvatar/index.d.ts +8 -0
- package/dist/components/AccordionAvatar/index.d.ts.map +1 -0
- package/dist/components/AccordionAvatar/index.js +63 -0
- package/dist/components/AdBanner/index.d.ts +12 -0
- package/dist/components/AdBanner/index.d.ts.map +1 -0
- package/dist/components/AdBanner/index.js +65 -0
- package/dist/components/Avatar/index.d.ts +9 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Avatar/index.js +69 -0
- package/dist/components/BottomSheet/BottomSheetNomeEmpresa.d.ts +7 -0
- package/dist/components/BottomSheet/BottomSheetNomeEmpresa.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheetNomeEmpresa.js +101 -0
- package/dist/components/BottomSheet/Components/ActionButtons.d.ts +9 -0
- package/dist/components/BottomSheet/Components/ActionButtons.d.ts.map +1 -0
- package/dist/components/BottomSheet/Components/ActionButtons.js +73 -0
- package/dist/components/BottomSheet/Components/ListaDeEstados.d.ts +9 -0
- package/dist/components/BottomSheet/Components/ListaDeEstados.d.ts.map +1 -0
- package/dist/components/BottomSheet/Components/ListaDeEstados.js +269 -0
- package/dist/components/BottomSheet/index.d.ts +12 -0
- package/dist/components/BottomSheet/index.d.ts.map +1 -0
- package/dist/components/BottomSheet/index.js +226 -0
- package/dist/components/Breadcrumb/index.d.ts +23 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.js +59 -0
- package/dist/components/Button/index.d.ts +25 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +424 -0
- package/dist/components/CardNumber/index.d.ts +37 -0
- package/dist/components/CardNumber/index.d.ts.map +1 -0
- package/dist/components/CardNumber/index.js +108 -0
- package/dist/components/Checkbox/index.d.ts +35 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Checkbox/index.js +93 -0
- package/dist/components/CommitmentCard/index.d.ts +27 -0
- package/dist/components/CommitmentCard/index.d.ts.map +1 -0
- package/dist/components/CommitmentCard/index.js +188 -0
- package/dist/components/ContentBlock/ContentBlock.d.ts +12 -0
- package/dist/components/ContentBlock/ContentBlock.d.ts.map +1 -0
- package/dist/components/ContentBlock/ContentBlock.js +29 -0
- package/dist/components/ContentCard/index.d.ts +28 -0
- package/dist/components/ContentCard/index.d.ts.map +1 -0
- package/dist/components/ContentCard/index.js +192 -0
- package/dist/components/ContentRelatedCard/index.d.ts +27 -0
- package/dist/components/ContentRelatedCard/index.d.ts.map +1 -0
- package/dist/components/ContentRelatedCard/index.js +56 -0
- package/dist/components/ContentSlot/index.d.ts +18 -0
- package/dist/components/ContentSlot/index.d.ts.map +1 -0
- package/dist/components/ContentSlot/index.js +140 -0
- package/dist/components/CopyButton/index.d.ts +9 -0
- package/dist/components/CopyButton/index.d.ts.map +1 -0
- package/dist/components/CopyButton/index.js +159 -0
- package/dist/components/Datepicker/MonthSelector.d.ts +4 -0
- package/dist/components/Datepicker/MonthSelector.d.ts.map +1 -0
- package/dist/components/Datepicker/MonthSelector.js +256 -0
- package/dist/components/Datepicker/TimeSelector.d.ts +4 -0
- package/dist/components/Datepicker/TimeSelector.d.ts.map +1 -0
- package/dist/components/Datepicker/TimeSelector.js +193 -0
- package/dist/components/Datepicker/index.d.ts +6 -0
- package/dist/components/Datepicker/index.d.ts.map +1 -0
- package/dist/components/Datepicker/index.js +387 -0
- package/dist/components/DonutChart/index.d.ts +12 -0
- package/dist/components/DonutChart/index.d.ts.map +1 -0
- package/dist/components/DonutChart/index.js +153 -0
- package/dist/components/Dropdown/DropdownCommitments.d.ts +1 -0
- package/dist/components/Dropdown/DropdownCommitments.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownCommitments.js +1 -0
- package/dist/components/Dropdown/index.d.ts +12 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -0
- package/dist/components/Dropdown/index.js +287 -0
- package/dist/components/DropdownCommitments/index.d.ts +7 -0
- package/dist/components/DropdownCommitments/index.d.ts.map +1 -0
- package/dist/components/DropdownCommitments/index.js +119 -0
- package/dist/components/EmptySlot/index.d.ts +14 -0
- package/dist/components/EmptySlot/index.d.ts.map +1 -0
- package/dist/components/EmptySlot/index.js +117 -0
- package/dist/components/FilterTag/index.d.ts +7 -0
- package/dist/components/FilterTag/index.d.ts.map +1 -0
- package/dist/components/FilterTag/index.js +59 -0
- package/dist/components/FilterableMultiSelect/index.d.ts +11 -0
- package/dist/components/FilterableMultiSelect/index.d.ts.map +1 -0
- package/dist/components/FilterableMultiSelect/index.js +136 -0
- package/dist/components/GettingStarted.d.ts +13 -0
- package/dist/components/GettingStarted.d.ts.map +1 -0
- package/dist/components/GettingStarted.js +25 -0
- package/dist/components/Header/components/Context.d.ts +8 -0
- package/dist/components/Header/components/Context.d.ts.map +1 -0
- package/dist/components/Header/components/Context.js +30 -0
- package/dist/components/Header/components/Information.d.ts +7 -0
- package/dist/components/Header/components/Information.d.ts.map +1 -0
- package/dist/components/Header/components/Information.js +54 -0
- package/dist/components/Header/components/Shortcut.d.ts +6 -0
- package/dist/components/Header/components/Shortcut.d.ts.map +1 -0
- package/dist/components/Header/components/Shortcut.js +24 -0
- package/dist/components/Header/components/SwitchAccount.d.ts +8 -0
- package/dist/components/Header/components/SwitchAccount.d.ts.map +1 -0
- package/dist/components/Header/components/SwitchAccount.js +203 -0
- package/dist/components/Header/components/Variants.d.ts +10 -0
- package/dist/components/Header/components/Variants.d.ts.map +1 -0
- package/dist/components/Header/components/Variants.js +129 -0
- package/dist/components/Header/components/index.d.ts +21 -0
- package/dist/components/Header/components/index.d.ts.map +1 -0
- package/dist/components/Header/components/index.js +10 -0
- package/dist/components/Header/index.d.ts +35 -0
- package/dist/components/Header/index.d.ts.map +1 -0
- package/dist/components/Header/index.js +179 -0
- package/dist/components/Icon/iconEnums.d.ts +3 -0
- package/dist/components/Icon/iconEnums.d.ts.map +1 -0
- package/dist/components/Icon/iconEnums.js +27 -0
- package/dist/components/Icon/index.d.ts +9 -0
- package/dist/components/Icon/index.d.ts.map +1 -0
- package/dist/components/Icon/index.js +5 -0
- package/dist/components/Image/index.d.ts +11 -0
- package/dist/components/Image/index.d.ts.map +1 -0
- package/dist/components/Image/index.js +128 -0
- package/dist/components/Input/index.d.ts +15 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +263 -0
- package/dist/components/Legend/index.d.ts +12 -0
- package/dist/components/Legend/index.d.ts.map +1 -0
- package/dist/components/Legend/index.js +68 -0
- package/dist/components/Link/index.d.ts +8 -0
- package/dist/components/Link/index.d.ts.map +1 -0
- package/dist/components/Link/index.js +48 -0
- package/dist/components/List/index.d.ts +7 -0
- package/dist/components/List/index.d.ts.map +1 -0
- package/dist/components/List/index.js +50 -0
- package/dist/components/MenuAccordion/index.d.ts +8 -0
- package/dist/components/MenuAccordion/index.d.ts.map +1 -0
- package/dist/components/MenuAccordion/index.js +64 -0
- package/dist/components/Modal/index.d.ts +15 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/index.js +195 -0
- package/dist/components/Navbar/index.d.ts +8 -0
- package/dist/components/Navbar/index.d.ts.map +1 -0
- package/dist/components/Navbar/index.js +101 -0
- package/dist/components/NavigationItem/index.d.ts +22 -0
- package/dist/components/NavigationItem/index.d.ts.map +1 -0
- package/dist/components/NavigationItem/index.js +410 -0
- package/dist/components/NotificationBanner/index.d.ts +12 -0
- package/dist/components/NotificationBanner/index.d.ts.map +1 -0
- package/dist/components/NotificationBanner/index.js +129 -0
- package/dist/components/NotificationCard/index.d.ts +16 -0
- package/dist/components/NotificationCard/index.d.ts.map +1 -0
- package/dist/components/NotificationCard/index.js +271 -0
- package/dist/components/NumberDisplay/index.d.ts +13 -0
- package/dist/components/NumberDisplay/index.d.ts.map +1 -0
- package/dist/components/NumberDisplay/index.js +227 -0
- package/dist/components/Pagination/index.d.ts +39 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.js +179 -0
- package/dist/components/ProgressBar/ProgressBarSimple.d.ts +1 -0
- package/dist/components/ProgressBar/ProgressBarSimple.d.ts.map +1 -0
- package/dist/components/ProgressBar/ProgressBarSimple.js +1 -0
- package/dist/components/ProgressBar/index.d.ts +13 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/ProgressBar/index.js +67 -0
- package/dist/components/ProgressChart/index.d.ts +18 -0
- package/dist/components/ProgressChart/index.d.ts.map +1 -0
- package/dist/components/ProgressChart/index.js +147 -0
- package/dist/components/Quote/Quote.d.ts +8 -0
- package/dist/components/Quote/Quote.d.ts.map +1 -0
- package/dist/components/Quote/Quote.js +51 -0
- package/dist/components/RadioButton/index.d.ts +27 -0
- package/dist/components/RadioButton/index.d.ts.map +1 -0
- package/dist/components/RadioButton/index.js +88 -0
- package/dist/components/Rating/index.d.ts +12 -0
- package/dist/components/Rating/index.d.ts.map +1 -0
- package/dist/components/Rating/index.js +116 -0
- package/dist/components/ScrollBar/index.d.ts +12 -0
- package/dist/components/ScrollBar/index.d.ts.map +1 -0
- package/dist/components/ScrollBar/index.js +77 -0
- package/dist/components/Search/Search.d.ts +15 -0
- package/dist/components/Search/Search.d.ts.map +1 -0
- package/dist/components/Search/Search.js +272 -0
- package/dist/components/SegmentedButton/index.d.ts +9 -0
- package/dist/components/SegmentedButton/index.d.ts.map +1 -0
- package/dist/components/SegmentedButton/index.js +153 -0
- package/dist/components/Select/index.d.ts +15 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Select/index.js +274 -0
- package/dist/components/SelectItem/index.d.ts +12 -0
- package/dist/components/SelectItem/index.d.ts.map +1 -0
- package/dist/components/SelectItem/index.js +142 -0
- package/dist/components/Shortcut/index.d.ts +12 -0
- package/dist/components/Shortcut/index.d.ts.map +1 -0
- package/dist/components/Shortcut/index.js +159 -0
- package/dist/components/ShowMore/index.d.ts +8 -0
- package/dist/components/ShowMore/index.d.ts.map +1 -0
- package/dist/components/ShowMore/index.js +52 -0
- package/dist/components/ShuffleItem/ShuffleItemExample.d.ts +1 -0
- package/dist/components/ShuffleItem/ShuffleItemExample.d.ts.map +1 -0
- package/dist/components/ShuffleItem/ShuffleItemExample.js +1 -0
- package/dist/components/ShuffleItem/SimpleShuffleExample.d.ts +1 -0
- package/dist/components/ShuffleItem/SimpleShuffleExample.d.ts.map +1 -0
- package/dist/components/ShuffleItem/SimpleShuffleExample.js +1 -0
- package/dist/components/ShuffleItem/index.d.ts +30 -0
- package/dist/components/ShuffleItem/index.d.ts.map +1 -0
- package/dist/components/ShuffleItem/index.js +541 -0
- package/dist/components/Slider/index.d.ts +10 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Slider/index.js +164 -0
- package/dist/components/Tab/index.d.ts +54 -0
- package/dist/components/Tab/index.d.ts.map +1 -0
- package/dist/components/Tab/index.js +362 -0
- package/dist/components/Table/index.d.ts +11 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/index.js +242 -0
- package/dist/components/Tag/index.d.ts +10 -0
- package/dist/components/Tag/index.d.ts.map +1 -0
- package/dist/components/Tag/index.js +116 -0
- package/dist/components/TaskCard/assets/example.d.ts +3 -0
- package/dist/components/TaskCard/assets/example.d.ts.map +1 -0
- package/dist/components/TaskCard/assets/example.js +8 -0
- package/dist/components/TaskCard/components/EditIcon.d.ts +21 -0
- package/dist/components/TaskCard/components/EditIcon.d.ts.map +1 -0
- package/dist/components/TaskCard/components/EditIcon.js +54 -0
- package/dist/components/TaskCard/components/SuccessContent.d.ts +25 -0
- package/dist/components/TaskCard/components/SuccessContent.d.ts.map +1 -0
- package/dist/components/TaskCard/components/SuccessContent.js +28 -0
- package/dist/components/TaskCard/components/SuccessIcon.d.ts +21 -0
- package/dist/components/TaskCard/components/SuccessIcon.d.ts.map +1 -0
- package/dist/components/TaskCard/components/SuccessIcon.js +33 -0
- package/dist/components/TaskCard/components/SuccessTitle.d.ts +21 -0
- package/dist/components/TaskCard/components/SuccessTitle.d.ts.map +1 -0
- package/dist/components/TaskCard/components/SuccessTitle.js +33 -0
- package/dist/components/TaskCard/components/Tag.d.ts +19 -0
- package/dist/components/TaskCard/components/Tag.d.ts.map +1 -0
- package/dist/components/TaskCard/components/Tag.js +62 -0
- package/dist/components/TaskCard/components/TagGroup.d.ts +15 -0
- package/dist/components/TaskCard/components/TagGroup.d.ts.map +1 -0
- package/dist/components/TaskCard/components/TagGroup.js +38 -0
- package/dist/components/TaskCard/components/TaskDescription.d.ts +23 -0
- package/dist/components/TaskCard/components/TaskDescription.d.ts.map +1 -0
- package/dist/components/TaskCard/components/TaskDescription.js +34 -0
- package/dist/components/TaskCard/components/index.d.ts +8 -0
- package/dist/components/TaskCard/components/index.d.ts.map +1 -0
- package/dist/components/TaskCard/components/index.js +7 -0
- package/dist/components/TaskCard/index.d.ts +61 -0
- package/dist/components/TaskCard/index.d.ts.map +1 -0
- package/dist/components/TaskCard/index.js +211 -0
- package/dist/components/Toast/index.d.ts +15 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +257 -0
- package/dist/components/Toggle/index.d.ts +11 -0
- package/dist/components/Toggle/index.d.ts.map +1 -0
- package/dist/components/Toggle/index.js +116 -0
- package/dist/components/TooltipCard/index.d.ts +12 -0
- package/dist/components/TooltipCard/index.d.ts.map +1 -0
- package/dist/components/TooltipCard/index.js +263 -0
- package/dist/components/Typography/index.d.ts +15 -0
- package/dist/components/Typography/index.d.ts.map +1 -0
- package/dist/components/Typography/index.js +115 -0
- package/dist/components/styles.d.ts +78 -0
- package/dist/components/styles.d.ts.map +1 -0
- package/dist/components/styles.js +78 -0
- package/dist/src/index.d.ts +60 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +77 -0
- package/dist/styles/useFocus.d.ts +12 -0
- package/dist/styles/useFocus.d.ts.map +1 -0
- package/dist/styles/useFocus.js +22 -0
- package/package.json +121 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import React, { useState, useRef, useMemo, forwardRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, FlatList, Dimensions, Animated, Platform, } from 'react-native';
|
|
3
|
+
const ITEM_HEIGHT = 60;
|
|
4
|
+
const VISIBLE_ITEMS = 5;
|
|
5
|
+
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
|
|
6
|
+
const TimeScroller = React.memo(({ data, onValueChange, initialValue }) => {
|
|
7
|
+
const flatListRef = useRef(null);
|
|
8
|
+
const scrollY = useRef(new Animated.Value(0)).current;
|
|
9
|
+
const [currentIndex, setCurrentIndex] = useState(data.indexOf(initialValue));
|
|
10
|
+
// Efeito para scroll inicial mais suave
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const initialIndex = data.indexOf(initialValue);
|
|
13
|
+
if (initialIndex >= 0 && flatListRef.current) {
|
|
14
|
+
// Pequeno delay para garantir que o componente foi montado
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
flatListRef.current?.scrollToIndex({
|
|
17
|
+
index: initialIndex,
|
|
18
|
+
animated: false,
|
|
19
|
+
});
|
|
20
|
+
}, 100);
|
|
21
|
+
}
|
|
22
|
+
}, [data, initialValue]);
|
|
23
|
+
const renderItem = ({ item, index }) => {
|
|
24
|
+
const inputRange = [
|
|
25
|
+
(index - 2) * ITEM_HEIGHT,
|
|
26
|
+
(index - 1) * ITEM_HEIGHT,
|
|
27
|
+
index * ITEM_HEIGHT,
|
|
28
|
+
(index + 1) * ITEM_HEIGHT,
|
|
29
|
+
(index + 2) * ITEM_HEIGHT,
|
|
30
|
+
];
|
|
31
|
+
// Animações mais suaves com curvas mais naturais
|
|
32
|
+
const opacity = scrollY.interpolate({
|
|
33
|
+
inputRange,
|
|
34
|
+
outputRange: [0.2, 0.5, 1, 0.5, 0.2],
|
|
35
|
+
extrapolate: 'clamp',
|
|
36
|
+
});
|
|
37
|
+
const scale = scrollY.interpolate({
|
|
38
|
+
inputRange,
|
|
39
|
+
outputRange: [0.8, 0.95, 1.2, 0.95, 0.8],
|
|
40
|
+
extrapolate: 'clamp',
|
|
41
|
+
});
|
|
42
|
+
// Adiciona uma leve translação vertical para efeito mais dinâmico
|
|
43
|
+
const translateY = scrollY.interpolate({
|
|
44
|
+
inputRange,
|
|
45
|
+
outputRange: [5, 2, 0, 2, 5],
|
|
46
|
+
extrapolate: 'clamp',
|
|
47
|
+
});
|
|
48
|
+
return (<View style={[styles.itemContainer, { height: ITEM_HEIGHT, pointerEvents: 'none' }]}>
|
|
49
|
+
<Animated.Text style={[
|
|
50
|
+
styles.itemText,
|
|
51
|
+
{
|
|
52
|
+
transform: [{ scale }, { translateY }],
|
|
53
|
+
opacity
|
|
54
|
+
}
|
|
55
|
+
]}>
|
|
56
|
+
{item}
|
|
57
|
+
</Animated.Text>
|
|
58
|
+
</View>);
|
|
59
|
+
};
|
|
60
|
+
const getItemLayout = (_, index) => ({
|
|
61
|
+
length: ITEM_HEIGHT,
|
|
62
|
+
offset: ITEM_HEIGHT * index,
|
|
63
|
+
index,
|
|
64
|
+
});
|
|
65
|
+
const onScroll = Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], {
|
|
66
|
+
useNativeDriver: true,
|
|
67
|
+
listener: (event) => {
|
|
68
|
+
// Atualiza o índice atual durante o scroll para melhor responsividade
|
|
69
|
+
const newIndex = Math.round(event.nativeEvent.contentOffset.y / ITEM_HEIGHT);
|
|
70
|
+
if (newIndex !== currentIndex && newIndex >= 0 && newIndex < data.length) {
|
|
71
|
+
setCurrentIndex(newIndex);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const onMomentumScrollEnd = (event) => {
|
|
76
|
+
const newIndex = Math.round(event.nativeEvent.contentOffset.y / ITEM_HEIGHT);
|
|
77
|
+
const boundedIndex = Math.max(0, Math.min(newIndex, data.length - 1));
|
|
78
|
+
const newValue = data[boundedIndex];
|
|
79
|
+
if (newValue !== undefined) {
|
|
80
|
+
onValueChange(newValue);
|
|
81
|
+
setCurrentIndex(boundedIndex);
|
|
82
|
+
}
|
|
83
|
+
// Garante que o scroll pare exatamente no item
|
|
84
|
+
if (flatListRef.current && boundedIndex !== newIndex) {
|
|
85
|
+
flatListRef.current.scrollToIndex({
|
|
86
|
+
index: boundedIndex,
|
|
87
|
+
animated: true,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
// Manipula o fim do scroll por arrastar também
|
|
92
|
+
const onScrollEndDrag = (event) => {
|
|
93
|
+
const newIndex = Math.round(event.nativeEvent.contentOffset.y / ITEM_HEIGHT);
|
|
94
|
+
const boundedIndex = Math.max(0, Math.min(newIndex, data.length - 1));
|
|
95
|
+
// Anima para o item mais próximo se necessário
|
|
96
|
+
if (flatListRef.current) {
|
|
97
|
+
flatListRef.current.scrollToIndex({
|
|
98
|
+
index: boundedIndex,
|
|
99
|
+
animated: true,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const flatListPadding = (ITEM_HEIGHT * (VISIBLE_ITEMS - 1)) / 2;
|
|
104
|
+
return (<AnimatedFlatList ref={flatListRef} data={data} renderItem={renderItem} vertical showsVerticalScrollIndicator={false} snapToInterval={ITEM_HEIGHT} snapToAlignment="center" decelerationRate={Platform.OS === 'ios' ? 0.98 : 0.95} // Desaceleração mais suave
|
|
105
|
+
onScroll={onScroll}
|
|
106
|
+
// scrollEventThrottle={8} // Reduzido para mais fluidez
|
|
107
|
+
onMomentumScrollEnd={onMomentumScrollEnd} onScrollEndDrag={onScrollEndDrag} getItemLayout={getItemLayout} contentContainerStyle={{ paddingVertical: flatListPadding }} removeClippedSubviews={false} // Desabilitado para melhor performance visual
|
|
108
|
+
maxToRenderPerBatch={VISIBLE_ITEMS + 2} windowSize={VISIBLE_ITEMS * 3} initialNumToRender={VISIBLE_ITEMS + 4}
|
|
109
|
+
// Configurações adicionais para melhor performance
|
|
110
|
+
overScrollMode="never" bounces={Platform.OS === 'ios'} bouncesZoom={false} scrollsToTop={false} nestedScrollEnabled={true}/>);
|
|
111
|
+
});
|
|
112
|
+
const TimerSelector = (_, ref) => {
|
|
113
|
+
const hours = useMemo(() => Array.from({ length: 24 }, (_, i) => String(i).padStart(2, '0')), []);
|
|
114
|
+
const minutes = useMemo(() => Array.from({ length: 60 }, (_, i) => String(i).padStart(2, '0')), []);
|
|
115
|
+
const now = new Date();
|
|
116
|
+
const [selectedHour, setSelectedHour] = useState(String(now.getHours()).padStart(2, '0'));
|
|
117
|
+
const [selectedMinute, setSelectedMinute] = useState(String(now.getMinutes()).padStart(2, '0'));
|
|
118
|
+
useImperativeHandle(ref, () => ({
|
|
119
|
+
time: `${selectedHour}:${selectedMinute}`,
|
|
120
|
+
hour: selectedHour,
|
|
121
|
+
minute: selectedMinute,
|
|
122
|
+
// Métodos adicionais para controle programático
|
|
123
|
+
setTime: (hour, minute) => {
|
|
124
|
+
if (hour !== undefined)
|
|
125
|
+
setSelectedHour(String(hour).padStart(2, '0'));
|
|
126
|
+
if (minute !== undefined)
|
|
127
|
+
setSelectedMinute(String(minute).padStart(2, '0'));
|
|
128
|
+
}
|
|
129
|
+
}), [selectedHour, selectedMinute]);
|
|
130
|
+
return (<View style={styles.container}>
|
|
131
|
+
{/* Indicador visual do item selecionado */}
|
|
132
|
+
<View style={styles.selectionIndicator}/>
|
|
133
|
+
|
|
134
|
+
<View style={styles.scrollerContainer}>
|
|
135
|
+
<TimeScroller data={hours} onValueChange={setSelectedHour} initialValue={selectedHour}/>
|
|
136
|
+
</View>
|
|
137
|
+
<Text style={styles.separator}>:</Text>
|
|
138
|
+
<View style={styles.scrollerContainer}>
|
|
139
|
+
<TimeScroller data={minutes} onValueChange={setSelectedMinute} initialValue={selectedMinute}/>
|
|
140
|
+
</View>
|
|
141
|
+
</View>);
|
|
142
|
+
};
|
|
143
|
+
const styles = StyleSheet.create({
|
|
144
|
+
container: {
|
|
145
|
+
flexDirection: 'row',
|
|
146
|
+
justifyContent: 'center',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
backgroundColor: '#ffffff',
|
|
149
|
+
height: ITEM_HEIGHT * VISIBLE_ITEMS,
|
|
150
|
+
position: 'relative',
|
|
151
|
+
},
|
|
152
|
+
scrollerContainer: {
|
|
153
|
+
height: '100%',
|
|
154
|
+
width: 80, // Largura fixa para melhor alinhamento
|
|
155
|
+
},
|
|
156
|
+
itemContainer: {
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
alignItems: 'center',
|
|
159
|
+
},
|
|
160
|
+
itemText: {
|
|
161
|
+
fontSize: 38,
|
|
162
|
+
fontWeight: '600',
|
|
163
|
+
color: '#0A2D5E',
|
|
164
|
+
textAlign: 'center',
|
|
165
|
+
fontFamily: 'Nunito Sans',
|
|
166
|
+
// Adiciona sombra sutil para melhor legibilidade
|
|
167
|
+
textShadowColor: 'rgba(0, 0, 0, 0.1)',
|
|
168
|
+
textShadowOffset: { width: 0, height: 1 },
|
|
169
|
+
textShadowRadius: 2,
|
|
170
|
+
},
|
|
171
|
+
separator: {
|
|
172
|
+
fontSize: 36,
|
|
173
|
+
fontWeight: '600',
|
|
174
|
+
color: '#0A2D5E',
|
|
175
|
+
marginHorizontal: 15,
|
|
176
|
+
lineHeight: ITEM_HEIGHT,
|
|
177
|
+
textAlign: 'center',
|
|
178
|
+
fontFamily: 'Nunito Sans',
|
|
179
|
+
},
|
|
180
|
+
selectionIndicator: {
|
|
181
|
+
position: 'absolute',
|
|
182
|
+
top: ITEM_HEIGHT * 2,
|
|
183
|
+
left: 0,
|
|
184
|
+
right: 0,
|
|
185
|
+
height: ITEM_HEIGHT,
|
|
186
|
+
backgroundColor: 'rgba(10, 45, 94, 0.05)',
|
|
187
|
+
borderRadius: 12,
|
|
188
|
+
borderWidth: 2,
|
|
189
|
+
borderColor: 'rgba(10, 45, 94, 0.1)',
|
|
190
|
+
zIndex: -1,
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
export default forwardRef(TimerSelector);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as MonthSelector } from "./MonthSelector";
|
|
2
|
+
export { default as TimeSelector } from "./TimeSelector";
|
|
3
|
+
export default DatePicker;
|
|
4
|
+
declare const DatePicker: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
5
|
+
import React from 'react';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Datepicker/index.jsx"],"names":[],"mappings":";;;AAUA,oFAsSG;kBAhTyE,OAAO"}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
// import TimeSelector from './TimeSelector';
|
|
4
|
+
// import MonthSelector from './MonthSelector';
|
|
5
|
+
const TODAY_RANGE = {
|
|
6
|
+
startDate: new Date(),
|
|
7
|
+
endDate: new Date(),
|
|
8
|
+
};
|
|
9
|
+
const DatePicker = forwardRef(({ value = TODAY_RANGE, onDateChange, title = 'Selecionar datas', }, ref) => {
|
|
10
|
+
// Estado para o intervalo de datas (início e fim)
|
|
11
|
+
const [dateRange, setDateRange] = useState(value);
|
|
12
|
+
useImperativeHandle(ref, () => ({
|
|
13
|
+
dateRange,
|
|
14
|
+
}));
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
console.log('DatePicker dateRange changed:', {
|
|
17
|
+
startDate: dateRange.startDate ? dateRange.startDate.toISOString() : null,
|
|
18
|
+
endDate: dateRange.endDate ? dateRange.endDate.toISOString() : null,
|
|
19
|
+
});
|
|
20
|
+
}, [dateRange]);
|
|
21
|
+
// Estado para o mês e ano sendo exibido no calendário
|
|
22
|
+
const [currentMonth, setCurrentMonth] = useState(value?.startDate || new Date());
|
|
23
|
+
// Estado para controlar a visualização (dia, mês ou ano)
|
|
24
|
+
const [viewMode, setViewMode] = useState('day');
|
|
25
|
+
// Tamanho da célula para garantir 7 colunas fixas (evita quebra por arredondamento)
|
|
26
|
+
const [cellSize, setCellSize] = useState(0);
|
|
27
|
+
// Nomes dos meses e dias da semana para a UI
|
|
28
|
+
const months = [
|
|
29
|
+
'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho',
|
|
30
|
+
'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'
|
|
31
|
+
];
|
|
32
|
+
const weekDays = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'];
|
|
33
|
+
// Função para validar e converter datas
|
|
34
|
+
const validateAndParseDate = (dateValue) => {
|
|
35
|
+
if (!dateValue)
|
|
36
|
+
return null;
|
|
37
|
+
// Se já é um Date válido
|
|
38
|
+
if (dateValue instanceof Date && !isNaN(dateValue.getTime())) {
|
|
39
|
+
return dateValue;
|
|
40
|
+
}
|
|
41
|
+
// Tenta converter string/number para Date
|
|
42
|
+
if (typeof dateValue === 'string' || typeof dateValue === 'number') {
|
|
43
|
+
const parsed = new Date(dateValue);
|
|
44
|
+
if (!isNaN(parsed.getTime())) {
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
console.warn('Invalid date value:', dateValue);
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
// Efeito que atualiza o estado interno se a prop `value` mudar
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (value && typeof value === 'object') {
|
|
54
|
+
const newStartDate = validateAndParseDate(value.startDate);
|
|
55
|
+
const newEndDate = validateAndParseDate(value.endDate);
|
|
56
|
+
setDateRange({
|
|
57
|
+
startDate: newStartDate,
|
|
58
|
+
endDate: newEndDate,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, [value]);
|
|
62
|
+
// Função para verificar se dois objetos de data são o mesmo dia
|
|
63
|
+
const isSameDay = (dateA, dateB) => {
|
|
64
|
+
if (!dateA || !dateB)
|
|
65
|
+
return false;
|
|
66
|
+
return (dateA.getFullYear() === dateB.getFullYear() &&
|
|
67
|
+
dateA.getMonth() === dateB.getMonth() &&
|
|
68
|
+
dateA.getDate() === dateB.getDate());
|
|
69
|
+
};
|
|
70
|
+
// Funções auxiliares para estilização do intervalo
|
|
71
|
+
const isStartDate = (date) => isSameDay(date, dateRange.startDate);
|
|
72
|
+
const isEndDate = (date) => isSameDay(date, dateRange.endDate);
|
|
73
|
+
const isInRange = (date) => {
|
|
74
|
+
if (!dateRange.startDate || !dateRange.endDate || !date)
|
|
75
|
+
return false;
|
|
76
|
+
// Garante que a comparação seja feita corretamente, ignorando o horário
|
|
77
|
+
const timestamp = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
78
|
+
const startTimestamp = new Date(dateRange.startDate.getFullYear(), dateRange.startDate.getMonth(), dateRange.startDate.getDate()).getTime();
|
|
79
|
+
const endTimestamp = new Date(dateRange.endDate.getFullYear(), dateRange.endDate.getMonth(), dateRange.endDate.getDate()).getTime();
|
|
80
|
+
return timestamp > startTimestamp && timestamp < endTimestamp;
|
|
81
|
+
};
|
|
82
|
+
// Gera os dias do mês para exibição no grid
|
|
83
|
+
const getDaysInMonth = () => {
|
|
84
|
+
const year = currentMonth.getFullYear();
|
|
85
|
+
const month = currentMonth.getMonth();
|
|
86
|
+
const firstDay = new Date(year, month, 1);
|
|
87
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
88
|
+
const daysInMonth = lastDay.getDate();
|
|
89
|
+
const startingDayOfWeek = firstDay.getDay();
|
|
90
|
+
const days = [];
|
|
91
|
+
for (let i = 0; i < startingDayOfWeek; i++) {
|
|
92
|
+
days.push(null); // Adiciona células vazias para o início do mês
|
|
93
|
+
}
|
|
94
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
95
|
+
days.push(new Date(year, month, day));
|
|
96
|
+
}
|
|
97
|
+
// Preenche o final para o total de células ser múltiplo de 7 (linhas completas)
|
|
98
|
+
const remainder = days.length % 7;
|
|
99
|
+
if (remainder !== 0) {
|
|
100
|
+
const toAdd = 7 - remainder;
|
|
101
|
+
for (let i = 0; i < toAdd; i++)
|
|
102
|
+
days.push(null);
|
|
103
|
+
}
|
|
104
|
+
return days;
|
|
105
|
+
};
|
|
106
|
+
// Gera uma lista de anos para o seletor de ano
|
|
107
|
+
const getYearRange = () => {
|
|
108
|
+
const currentYear = new Date().getFullYear();
|
|
109
|
+
const years = [];
|
|
110
|
+
for (let year = currentYear - 50; year <= currentYear + 50; year++) {
|
|
111
|
+
years.push(year);
|
|
112
|
+
}
|
|
113
|
+
return years;
|
|
114
|
+
};
|
|
115
|
+
// Lógica para seleção do intervalo de datas
|
|
116
|
+
const handleDateSelect = (date) => {
|
|
117
|
+
if (!date)
|
|
118
|
+
return;
|
|
119
|
+
const { startDate, endDate } = dateRange;
|
|
120
|
+
let newRange;
|
|
121
|
+
if (!startDate || (startDate && endDate)) {
|
|
122
|
+
// Inicia um novo intervalo
|
|
123
|
+
newRange = { startDate: date, endDate: null };
|
|
124
|
+
}
|
|
125
|
+
else if (startDate && !endDate) {
|
|
126
|
+
// Finaliza o intervalo
|
|
127
|
+
if (date < startDate) {
|
|
128
|
+
// Se a data final for anterior à inicial, a data selecionada vira o novo início
|
|
129
|
+
newRange = { startDate: date, endDate: null };
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
newRange = { ...dateRange, endDate: date };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
setDateRange(newRange);
|
|
136
|
+
onDateChange?.(newRange); // Chama o callback com o novo intervalo
|
|
137
|
+
};
|
|
138
|
+
// Funções para navegar entre meses e anos
|
|
139
|
+
const navigateMonth = (direction) => {
|
|
140
|
+
const newMonth = new Date(currentMonth);
|
|
141
|
+
newMonth.setMonth(newMonth.getMonth() + direction);
|
|
142
|
+
setCurrentMonth(newMonth);
|
|
143
|
+
};
|
|
144
|
+
const navigateYear = (direction) => {
|
|
145
|
+
const newMonth = new Date(currentMonth);
|
|
146
|
+
newMonth.setFullYear(newMonth.getFullYear() + direction);
|
|
147
|
+
setCurrentMonth(newMonth);
|
|
148
|
+
};
|
|
149
|
+
// --- Renderização dos Componentes ---
|
|
150
|
+
const renderDayView = () => (<View style={styles.calendarContainer}>
|
|
151
|
+
<View style={styles.calendarHeader}>
|
|
152
|
+
<TouchableOpacity onPress={() => navigateMonth(-1)}>
|
|
153
|
+
<Text style={styles.navButton}>‹</Text>
|
|
154
|
+
</TouchableOpacity>
|
|
155
|
+
<TouchableOpacity onPress={() => setViewMode('month')}>
|
|
156
|
+
<Text style={styles.monthYear}>
|
|
157
|
+
{months[currentMonth.getMonth()]} {currentMonth.getFullYear()}
|
|
158
|
+
</Text>
|
|
159
|
+
</TouchableOpacity>
|
|
160
|
+
<TouchableOpacity onPress={() => navigateMonth(1)}>
|
|
161
|
+
<Text style={styles.navButton}>›</Text>
|
|
162
|
+
</TouchableOpacity>
|
|
163
|
+
</View>
|
|
164
|
+
|
|
165
|
+
<View style={styles.weekDaysContainer}>
|
|
166
|
+
{weekDays.map((day) => <Text key={day} style={styles.weekDay}>{day}</Text>)}
|
|
167
|
+
</View>
|
|
168
|
+
|
|
169
|
+
<View style={styles.daysGrid} onLayout={e => {
|
|
170
|
+
const width = e.nativeEvent.layout.width;
|
|
171
|
+
// Usa floor para garantir que sete células caibam na linha
|
|
172
|
+
const size = Math.floor(width / 7);
|
|
173
|
+
if (size !== cellSize)
|
|
174
|
+
setCellSize(size);
|
|
175
|
+
}}>
|
|
176
|
+
{getDaysInMonth().map((date, index) => {
|
|
177
|
+
const isStart = isStartDate(date);
|
|
178
|
+
const isEnd = isEndDate(date);
|
|
179
|
+
const inRange = isInRange(date);
|
|
180
|
+
const cellStyle = [
|
|
181
|
+
styles.dayCell,
|
|
182
|
+
inRange && styles.inRangeDay,
|
|
183
|
+
isStart && styles.startDay,
|
|
184
|
+
isEnd && styles.endDay,
|
|
185
|
+
// Garante 7 colunas e quadrado perfeito baseado na largura medida do grid
|
|
186
|
+
cellSize > 0 && { width: cellSize, height: cellSize },
|
|
187
|
+
];
|
|
188
|
+
const textStyle = [
|
|
189
|
+
styles.dayText,
|
|
190
|
+
(isStart || isEnd) && styles.startEndDayText,
|
|
191
|
+
!date && styles.emptyDay,
|
|
192
|
+
];
|
|
193
|
+
return (<TouchableOpacity key={index} style={cellStyle} onPress={() => handleDateSelect(date)} disabled={!date}>
|
|
194
|
+
<Text style={textStyle}>
|
|
195
|
+
{date ? date.getDate() : ''}
|
|
196
|
+
</Text>
|
|
197
|
+
</TouchableOpacity>);
|
|
198
|
+
})}
|
|
199
|
+
</View>
|
|
200
|
+
</View>);
|
|
201
|
+
const renderMonthView = () => (<View style={styles.calendarContainer}>
|
|
202
|
+
<View style={styles.calendarHeader}>
|
|
203
|
+
<TouchableOpacity onPress={() => navigateYear(-1)}>
|
|
204
|
+
<Text style={styles.navButton}>‹</Text>
|
|
205
|
+
</TouchableOpacity>
|
|
206
|
+
<TouchableOpacity onPress={() => setViewMode('year')}>
|
|
207
|
+
<Text style={styles.monthYear}>{currentMonth.getFullYear()}</Text>
|
|
208
|
+
</TouchableOpacity>
|
|
209
|
+
<TouchableOpacity onPress={() => navigateYear(1)}>
|
|
210
|
+
<Text style={styles.navButton}>›</Text>
|
|
211
|
+
</TouchableOpacity>
|
|
212
|
+
</View>
|
|
213
|
+
<View style={styles.monthsGrid}>
|
|
214
|
+
{months.map((month, index) => (<TouchableOpacity key={month} style={[styles.monthCell, index === currentMonth.getMonth() && styles.selectedMonth]} onPress={() => {
|
|
215
|
+
setCurrentMonth(new Date(currentMonth.getFullYear(), index, 1));
|
|
216
|
+
setViewMode('day');
|
|
217
|
+
}}>
|
|
218
|
+
<Text style={[styles.monthText, index === currentMonth.getMonth() && styles.selectedMonthText]}>
|
|
219
|
+
{month.substring(0, 3)}
|
|
220
|
+
</Text>
|
|
221
|
+
</TouchableOpacity>))}
|
|
222
|
+
</View>
|
|
223
|
+
</View>);
|
|
224
|
+
const renderYearView = () => (<View style={styles.calendarContainer}>
|
|
225
|
+
<View style={styles.calendarHeader}>
|
|
226
|
+
<Text style={styles.monthYear}>Selecionar Ano</Text>
|
|
227
|
+
</View>
|
|
228
|
+
<View style={styles.yearsGrid}>
|
|
229
|
+
{getYearRange().map((year) => (<TouchableOpacity key={year} style={[styles.yearCell, year === currentMonth.getFullYear() && styles.selectedYear]} onPress={() => {
|
|
230
|
+
setCurrentMonth(new Date(year, currentMonth.getMonth(), 1));
|
|
231
|
+
setViewMode('month');
|
|
232
|
+
}}>
|
|
233
|
+
<Text style={[styles.yearText, year === currentMonth.getFullYear() && styles.selectedYearText]}>
|
|
234
|
+
{year}
|
|
235
|
+
</Text>
|
|
236
|
+
</TouchableOpacity>))}
|
|
237
|
+
</View>
|
|
238
|
+
</View>);
|
|
239
|
+
return (<View style={styles.container}>
|
|
240
|
+
{viewMode === 'day' && renderDayView()}
|
|
241
|
+
{viewMode === 'month' && renderMonthView()}
|
|
242
|
+
{viewMode === 'year' && renderYearView()}
|
|
243
|
+
</View>);
|
|
244
|
+
});
|
|
245
|
+
// --- Estilos ---
|
|
246
|
+
const styles = StyleSheet.create({
|
|
247
|
+
container: {
|
|
248
|
+
backgroundColor: '#FFFFFF',
|
|
249
|
+
borderRadius: 16,
|
|
250
|
+
paddingVertical: 10,
|
|
251
|
+
width: '100%',
|
|
252
|
+
},
|
|
253
|
+
calendarContainer: {
|
|
254
|
+
paddingHorizontal: 15,
|
|
255
|
+
},
|
|
256
|
+
// Cabeçalho e Navegação
|
|
257
|
+
calendarHeader: {
|
|
258
|
+
flexDirection: 'row',
|
|
259
|
+
justifyContent: 'space-between',
|
|
260
|
+
alignItems: 'center',
|
|
261
|
+
marginBottom: 20,
|
|
262
|
+
},
|
|
263
|
+
navButton: {
|
|
264
|
+
fontSize: 22,
|
|
265
|
+
color: '#007AFF',
|
|
266
|
+
fontWeight: 'bold',
|
|
267
|
+
padding: 10,
|
|
268
|
+
fontFamily: 'Nunito Sans',
|
|
269
|
+
},
|
|
270
|
+
monthYear: {
|
|
271
|
+
fontSize: 18,
|
|
272
|
+
fontWeight: 'bold',
|
|
273
|
+
color: '#333333',
|
|
274
|
+
fontFamily: 'Nunito Sans',
|
|
275
|
+
},
|
|
276
|
+
// Dias da Semana
|
|
277
|
+
weekDaysContainer: {
|
|
278
|
+
flexDirection: 'row',
|
|
279
|
+
marginBottom: 10,
|
|
280
|
+
},
|
|
281
|
+
weekDay: {
|
|
282
|
+
flex: 1,
|
|
283
|
+
textAlign: 'center',
|
|
284
|
+
fontSize: 13,
|
|
285
|
+
color: '#8A8A8E',
|
|
286
|
+
fontWeight: '500',
|
|
287
|
+
fontFamily: 'Nunito Sans',
|
|
288
|
+
},
|
|
289
|
+
// Grid de Dias
|
|
290
|
+
daysGrid: {
|
|
291
|
+
flexDirection: 'row',
|
|
292
|
+
flexWrap: 'wrap',
|
|
293
|
+
rowGap: 24,
|
|
294
|
+
},
|
|
295
|
+
dayCell: {
|
|
296
|
+
width: `${100 / 7}%`,
|
|
297
|
+
aspectRatio: 1,
|
|
298
|
+
justifyContent: 'center',
|
|
299
|
+
alignItems: 'center',
|
|
300
|
+
backgroundColor: 'transparent',
|
|
301
|
+
maxHeight: 32,
|
|
302
|
+
},
|
|
303
|
+
dayText: {
|
|
304
|
+
fontSize: 16,
|
|
305
|
+
color: '#333333',
|
|
306
|
+
height: '100%',
|
|
307
|
+
verticalAlign: 'middle',
|
|
308
|
+
fontFamily: 'Nunito Sans',
|
|
309
|
+
},
|
|
310
|
+
emptyDay: {
|
|
311
|
+
color: 'transparent',
|
|
312
|
+
},
|
|
313
|
+
// Estilos do Intervalo de Datas
|
|
314
|
+
inRangeDay: {
|
|
315
|
+
backgroundColor: '#E6EFFF', // Azul claro para o intervalo
|
|
316
|
+
borderRadius: 0,
|
|
317
|
+
alignItems: 'center',
|
|
318
|
+
justifyContent: 'center',
|
|
319
|
+
},
|
|
320
|
+
startDay: {
|
|
321
|
+
backgroundColor: '#007AFF', // Azul para data inicial
|
|
322
|
+
borderTopLeftRadius: 8,
|
|
323
|
+
borderBottomLeftRadius: 8,
|
|
324
|
+
},
|
|
325
|
+
endDay: {
|
|
326
|
+
backgroundColor: '#007AFF', // Azul para data final
|
|
327
|
+
borderTopRightRadius: 8,
|
|
328
|
+
borderBottomRightRadius: 8,
|
|
329
|
+
},
|
|
330
|
+
startEndDayText: {
|
|
331
|
+
color: '#FFFFFF',
|
|
332
|
+
fontWeight: 'bold',
|
|
333
|
+
},
|
|
334
|
+
// Views de Mês e Ano
|
|
335
|
+
monthsGrid: {
|
|
336
|
+
flexDirection: 'row',
|
|
337
|
+
flexWrap: 'wrap',
|
|
338
|
+
justifyContent: 'center',
|
|
339
|
+
},
|
|
340
|
+
monthCell: {
|
|
341
|
+
width: '30%',
|
|
342
|
+
margin: 5,
|
|
343
|
+
paddingVertical: 15,
|
|
344
|
+
justifyContent: 'center',
|
|
345
|
+
alignItems: 'center',
|
|
346
|
+
borderRadius: 8,
|
|
347
|
+
},
|
|
348
|
+
selectedMonth: {
|
|
349
|
+
backgroundColor: '#007AFF',
|
|
350
|
+
},
|
|
351
|
+
monthText: {
|
|
352
|
+
fontSize: 16,
|
|
353
|
+
color: '#333',
|
|
354
|
+
},
|
|
355
|
+
selectedMonthText: {
|
|
356
|
+
color: '#FFFFFF',
|
|
357
|
+
fontWeight: 'bold',
|
|
358
|
+
},
|
|
359
|
+
yearsGrid: {
|
|
360
|
+
flexDirection: 'row',
|
|
361
|
+
flexWrap: 'wrap',
|
|
362
|
+
justifyContent: 'center',
|
|
363
|
+
},
|
|
364
|
+
yearCell: {
|
|
365
|
+
width: '22%',
|
|
366
|
+
margin: 5,
|
|
367
|
+
paddingVertical: 10,
|
|
368
|
+
justifyContent: 'center',
|
|
369
|
+
alignItems: 'center',
|
|
370
|
+
borderRadius: 8,
|
|
371
|
+
},
|
|
372
|
+
selectedYear: {
|
|
373
|
+
backgroundColor: '#007AFF',
|
|
374
|
+
},
|
|
375
|
+
yearText: {
|
|
376
|
+
fontSize: 16,
|
|
377
|
+
color: '#333',
|
|
378
|
+
fontFamily: 'Nunito Sans',
|
|
379
|
+
},
|
|
380
|
+
selectedYearText: {
|
|
381
|
+
color: '#181010ff',
|
|
382
|
+
fontWeight: 'bold',
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
export { default as MonthSelector } from './MonthSelector';
|
|
386
|
+
export { default as TimeSelector } from './TimeSelector';
|
|
387
|
+
export default DatePicker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default DonutChart;
|
|
2
|
+
declare function DonutChart({ progress, size, strokeWidth, color, backgroundColor, showPercentage, style }: {
|
|
3
|
+
progress?: number | undefined;
|
|
4
|
+
size?: number | undefined;
|
|
5
|
+
strokeWidth?: number | undefined;
|
|
6
|
+
color: any;
|
|
7
|
+
backgroundColor: any;
|
|
8
|
+
showPercentage?: boolean | undefined;
|
|
9
|
+
style: any;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
import React from 'react';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/DonutChart/index.jsx"],"names":[],"mappings":";AA2BA;;;;;;;;sBAuHC;kBAlJiB,OAAO"}
|