venice-ui 3.0.23 → 3.0.24
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.
|
@@ -42,7 +42,7 @@ const styled_components_1 = require("styled-components");
|
|
|
42
42
|
const CalendarHeader_1 = require("./CalendarHeader");
|
|
43
43
|
const ButtonsFooter_1 = require("../ButtonsFooter");
|
|
44
44
|
const CalendarContent_1 = require("./CalendarContent");
|
|
45
|
-
const Calendar = ({ theme, themeVariant = 'default', value, top, left, triggerTop, localeLabels, handleClose, handleSelect, isAdvance = true,
|
|
45
|
+
const Calendar = ({ theme, themeVariant = 'default', value, top, left, triggerTop, localeLabels, handleClose, handleSelect, isAdvance = true, zIndex, config, labels, }) => {
|
|
46
46
|
const setYearScope = (date) => {
|
|
47
47
|
const year = (0, date_fns_1.getYear)(date);
|
|
48
48
|
const yearIndex = year % 12;
|
|
@@ -50,11 +50,6 @@ const Calendar = ({ theme, themeVariant = 'default', value, top, left, triggerTo
|
|
|
50
50
|
const futureYears = Array.from({ length: 12 - yearIndex - 1 }, (_, i) => year + (i + 1));
|
|
51
51
|
return [...pastYears, year, ...futureYears];
|
|
52
52
|
};
|
|
53
|
-
const effectiveAutoConfirm = isAdvance
|
|
54
|
-
? false
|
|
55
|
-
: typeof autoConfirm !== 'undefined'
|
|
56
|
-
? Boolean(autoConfirm)
|
|
57
|
-
: true;
|
|
58
53
|
const [calendarSettings, updateCalendarSettings] = (0, react_1.useState)(() => {
|
|
59
54
|
const initialDate = value !== undefined ? new Date(value) : new Date();
|
|
60
55
|
return {
|
|
@@ -127,7 +122,7 @@ const Calendar = ({ theme, themeVariant = 'default', value, top, left, triggerTo
|
|
|
127
122
|
};
|
|
128
123
|
const setNewDate = (newDate) => {
|
|
129
124
|
setSellectedDate(newDate);
|
|
130
|
-
if (
|
|
125
|
+
if (!isAdvance && handleSelect) {
|
|
131
126
|
handleSelect((0, date_fns_1.getTime)(newDate));
|
|
132
127
|
handleClose && handleClose();
|
|
133
128
|
}
|
|
@@ -6,7 +6,7 @@ import { ThemeProvider } from 'styled-components';
|
|
|
6
6
|
import { CalendarHeader } from './CalendarHeader';
|
|
7
7
|
import { ButtonsFooter } from '../ButtonsFooter';
|
|
8
8
|
import { CalendarContent } from './CalendarContent';
|
|
9
|
-
export const Calendar = ({ theme, themeVariant = 'default', value, top, left, triggerTop, localeLabels, handleClose, handleSelect, isAdvance = true,
|
|
9
|
+
export const Calendar = ({ theme, themeVariant = 'default', value, top, left, triggerTop, localeLabels, handleClose, handleSelect, isAdvance = true, zIndex, config, labels, }) => {
|
|
10
10
|
const setYearScope = (date) => {
|
|
11
11
|
const year = getYear(date);
|
|
12
12
|
const yearIndex = year % 12;
|
|
@@ -14,11 +14,6 @@ export const Calendar = ({ theme, themeVariant = 'default', value, top, left, tr
|
|
|
14
14
|
const futureYears = Array.from({ length: 12 - yearIndex - 1 }, (_, i) => year + (i + 1));
|
|
15
15
|
return [...pastYears, year, ...futureYears];
|
|
16
16
|
};
|
|
17
|
-
const effectiveAutoConfirm = isAdvance
|
|
18
|
-
? false
|
|
19
|
-
: typeof autoConfirm !== 'undefined'
|
|
20
|
-
? Boolean(autoConfirm)
|
|
21
|
-
: true;
|
|
22
17
|
const [calendarSettings, updateCalendarSettings] = useState(() => {
|
|
23
18
|
const initialDate = value !== undefined ? new Date(value) : new Date();
|
|
24
19
|
return {
|
|
@@ -91,7 +86,7 @@ export const Calendar = ({ theme, themeVariant = 'default', value, top, left, tr
|
|
|
91
86
|
};
|
|
92
87
|
const setNewDate = (newDate) => {
|
|
93
88
|
setSellectedDate(newDate);
|
|
94
|
-
if (
|
|
89
|
+
if (!isAdvance && handleSelect) {
|
|
95
90
|
handleSelect(getTime(newDate));
|
|
96
91
|
handleClose && handleClose();
|
|
97
92
|
}
|