@archbase/components 4.0.33 → 4.0.35
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archbase/components",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.35",
|
|
4
4
|
"description": "UI Components for Archbase React v3 - Form editors, data visualization, and business components",
|
|
5
5
|
"author": "Edson Martins <edsonmartins2005@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"src"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@mantine/carousel": "9.
|
|
27
|
-
"@mantine/charts": "9.
|
|
28
|
-
"@mantine/code-highlight": "9.
|
|
29
|
-
"@mantine/core": "9.
|
|
30
|
-
"@mantine/dates": "9.
|
|
31
|
-
"@mantine/dropzone": "9.
|
|
32
|
-
"@mantine/form": "9.
|
|
33
|
-
"@mantine/hooks": "9.
|
|
34
|
-
"@mantine/modals": "9.
|
|
35
|
-
"@mantine/notifications": "9.
|
|
26
|
+
"@mantine/carousel": "9.4.0",
|
|
27
|
+
"@mantine/charts": "9.4.0",
|
|
28
|
+
"@mantine/code-highlight": "9.4.0",
|
|
29
|
+
"@mantine/core": "9.4.0",
|
|
30
|
+
"@mantine/dates": "9.4.0",
|
|
31
|
+
"@mantine/dropzone": "9.4.0",
|
|
32
|
+
"@mantine/form": "9.4.0",
|
|
33
|
+
"@mantine/hooks": "9.4.0",
|
|
34
|
+
"@mantine/modals": "9.4.0",
|
|
35
|
+
"@mantine/notifications": "9.4.0",
|
|
36
36
|
"@tabler/icons-react": "^3.26.0",
|
|
37
37
|
"react": "^18.3.0 || ^19.2.0",
|
|
38
38
|
"react-dom": "^18.3.0 || ^19.2.0"
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
"vis-timeline": "^7.7.3",
|
|
119
119
|
"xlsx": "^0.18.5",
|
|
120
120
|
"yet-another-react-lightbox": "^3.21.0",
|
|
121
|
-
"@archbase/core": "4.0.
|
|
122
|
-
"@archbase/data": "4.0.
|
|
123
|
-
"@archbase/layout": "4.0.
|
|
121
|
+
"@archbase/core": "4.0.35",
|
|
122
|
+
"@archbase/data": "4.0.35",
|
|
123
|
+
"@archbase/layout": "4.0.35"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
126
|
"@types/d3": "^7.4.3",
|
|
@@ -17,6 +17,25 @@ const formatDate = (date: Date | null): string => {
|
|
|
17
17
|
return date.toLocaleDateString();
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
// Formata uma data para "YYYY-MM-DD" em horário LOCAL (DatePickerInput do Mantine 9 é string-based).
|
|
21
|
+
// Usar toISOString() aqui desloca o dia em fusos negativos (ex.: 21:00 BRT vira o dia seguinte em UTC).
|
|
22
|
+
const toLocalDateInputValue = (date: Date | null): string | null => {
|
|
23
|
+
if (!date) return null;
|
|
24
|
+
const year = date.getFullYear();
|
|
25
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
26
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
27
|
+
return `${year}-${month}-${day}`;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Aplica a data selecionada ("YYYY-MM-DD") preservando a hora já existente (ou a atual), em horário local.
|
|
31
|
+
const applyDateInputValue = (value: string | null, current: Date | null): Date | null => {
|
|
32
|
+
if (!value) return null;
|
|
33
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
34
|
+
const result = current ? new Date(current.getTime()) : new Date();
|
|
35
|
+
result.setFullYear(year, month - 1, day);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
|
|
20
39
|
// Função para formatar o intervalo de datas para exibição resumida (versão curta para o botão)
|
|
21
40
|
const formatDateRange = (start: Date | null, end: Date | null): string => {
|
|
22
41
|
if (!start || !end) return 'Selecionar intervalo';
|
|
@@ -176,9 +195,7 @@ export const ArchbaseTimeRangeSelector: FC<ArchbaseTimeRangeSelectorProps> = (pr
|
|
|
176
195
|
|
|
177
196
|
// Atualizar o estado quando o defaultRangeValue muda
|
|
178
197
|
useEffect(() => {
|
|
179
|
-
console.log('[TimeRangeSelector] useEffect defaultRangeValue=%s, selectedRange=%s', defaultRangeValue, selectedRange);
|
|
180
198
|
if (defaultRangeValue !== undefined) {
|
|
181
|
-
console.log('[TimeRangeSelector] setSelectedRange(%s)', defaultRangeValue);
|
|
182
199
|
// Atualizar o selectedRange
|
|
183
200
|
setSelectedRange(defaultRangeValue);
|
|
184
201
|
|
|
@@ -236,7 +253,6 @@ export const ArchbaseTimeRangeSelector: FC<ArchbaseTimeRangeSelectorProps> = (pr
|
|
|
236
253
|
|
|
237
254
|
// Manipular a mudança de range (predefinido ou customizado)
|
|
238
255
|
const handleRangeChange = (value: string | null) => {
|
|
239
|
-
console.log('[TimeRangeSelector] handleRangeChange value=%s', value);
|
|
240
256
|
setSelectedRange(value);
|
|
241
257
|
|
|
242
258
|
// Se não for range customizado, aplicar imediatamente
|
|
@@ -343,8 +359,8 @@ export const ArchbaseTimeRangeSelector: FC<ArchbaseTimeRangeSelectorProps> = (pr
|
|
|
343
359
|
<Group grow mt="xs">
|
|
344
360
|
<DatePickerInput
|
|
345
361
|
label="Data inicial"
|
|
346
|
-
value={customRange.start
|
|
347
|
-
onChange={(date: string | null) => setCustomRange(prev => ({ ...prev, start: date
|
|
362
|
+
value={toLocalDateInputValue(customRange.start)}
|
|
363
|
+
onChange={(date: string | null) => setCustomRange(prev => ({ ...prev, start: applyDateInputValue(date, prev.start) }))}
|
|
348
364
|
style={{ flex: 1 }}
|
|
349
365
|
popoverProps={{ withinPortal: false, closeOnClickOutside: false }}
|
|
350
366
|
/>
|
|
@@ -365,8 +381,8 @@ export const ArchbaseTimeRangeSelector: FC<ArchbaseTimeRangeSelectorProps> = (pr
|
|
|
365
381
|
<Group grow mt="xs">
|
|
366
382
|
<DatePickerInput
|
|
367
383
|
label="Data final"
|
|
368
|
-
value={customRange.end
|
|
369
|
-
onChange={(date: string | null) => setCustomRange(prev => ({ ...prev, end: date
|
|
384
|
+
value={toLocalDateInputValue(customRange.end)}
|
|
385
|
+
onChange={(date: string | null) => setCustomRange(prev => ({ ...prev, end: applyDateInputValue(date, prev.end) }))}
|
|
370
386
|
style={{ flex: 1 }}
|
|
371
387
|
popoverProps={{ withinPortal: false, closeOnClickOutside: false }}
|
|
372
388
|
/>
|
|
Binary file
|