josenanodev-react-components-library 0.0.27 → 0.0.28
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/dist/cjs/components/Multicalendar/Multicalendar.d.ts +1 -1
- package/dist/cjs/components/Multicalendar/Multicalendar.js +3 -12
- package/dist/cjs/components/Multicalendar/types.d.ts +3 -5
- package/dist/esm/components/Multicalendar/Multicalendar.d.ts +1 -1
- package/dist/esm/components/Multicalendar/Multicalendar.js +3 -12
- package/dist/esm/components/Multicalendar/types.d.ts +3 -5
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./Multicalendar.css";
|
|
3
3
|
import { MulticalendarPropsType } from "./types";
|
|
4
|
-
declare const Multicalendar: ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible, cellsWidth, cellsHeight, verticalAxisWidth, horizontalAxisHeight, pastDaysInitialQuantity, futureDaysInitialQuantity, chunkRenderX, chunkRenderY, dynamicDaysQuantity, draggingOverDateCells, waitTimeForCalls, callsOnInitialView,
|
|
4
|
+
declare const Multicalendar: ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible, cellsWidth, cellsHeight, verticalAxisWidth, horizontalAxisHeight, pastDaysInitialQuantity, futureDaysInitialQuantity, chunkRenderX, chunkRenderY, dynamicDaysQuantity, draggingOverDateCells, waitTimeForCalls, callsOnInitialView, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }: MulticalendarPropsType) => JSX.Element;
|
|
5
5
|
export default Multicalendar;
|
|
@@ -42,7 +42,7 @@ const useWindowsSize_1 = __importDefault(require("../../hooks/useWindowsSize"));
|
|
|
42
42
|
const sqlToJsDate_1 = __importDefault(require("../../utils/sqlToJsDate"));
|
|
43
43
|
//Services
|
|
44
44
|
const MulticalendarStatesAndSettings_1 = require("../../Services/MulticalendarStatesAndSettings");
|
|
45
|
-
const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible = true, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, horizontalAxisHeight = 148, pastDaysInitialQuantity = 365, futureDaysInitialQuantity = 365, chunkRenderX = 0, chunkRenderY = 0, dynamicDaysQuantity = false, draggingOverDateCells = false, waitTimeForCalls = 500, callsOnInitialView,
|
|
45
|
+
const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible = true, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, horizontalAxisHeight = 148, pastDaysInitialQuantity = 365, futureDaysInitialQuantity = 365, chunkRenderX = 0, chunkRenderY = 0, dynamicDaysQuantity = false, draggingOverDateCells = false, waitTimeForCalls = 500, callsOnInitialView, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }) => {
|
|
46
46
|
//Constantes del componente
|
|
47
47
|
const origin = {
|
|
48
48
|
x: pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) * cellsWidth : 0,
|
|
@@ -114,12 +114,6 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
114
114
|
visibleDates,
|
|
115
115
|
callsOnInitialView,
|
|
116
116
|
]);
|
|
117
|
-
(0, react_1.useEffect)(() => {
|
|
118
|
-
if (callsOnElementIdsListChanges && visibleListElementsIds.length > 0) {
|
|
119
|
-
callsOnElementIdsListChanges(visibleListElementsIds, visibleDates);
|
|
120
|
-
}
|
|
121
|
-
// eslint-disable-next-line
|
|
122
|
-
}, [listElementsIdsArray]);
|
|
123
117
|
(0, react_1.useEffect)(() => {
|
|
124
118
|
// Posicionamiento inicial en X
|
|
125
119
|
if (gridWrapperRef.current !== null) {
|
|
@@ -226,14 +220,11 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
226
220
|
}
|
|
227
221
|
}, [xPosition, yPosition, idTimeoutForCalls, waitTimeForCalls]);
|
|
228
222
|
(0, react_1.useEffect)(() => {
|
|
229
|
-
if (scrollingOnCourse &&
|
|
230
|
-
callsOnScrollingMoves(visibleListElementsIds, visibleDates);
|
|
231
|
-
}
|
|
232
|
-
else if (!scrollingOnCourse && callsOnScrollingStops) {
|
|
223
|
+
if (!scrollingOnCourse && callsOnScrollingStops) {
|
|
233
224
|
callsOnScrollingStops(visibleListElementsIds, visibleDates);
|
|
234
225
|
}
|
|
235
226
|
// eslint-disable-next-line
|
|
236
|
-
}, [scrollingOnCourse]);
|
|
227
|
+
}, [scrollingOnCourse, visibleListElementsIds, visibleDates]);
|
|
237
228
|
//Cancelar idIntervalo Autoscroll de rango cuando se deja de seleccionar
|
|
238
229
|
(0, react_1.useEffect)(() => {
|
|
239
230
|
if (!draggingOverDateCells) {
|
|
@@ -6,7 +6,7 @@ export interface MulticalendarPropsType {
|
|
|
6
6
|
ReactListElementChildren: ReactListElementChildrenType;
|
|
7
7
|
listElementsIdsArray: string[] | number[];
|
|
8
8
|
language: languageType;
|
|
9
|
-
pastDatesVisible?: boolean
|
|
9
|
+
pastDatesVisible?: boolean;
|
|
10
10
|
cellsWidth?: number;
|
|
11
11
|
cellsHeight?: number;
|
|
12
12
|
verticalAxisWidth?: number;
|
|
@@ -19,11 +19,9 @@ export interface MulticalendarPropsType {
|
|
|
19
19
|
dynamicDaysQuantity?: boolean;
|
|
20
20
|
waitTimeForCalls?: number;
|
|
21
21
|
callsOnInitialView?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
22
|
-
callsOnElementIdsListChanges?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
23
|
-
callsOnScrollingMoves?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
24
22
|
callsOnScrollingStops?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
25
|
-
aditionalControlsComponents?: JSX.Element | JSX.Element[]
|
|
26
|
-
upperLeftComponent?: JSX.Element
|
|
23
|
+
aditionalControlsComponents?: JSX.Element | JSX.Element[];
|
|
24
|
+
upperLeftComponent?: JSX.Element;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
export interface RenderCoordinatesType {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./Multicalendar.css";
|
|
3
3
|
import { MulticalendarPropsType } from "./types";
|
|
4
|
-
declare const Multicalendar: ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible, cellsWidth, cellsHeight, verticalAxisWidth, horizontalAxisHeight, pastDaysInitialQuantity, futureDaysInitialQuantity, chunkRenderX, chunkRenderY, dynamicDaysQuantity, draggingOverDateCells, waitTimeForCalls, callsOnInitialView,
|
|
4
|
+
declare const Multicalendar: ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible, cellsWidth, cellsHeight, verticalAxisWidth, horizontalAxisHeight, pastDaysInitialQuantity, futureDaysInitialQuantity, chunkRenderX, chunkRenderY, dynamicDaysQuantity, draggingOverDateCells, waitTimeForCalls, callsOnInitialView, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }: MulticalendarPropsType) => JSX.Element;
|
|
5
5
|
export default Multicalendar;
|
|
@@ -14,7 +14,7 @@ import useWindowSize from "../../hooks/useWindowsSize";
|
|
|
14
14
|
import sqlToJsDate from "../../utils/sqlToJsDate";
|
|
15
15
|
//Services
|
|
16
16
|
import { eraseMulticalendarYScrollPosition, getMulticalendarYScrollPosition, } from "../../Services/MulticalendarStatesAndSettings";
|
|
17
|
-
const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible = true, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, horizontalAxisHeight = 148, pastDaysInitialQuantity = 365, futureDaysInitialQuantity = 365, chunkRenderX = 0, chunkRenderY = 0, dynamicDaysQuantity = false, draggingOverDateCells = false, waitTimeForCalls = 500, callsOnInitialView,
|
|
17
|
+
const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible = true, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, horizontalAxisHeight = 148, pastDaysInitialQuantity = 365, futureDaysInitialQuantity = 365, chunkRenderX = 0, chunkRenderY = 0, dynamicDaysQuantity = false, draggingOverDateCells = false, waitTimeForCalls = 500, callsOnInitialView, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }) => {
|
|
18
18
|
//Constantes del componente
|
|
19
19
|
const origin = {
|
|
20
20
|
x: pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) * cellsWidth : 0,
|
|
@@ -86,12 +86,6 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
86
86
|
visibleDates,
|
|
87
87
|
callsOnInitialView,
|
|
88
88
|
]);
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
if (callsOnElementIdsListChanges && visibleListElementsIds.length > 0) {
|
|
91
|
-
callsOnElementIdsListChanges(visibleListElementsIds, visibleDates);
|
|
92
|
-
}
|
|
93
|
-
// eslint-disable-next-line
|
|
94
|
-
}, [listElementsIdsArray]);
|
|
95
89
|
useEffect(() => {
|
|
96
90
|
// Posicionamiento inicial en X
|
|
97
91
|
if (gridWrapperRef.current !== null) {
|
|
@@ -198,14 +192,11 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
198
192
|
}
|
|
199
193
|
}, [xPosition, yPosition, idTimeoutForCalls, waitTimeForCalls]);
|
|
200
194
|
useEffect(() => {
|
|
201
|
-
if (scrollingOnCourse &&
|
|
202
|
-
callsOnScrollingMoves(visibleListElementsIds, visibleDates);
|
|
203
|
-
}
|
|
204
|
-
else if (!scrollingOnCourse && callsOnScrollingStops) {
|
|
195
|
+
if (!scrollingOnCourse && callsOnScrollingStops) {
|
|
205
196
|
callsOnScrollingStops(visibleListElementsIds, visibleDates);
|
|
206
197
|
}
|
|
207
198
|
// eslint-disable-next-line
|
|
208
|
-
}, [scrollingOnCourse]);
|
|
199
|
+
}, [scrollingOnCourse, visibleListElementsIds, visibleDates]);
|
|
209
200
|
//Cancelar idIntervalo Autoscroll de rango cuando se deja de seleccionar
|
|
210
201
|
useEffect(() => {
|
|
211
202
|
if (!draggingOverDateCells) {
|
|
@@ -6,7 +6,7 @@ export interface MulticalendarPropsType {
|
|
|
6
6
|
ReactListElementChildren: ReactListElementChildrenType;
|
|
7
7
|
listElementsIdsArray: string[] | number[];
|
|
8
8
|
language: languageType;
|
|
9
|
-
pastDatesVisible?: boolean
|
|
9
|
+
pastDatesVisible?: boolean;
|
|
10
10
|
cellsWidth?: number;
|
|
11
11
|
cellsHeight?: number;
|
|
12
12
|
verticalAxisWidth?: number;
|
|
@@ -19,11 +19,9 @@ export interface MulticalendarPropsType {
|
|
|
19
19
|
dynamicDaysQuantity?: boolean;
|
|
20
20
|
waitTimeForCalls?: number;
|
|
21
21
|
callsOnInitialView?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
22
|
-
callsOnElementIdsListChanges?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
23
|
-
callsOnScrollingMoves?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
24
22
|
callsOnScrollingStops?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
|
|
25
|
-
aditionalControlsComponents?: JSX.Element | JSX.Element[]
|
|
26
|
-
upperLeftComponent?: JSX.Element
|
|
23
|
+
aditionalControlsComponents?: JSX.Element | JSX.Element[];
|
|
24
|
+
upperLeftComponent?: JSX.Element;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
export interface RenderCoordinatesType {
|