josenanodev-react-components-library 0.0.11 → 0.0.15
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/README.md +4 -4
- package/dist/cjs/Services/MulticalendarStatesAndSettings.d.ts +17 -17
- package/dist/cjs/Services/MulticalendarStatesAndSettings.js +29 -29
- package/dist/cjs/Services/accessToken.d.ts +3 -3
- package/dist/cjs/Services/accessToken.js +15 -15
- package/dist/cjs/common/constants.d.ts +5 -5
- package/dist/cjs/common/constants.js +8 -8
- package/dist/cjs/common/turboSuiteUrls.d.ts +7 -7
- package/dist/cjs/common/turboSuiteUrls.js +9 -9
- package/dist/cjs/common/types.d.ts +113 -113
- package/dist/cjs/components/Modal/Modal.css +43 -0
- package/dist/cjs/components/Modal/Modal.d.ts +5 -0
- package/dist/cjs/components/Modal/Modal.js +82 -0
- package/dist/cjs/components/Modal/types.d.ts +9 -0
- package/dist/cjs/components/Multicalendar/Multicalendar.css +191 -191
- package/dist/cjs/components/Multicalendar/Multicalendar.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/Multicalendar.js +302 -302
- package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.d.ts +86 -86
- package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.js +192 -192
- package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.css +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.js +20 -20
- package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/types.d.ts +11 -11
- package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +7 -7
- package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.js +20 -20
- package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/types.d.ts +13 -13
- package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.css +3 -3
- package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.js +15 -15
- package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/types.d.ts +9 -9
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/Cell.css +7 -7
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/Cell.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/Cell.js +12 -12
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/types.d.ts +10 -10
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.css +60 -60
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +56 -56
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/types.d.ts +10 -10
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.css +13 -13
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.js +13 -13
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/types.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.css +14 -14
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.d.ts +5 -5
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.js +14 -14
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/types.d.ts +7 -7
- package/dist/cjs/components/Multicalendar/types.d.ts +45 -45
- package/dist/cjs/components/PopUp/PopUp.css +15 -0
- package/dist/cjs/components/PopUp/PopUp.d.ts +5 -0
- package/dist/cjs/components/PopUp/PopUp.js +50 -0
- package/dist/cjs/components/PopUp/types.d.ts +8 -0
- package/dist/cjs/components/SearchBar/SearchBar.css +35 -0
- package/dist/cjs/components/SearchBar/SearchBar.d.ts +5 -0
- package/dist/cjs/components/SearchBar/SearchBar.js +67 -0
- package/dist/cjs/components/SearchBar/types.d.ts +10 -0
- package/dist/cjs/components/SideBar/SideBar.css +50 -50
- package/dist/cjs/components/SideBar/SideBar.d.ts +8 -8
- package/dist/cjs/components/SideBar/SideBar.js +70 -70
- package/dist/cjs/components/SideBar/types.d.ts +8 -8
- package/dist/cjs/hooks/useOutsideClick.d.ts +6 -6
- package/dist/cjs/hooks/useOutsideClick.js +25 -25
- package/dist/cjs/hooks/useResizeObserver.d.ts +7 -7
- package/dist/cjs/hooks/useResizeObserver.js +30 -30
- package/dist/cjs/hooks/useWindowsSize.d.ts +6 -6
- package/dist/cjs/hooks/useWindowsSize.js +20 -20
- package/dist/cjs/index.css +77 -77
- package/dist/cjs/index.d.ts +7 -4
- package/dist/cjs/index.js +18 -12
- package/dist/cjs/languages/en-EN.d.ts +3 -3
- package/dist/cjs/languages/en-EN.js +25 -25
- package/dist/cjs/languages/es-ES.d.ts +3 -3
- package/dist/cjs/languages/es-ES.js +25 -25
- package/dist/cjs/languages/it-IT.d.ts +3 -3
- package/dist/cjs/languages/it-IT.js +25 -25
- package/dist/cjs/languages/types.d.ts +21 -21
- package/dist/cjs/mocks/ReactComponentMocksForTesting/CellChildrenMock.d.ts +4 -4
- package/dist/cjs/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +13 -13
- package/dist/cjs/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.d.ts +4 -4
- package/dist/cjs/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.js +10 -10
- package/dist/cjs/react-app-env.d.ts +1 -1
- package/dist/cjs/setupTests.d.ts +2 -2
- package/dist/cjs/setupTests.js +8 -8
- package/dist/cjs/stories/css-presets.css +77 -77
- package/dist/cjs/utils/datesArray.d.ts +8 -8
- package/dist/cjs/utils/datesArray.js +23 -23
- package/dist/cjs/utils/jsToSqlDate.d.ts +7 -7
- package/dist/cjs/utils/jsToSqlDate.js +22 -22
- package/dist/cjs/utils/monthYearString.d.ts +3 -3
- package/dist/cjs/utils/monthYearString.js +27 -27
- package/dist/cjs/utils/numberOfDaysInAMonth.d.ts +6 -6
- package/dist/cjs/utils/numberOfDaysInAMonth.js +12 -12
- package/dist/cjs/utils/sqlToJsDate.d.ts +7 -7
- package/dist/cjs/utils/sqlToJsDate.js +14 -14
- package/dist/esm/Services/MulticalendarStatesAndSettings.d.ts +17 -17
- package/dist/esm/Services/MulticalendarStatesAndSettings.js +23 -23
- package/dist/esm/Services/accessToken.d.ts +3 -3
- package/dist/esm/Services/accessToken.js +9 -9
- package/dist/esm/common/constants.d.ts +5 -5
- package/dist/esm/common/constants.js +5 -5
- package/dist/esm/common/turboSuiteUrls.d.ts +7 -7
- package/dist/esm/common/turboSuiteUrls.js +7 -7
- package/dist/esm/common/types.d.ts +113 -113
- package/dist/esm/components/Modal/Modal.css +43 -0
- package/dist/esm/components/Modal/Modal.d.ts +5 -0
- package/dist/esm/components/Modal/Modal.js +54 -0
- package/dist/esm/components/Modal/types.d.ts +9 -0
- package/dist/esm/components/Multicalendar/Multicalendar.css +191 -191
- package/dist/esm/components/Multicalendar/Multicalendar.d.ts +5 -5
- package/dist/esm/components/Multicalendar/Multicalendar.js +274 -274
- package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.d.ts +86 -86
- package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.js +176 -176
- package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.css +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.js +15 -15
- package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/types.d.ts +11 -11
- package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +7 -7
- package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.js +15 -15
- package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/types.d.ts +13 -13
- package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.css +3 -3
- package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.js +10 -10
- package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/types.d.ts +9 -9
- package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/Cell.css +7 -7
- package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/Cell.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/Cell.js +7 -7
- package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/types.d.ts +10 -10
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.css +60 -60
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +51 -51
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/types.d.ts +10 -10
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.css +13 -13
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.js +8 -8
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/types.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.css +14 -14
- package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.d.ts +5 -5
- package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.js +9 -9
- package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/types.d.ts +7 -7
- package/dist/esm/components/Multicalendar/types.d.ts +45 -45
- package/dist/esm/components/PopUp/PopUp.css +15 -0
- package/dist/esm/components/PopUp/PopUp.d.ts +5 -0
- package/dist/esm/components/PopUp/PopUp.js +22 -0
- package/dist/esm/components/PopUp/types.d.ts +8 -0
- package/dist/esm/components/SearchBar/SearchBar.css +35 -0
- package/dist/esm/components/SearchBar/SearchBar.d.ts +5 -0
- package/dist/esm/components/SearchBar/SearchBar.js +42 -0
- package/dist/esm/components/SearchBar/types.d.ts +10 -0
- package/dist/esm/components/SideBar/SideBar.css +50 -50
- package/dist/esm/components/SideBar/SideBar.d.ts +8 -8
- package/dist/esm/components/SideBar/SideBar.js +42 -42
- package/dist/esm/components/SideBar/types.d.ts +8 -8
- package/dist/esm/hooks/useOutsideClick.d.ts +6 -6
- package/dist/esm/hooks/useOutsideClick.js +23 -23
- package/dist/esm/hooks/useResizeObserver.d.ts +7 -7
- package/dist/esm/hooks/useResizeObserver.js +28 -28
- package/dist/esm/hooks/useWindowsSize.d.ts +6 -6
- package/dist/esm/hooks/useWindowsSize.js +18 -18
- package/dist/esm/index.css +77 -77
- package/dist/esm/index.d.ts +7 -4
- package/dist/esm/index.js +7 -4
- package/dist/esm/languages/en-EN.d.ts +3 -3
- package/dist/esm/languages/en-EN.js +23 -23
- package/dist/esm/languages/es-ES.d.ts +3 -3
- package/dist/esm/languages/es-ES.js +23 -23
- package/dist/esm/languages/it-IT.d.ts +3 -3
- package/dist/esm/languages/it-IT.js +23 -23
- package/dist/esm/languages/types.d.ts +21 -21
- package/dist/esm/mocks/ReactComponentMocksForTesting/CellChildrenMock.d.ts +4 -4
- package/dist/esm/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +8 -8
- package/dist/esm/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.d.ts +4 -4
- package/dist/esm/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.js +5 -5
- package/dist/esm/react-app-env.d.ts +1 -1
- package/dist/esm/setupTests.d.ts +2 -2
- package/dist/esm/setupTests.js +6 -6
- package/dist/esm/stories/css-presets.css +77 -77
- package/dist/esm/utils/datesArray.d.ts +8 -8
- package/dist/esm/utils/datesArray.js +21 -21
- package/dist/esm/utils/jsToSqlDate.d.ts +7 -7
- package/dist/esm/utils/jsToSqlDate.js +20 -20
- package/dist/esm/utils/monthYearString.d.ts +3 -3
- package/dist/esm/utils/monthYearString.js +25 -25
- package/dist/esm/utils/numberOfDaysInAMonth.d.ts +6 -6
- package/dist/esm/utils/numberOfDaysInAMonth.js +8 -8
- package/dist/esm/utils/sqlToJsDate.d.ts +7 -7
- package/dist/esm/utils/sqlToJsDate.js +12 -12
- package/package.json +103 -93
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { languageType } from "../../languages/types";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param dateObject Date Object
|
|
6
|
-
* @param elementRef ref of the element that will be scrolled
|
|
7
|
-
* @param leftPagination number of cells to the left
|
|
8
|
-
* @param cellsWidth width of cells
|
|
9
|
-
*/
|
|
10
|
-
export declare function scrollByDate(dateObject: Date, elementRef: React.RefObject<HTMLDivElement>, leftPagination: number, cellsWidth: number): void;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param xPosition position X of grid
|
|
14
|
-
* @param cellsWidth width of grid cells
|
|
15
|
-
* @param leftPagination number of cells to the left
|
|
16
|
-
* @param initialDateOffset offset of cells for the initial date
|
|
17
|
-
* @returns milliseconds of the minimal date
|
|
18
|
-
*/
|
|
19
|
-
export declare function minimalDateMilliseconds(xPosition: number, cellsWidth: number, leftPagination: number, initialDateOffset: number): number;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param millisecondsOfMinimalDate milliseconds of the minimal date
|
|
23
|
-
* @param initialDateOffset offset of number of cells for initial date
|
|
24
|
-
* @returns The minimal visible date object
|
|
25
|
-
*/
|
|
26
|
-
export declare function defineMinimalVisibleDate(millisecondsOfMinimalDate: number, initialDateOffset: number): Date;
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param xPosition current x position in the grid horizontal scroll
|
|
30
|
-
* @param cellsWidth width of grid cells
|
|
31
|
-
* @param chunkRenderX extra rendered cells in a row
|
|
32
|
-
* @returns number X offset
|
|
33
|
-
*/
|
|
34
|
-
export declare function defineXOffset(xPosition: number, cellsWidth: number, chunkRenderX: number): number;
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @param paginationWidth width of pagination of horizontal axis of the grid
|
|
38
|
-
* @param chunkRenderX extra rendered cells in every row
|
|
39
|
-
* @param minimalDateMilliseconds milliseconds of the minimal date
|
|
40
|
-
* @returns an array containing all the dates that should be rendered base on position of x scroll
|
|
41
|
-
*/
|
|
42
|
-
export declare function defineVisibleDatesArray(paginationWidth: number, chunkRenderX: number, minimalDateMilliseconds: number): Date[];
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param yPosition current y position in the grid vertical scroll
|
|
46
|
-
* @param cellsHeight height of grid cells
|
|
47
|
-
* @param chunkRenderY extra rendered cells in every column
|
|
48
|
-
* @returns number Y offset
|
|
49
|
-
*/
|
|
50
|
-
export declare function defineYOffset(yPosition: number, cellsHeight: number, chunkRenderY: number): number;
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param paginationHeight height of pagination of the vertical axis of the grid
|
|
54
|
-
* @param chunkRenderY extra rendered cells in every column
|
|
55
|
-
* @param offset offset from top of the list
|
|
56
|
-
* @param listElementsIds all ids array
|
|
57
|
-
* @returns Array of the destinies that will be rendered
|
|
58
|
-
*/
|
|
59
|
-
export declare function defineListElementsArrayVisibleList(paginationHeight: number, chunkRenderY: number, offset: number, listElementsIds: string[] | number[]): string[] | number[];
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @param leftPagination number of cells to the left
|
|
63
|
-
* @param language language object for traductions
|
|
64
|
-
* @returns string of the date, month followed by year
|
|
65
|
-
*/
|
|
66
|
-
export declare function defineMonthsArray(leftPagination: number, rightPagination: number, language: languageType): JSX.Element[];
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @param holdingClic boolean to know if mouse id down
|
|
70
|
-
* @param xClientPosition position x of the client
|
|
71
|
-
* @param yClientPosition position y of the client
|
|
72
|
-
* @param widthHorizontalBorder horizontal border of activation
|
|
73
|
-
* @param widthVerticalBorder vertical border of activation
|
|
74
|
-
* @param gridRef ref ofthe grid container
|
|
75
|
-
*/
|
|
76
|
-
export declare function startAuthomaticScrollInGrid(holdingClic: boolean, xClientPosition: number, yClientPosition: number, widthHorizontalBorder: number, widthVerticalBorder: number, gridRef: React.RefObject<HTMLDivElement>): void;
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* @param holdingClic boolean to know if mouse id down
|
|
80
|
-
* @param xClientPosition position x of the client
|
|
81
|
-
* @param yClientPosition position y of the client
|
|
82
|
-
* @param widthHorizontalBorder horizontal border of activation
|
|
83
|
-
* @param widthVerticalBorder vertical border of activation
|
|
84
|
-
* @param gridContainer grid container
|
|
85
|
-
*/
|
|
86
|
-
export declare function authomaticScrollInGrid(holdingClic: boolean, xClientPosition: number | undefined, yClientPosition: number | undefined, widthHorizontalBorder: number, widthVerticalBorder: number, gridContainer: HTMLDivElement): void;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { languageType } from "../../languages/types";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param dateObject Date Object
|
|
6
|
+
* @param elementRef ref of the element that will be scrolled
|
|
7
|
+
* @param leftPagination number of cells to the left
|
|
8
|
+
* @param cellsWidth width of cells
|
|
9
|
+
*/
|
|
10
|
+
export declare function scrollByDate(dateObject: Date, elementRef: React.RefObject<HTMLDivElement>, leftPagination: number, cellsWidth: number): void;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param xPosition position X of grid
|
|
14
|
+
* @param cellsWidth width of grid cells
|
|
15
|
+
* @param leftPagination number of cells to the left
|
|
16
|
+
* @param initialDateOffset offset of cells for the initial date
|
|
17
|
+
* @returns milliseconds of the minimal date
|
|
18
|
+
*/
|
|
19
|
+
export declare function minimalDateMilliseconds(xPosition: number, cellsWidth: number, leftPagination: number, initialDateOffset: number): number;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param millisecondsOfMinimalDate milliseconds of the minimal date
|
|
23
|
+
* @param initialDateOffset offset of number of cells for initial date
|
|
24
|
+
* @returns The minimal visible date object
|
|
25
|
+
*/
|
|
26
|
+
export declare function defineMinimalVisibleDate(millisecondsOfMinimalDate: number, initialDateOffset: number): Date;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param xPosition current x position in the grid horizontal scroll
|
|
30
|
+
* @param cellsWidth width of grid cells
|
|
31
|
+
* @param chunkRenderX extra rendered cells in a row
|
|
32
|
+
* @returns number X offset
|
|
33
|
+
*/
|
|
34
|
+
export declare function defineXOffset(xPosition: number, cellsWidth: number, chunkRenderX: number): number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param paginationWidth width of pagination of horizontal axis of the grid
|
|
38
|
+
* @param chunkRenderX extra rendered cells in every row
|
|
39
|
+
* @param minimalDateMilliseconds milliseconds of the minimal date
|
|
40
|
+
* @returns an array containing all the dates that should be rendered base on position of x scroll
|
|
41
|
+
*/
|
|
42
|
+
export declare function defineVisibleDatesArray(paginationWidth: number, chunkRenderX: number, minimalDateMilliseconds: number): Date[];
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param yPosition current y position in the grid vertical scroll
|
|
46
|
+
* @param cellsHeight height of grid cells
|
|
47
|
+
* @param chunkRenderY extra rendered cells in every column
|
|
48
|
+
* @returns number Y offset
|
|
49
|
+
*/
|
|
50
|
+
export declare function defineYOffset(yPosition: number, cellsHeight: number, chunkRenderY: number): number;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param paginationHeight height of pagination of the vertical axis of the grid
|
|
54
|
+
* @param chunkRenderY extra rendered cells in every column
|
|
55
|
+
* @param offset offset from top of the list
|
|
56
|
+
* @param listElementsIds all ids array
|
|
57
|
+
* @returns Array of the destinies that will be rendered
|
|
58
|
+
*/
|
|
59
|
+
export declare function defineListElementsArrayVisibleList(paginationHeight: number, chunkRenderY: number, offset: number, listElementsIds: string[] | number[]): string[] | number[];
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param leftPagination number of cells to the left
|
|
63
|
+
* @param language language object for traductions
|
|
64
|
+
* @returns string of the date, month followed by year
|
|
65
|
+
*/
|
|
66
|
+
export declare function defineMonthsArray(leftPagination: number, rightPagination: number, language: languageType): JSX.Element[];
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param holdingClic boolean to know if mouse id down
|
|
70
|
+
* @param xClientPosition position x of the client
|
|
71
|
+
* @param yClientPosition position y of the client
|
|
72
|
+
* @param widthHorizontalBorder horizontal border of activation
|
|
73
|
+
* @param widthVerticalBorder vertical border of activation
|
|
74
|
+
* @param gridRef ref ofthe grid container
|
|
75
|
+
*/
|
|
76
|
+
export declare function startAuthomaticScrollInGrid(holdingClic: boolean, xClientPosition: number, yClientPosition: number, widthHorizontalBorder: number, widthVerticalBorder: number, gridRef: React.RefObject<HTMLDivElement>): void;
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @param holdingClic boolean to know if mouse id down
|
|
80
|
+
* @param xClientPosition position x of the client
|
|
81
|
+
* @param yClientPosition position y of the client
|
|
82
|
+
* @param widthHorizontalBorder horizontal border of activation
|
|
83
|
+
* @param widthVerticalBorder vertical border of activation
|
|
84
|
+
* @param gridContainer grid container
|
|
85
|
+
*/
|
|
86
|
+
export declare function authomaticScrollInGrid(holdingClic: boolean, xClientPosition: number | undefined, yClientPosition: number | undefined, widthHorizontalBorder: number, widthVerticalBorder: number, gridContainer: HTMLDivElement): void;
|
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.authomaticScrollInGrid = exports.startAuthomaticScrollInGrid = exports.defineMonthsArray = exports.defineListElementsArrayVisibleList = exports.defineYOffset = exports.defineVisibleDatesArray = exports.defineXOffset = exports.defineMinimalVisibleDate = exports.minimalDateMilliseconds = exports.scrollByDate = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
//Utils
|
|
9
|
-
const jsToSqlDate_1 = __importDefault(require("../../utils/jsToSqlDate"));
|
|
10
|
-
const monthYearString_1 = __importDefault(require("../../utils/monthYearString"));
|
|
11
|
-
//Variables
|
|
12
|
-
const constants_1 = require("../../common/constants");
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param dateObject Date Object
|
|
16
|
-
* @param elementRef ref of the element that will be scrolled
|
|
17
|
-
* @param leftPagination number of cells to the left
|
|
18
|
-
* @param cellsWidth width of cells
|
|
19
|
-
*/
|
|
20
|
-
function scrollByDate(dateObject, elementRef, leftPagination, cellsWidth) {
|
|
21
|
-
//nueva posicion de scroll horizontal = cantidad de dias hasta hoy * ancho de celda
|
|
22
|
-
if (elementRef.current !== null) {
|
|
23
|
-
elementRef.current.scrollLeft =
|
|
24
|
-
((Date.parse(dateObject.toString()) -
|
|
25
|
-
(Date.parse(new Date().toString()) -
|
|
26
|
-
(leftPagination + 1) * constants_1.millisecondsOfOneDay)) /
|
|
27
|
-
constants_1.millisecondsOfOneDay) *
|
|
28
|
-
cellsWidth;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.scrollByDate = scrollByDate;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param xPosition position X of grid
|
|
35
|
-
* @param cellsWidth width of grid cells
|
|
36
|
-
* @param leftPagination number of cells to the left
|
|
37
|
-
* @param initialDateOffset offset of cells for the initial date
|
|
38
|
-
* @returns milliseconds of the minimal date
|
|
39
|
-
*/
|
|
40
|
-
function minimalDateMilliseconds(xPosition, cellsWidth, leftPagination, initialDateOffset) {
|
|
41
|
-
let minimalDate = new Date(Date.parse(new Date().toString()) +
|
|
42
|
-
constants_1.millisecondsOfOneDay *
|
|
43
|
-
(Math.floor(xPosition / cellsWidth) - leftPagination - initialDateOffset));
|
|
44
|
-
minimalDate.setHours(12, 0, 0, 0);
|
|
45
|
-
return Date.parse(minimalDate.toString());
|
|
46
|
-
}
|
|
47
|
-
exports.minimalDateMilliseconds = minimalDateMilliseconds;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param millisecondsOfMinimalDate milliseconds of the minimal date
|
|
51
|
-
* @param initialDateOffset offset of number of cells for initial date
|
|
52
|
-
* @returns The minimal visible date object
|
|
53
|
-
*/
|
|
54
|
-
function defineMinimalVisibleDate(millisecondsOfMinimalDate, initialDateOffset) {
|
|
55
|
-
return new Date(millisecondsOfMinimalDate + initialDateOffset * constants_1.millisecondsOfOneDay);
|
|
56
|
-
}
|
|
57
|
-
exports.defineMinimalVisibleDate = defineMinimalVisibleDate;
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* @param xPosition current x position in the grid horizontal scroll
|
|
61
|
-
* @param cellsWidth width of grid cells
|
|
62
|
-
* @param chunkRenderX extra rendered cells in a row
|
|
63
|
-
* @returns number X offset
|
|
64
|
-
*/
|
|
65
|
-
function defineXOffset(xPosition, cellsWidth, chunkRenderX) {
|
|
66
|
-
return Math.floor(xPosition / cellsWidth) - chunkRenderX;
|
|
67
|
-
}
|
|
68
|
-
exports.defineXOffset = defineXOffset;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @param paginationWidth width of pagination of horizontal axis of the grid
|
|
72
|
-
* @param chunkRenderX extra rendered cells in every row
|
|
73
|
-
* @param minimalDateMilliseconds milliseconds of the minimal date
|
|
74
|
-
* @returns an array containing all the dates that should be rendered base on position of x scroll
|
|
75
|
-
*/
|
|
76
|
-
function defineVisibleDatesArray(paginationWidth, chunkRenderX, minimalDateMilliseconds) {
|
|
77
|
-
let array = [];
|
|
78
|
-
for (let index = 0; index < paginationWidth + chunkRenderX * 2; index++) {
|
|
79
|
-
array[index] = new Date(minimalDateMilliseconds + constants_1.millisecondsOfOneDay * (index + 1));
|
|
80
|
-
}
|
|
81
|
-
return array;
|
|
82
|
-
}
|
|
83
|
-
exports.defineVisibleDatesArray = defineVisibleDatesArray;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @param yPosition current y position in the grid vertical scroll
|
|
87
|
-
* @param cellsHeight height of grid cells
|
|
88
|
-
* @param chunkRenderY extra rendered cells in every column
|
|
89
|
-
* @returns number Y offset
|
|
90
|
-
*/
|
|
91
|
-
function defineYOffset(yPosition, cellsHeight, chunkRenderY) {
|
|
92
|
-
let desfase = Math.floor(yPosition / cellsHeight) - chunkRenderY;
|
|
93
|
-
if (desfase < 0)
|
|
94
|
-
desfase = 0;
|
|
95
|
-
return desfase;
|
|
96
|
-
}
|
|
97
|
-
exports.defineYOffset = defineYOffset;
|
|
98
|
-
/**
|
|
99
|
-
*
|
|
100
|
-
* @param paginationHeight height of pagination of the vertical axis of the grid
|
|
101
|
-
* @param chunkRenderY extra rendered cells in every column
|
|
102
|
-
* @param offset offset from top of the list
|
|
103
|
-
* @param listElementsIds all ids array
|
|
104
|
-
* @returns Array of the destinies that will be rendered
|
|
105
|
-
*/
|
|
106
|
-
function defineListElementsArrayVisibleList(paginationHeight, chunkRenderY, offset, listElementsIds) {
|
|
107
|
-
let array = [];
|
|
108
|
-
for (let index = 0; index < paginationHeight + chunkRenderY * 2; index++) {
|
|
109
|
-
if (listElementsIds[index + offset] && index + offset >= 0)
|
|
110
|
-
array[index] = listElementsIds[index + offset];
|
|
111
|
-
}
|
|
112
|
-
return array;
|
|
113
|
-
}
|
|
114
|
-
exports.defineListElementsArrayVisibleList = defineListElementsArrayVisibleList;
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
* @param leftPagination number of cells to the left
|
|
118
|
-
* @param language language object for traductions
|
|
119
|
-
* @returns string of the date, month followed by year
|
|
120
|
-
*/
|
|
121
|
-
function defineMonthsArray(leftPagination, rightPagination, language) {
|
|
122
|
-
let minimumDateMilliseconds = Date.parse(new Date().toString()) - leftPagination * constants_1.millisecondsOfOneDay;
|
|
123
|
-
let maximumDateMilliseconds = Date.parse(new Date().toString()) + rightPagination * constants_1.millisecondsOfOneDay;
|
|
124
|
-
let array = [];
|
|
125
|
-
let sideArray = [];
|
|
126
|
-
for (let index = 0; index * constants_1.millisecondsOfOneDay + minimumDateMilliseconds < maximumDateMilliseconds; index++) {
|
|
127
|
-
let dateObject = new Date(constants_1.millisecondsOfOneDay * index + minimumDateMilliseconds);
|
|
128
|
-
let firstDayOfTheMonth = dateObject;
|
|
129
|
-
firstDayOfTheMonth.setDate(1);
|
|
130
|
-
firstDayOfTheMonth.setHours(12, 0, 0, 0);
|
|
131
|
-
let dateString = (0, monthYearString_1.default)(dateObject, language);
|
|
132
|
-
if (!sideArray.includes(dateString)) {
|
|
133
|
-
sideArray.push(dateString);
|
|
134
|
-
array.push(react_1.default.createElement("option", {
|
|
135
|
-
key: (0, jsToSqlDate_1.default)(firstDayOfTheMonth),
|
|
136
|
-
value: (0, jsToSqlDate_1.default)(firstDayOfTheMonth),
|
|
137
|
-
}, dateString));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return array;
|
|
141
|
-
}
|
|
142
|
-
exports.defineMonthsArray = defineMonthsArray;
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
* @param holdingClic boolean to know if mouse id down
|
|
146
|
-
* @param xClientPosition position x of the client
|
|
147
|
-
* @param yClientPosition position y of the client
|
|
148
|
-
* @param widthHorizontalBorder horizontal border of activation
|
|
149
|
-
* @param widthVerticalBorder vertical border of activation
|
|
150
|
-
* @param gridRef ref ofthe grid container
|
|
151
|
-
*/
|
|
152
|
-
function startAuthomaticScrollInGrid(holdingClic, xClientPosition, yClientPosition, widthHorizontalBorder, widthVerticalBorder, gridRef) {
|
|
153
|
-
if (holdingClic && gridRef.current !== null) {
|
|
154
|
-
if (xClientPosition < widthHorizontalBorder)
|
|
155
|
-
gridRef.current.scrollLeft -= 10;
|
|
156
|
-
if (xClientPosition > gridRef.current.offsetWidth - widthHorizontalBorder)
|
|
157
|
-
gridRef.current.scrollLeft += 10;
|
|
158
|
-
if (yClientPosition < widthVerticalBorder)
|
|
159
|
-
gridRef.current.scrollTop -= 10;
|
|
160
|
-
if (yClientPosition > gridRef.current.offsetHeight - widthVerticalBorder)
|
|
161
|
-
gridRef.current.scrollTop += 10;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
exports.startAuthomaticScrollInGrid = startAuthomaticScrollInGrid;
|
|
165
|
-
/**
|
|
166
|
-
*
|
|
167
|
-
* @param holdingClic boolean to know if mouse id down
|
|
168
|
-
* @param xClientPosition position x of the client
|
|
169
|
-
* @param yClientPosition position y of the client
|
|
170
|
-
* @param widthHorizontalBorder horizontal border of activation
|
|
171
|
-
* @param widthVerticalBorder vertical border of activation
|
|
172
|
-
* @param gridContainer grid container
|
|
173
|
-
*/
|
|
174
|
-
function authomaticScrollInGrid(holdingClic, xClientPosition, yClientPosition, widthHorizontalBorder, widthVerticalBorder, gridContainer) {
|
|
175
|
-
if (holdingClic) {
|
|
176
|
-
if (xClientPosition) {
|
|
177
|
-
if (xClientPosition < widthHorizontalBorder)
|
|
178
|
-
gridContainer.scrollLeft -= widthHorizontalBorder - xClientPosition;
|
|
179
|
-
if (xClientPosition > gridContainer.offsetWidth - widthHorizontalBorder)
|
|
180
|
-
gridContainer.scrollLeft +=
|
|
181
|
-
xClientPosition + widthHorizontalBorder - gridContainer.offsetWidth;
|
|
182
|
-
}
|
|
183
|
-
if (yClientPosition) {
|
|
184
|
-
if (yClientPosition < widthVerticalBorder)
|
|
185
|
-
gridContainer.scrollTop -= widthVerticalBorder - yClientPosition;
|
|
186
|
-
if (yClientPosition > gridContainer.offsetHeight - widthVerticalBorder)
|
|
187
|
-
gridContainer.scrollTop +=
|
|
188
|
-
yClientPosition + widthVerticalBorder - gridContainer.offsetHeight;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
exports.authomaticScrollInGrid = authomaticScrollInGrid;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.authomaticScrollInGrid = exports.startAuthomaticScrollInGrid = exports.defineMonthsArray = exports.defineListElementsArrayVisibleList = exports.defineYOffset = exports.defineVisibleDatesArray = exports.defineXOffset = exports.defineMinimalVisibleDate = exports.minimalDateMilliseconds = exports.scrollByDate = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
//Utils
|
|
9
|
+
const jsToSqlDate_1 = __importDefault(require("../../utils/jsToSqlDate"));
|
|
10
|
+
const monthYearString_1 = __importDefault(require("../../utils/monthYearString"));
|
|
11
|
+
//Variables
|
|
12
|
+
const constants_1 = require("../../common/constants");
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param dateObject Date Object
|
|
16
|
+
* @param elementRef ref of the element that will be scrolled
|
|
17
|
+
* @param leftPagination number of cells to the left
|
|
18
|
+
* @param cellsWidth width of cells
|
|
19
|
+
*/
|
|
20
|
+
function scrollByDate(dateObject, elementRef, leftPagination, cellsWidth) {
|
|
21
|
+
//nueva posicion de scroll horizontal = cantidad de dias hasta hoy * ancho de celda
|
|
22
|
+
if (elementRef.current !== null) {
|
|
23
|
+
elementRef.current.scrollLeft =
|
|
24
|
+
((Date.parse(dateObject.toString()) -
|
|
25
|
+
(Date.parse(new Date().toString()) -
|
|
26
|
+
(leftPagination + 1) * constants_1.millisecondsOfOneDay)) /
|
|
27
|
+
constants_1.millisecondsOfOneDay) *
|
|
28
|
+
cellsWidth;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.scrollByDate = scrollByDate;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param xPosition position X of grid
|
|
35
|
+
* @param cellsWidth width of grid cells
|
|
36
|
+
* @param leftPagination number of cells to the left
|
|
37
|
+
* @param initialDateOffset offset of cells for the initial date
|
|
38
|
+
* @returns milliseconds of the minimal date
|
|
39
|
+
*/
|
|
40
|
+
function minimalDateMilliseconds(xPosition, cellsWidth, leftPagination, initialDateOffset) {
|
|
41
|
+
let minimalDate = new Date(Date.parse(new Date().toString()) +
|
|
42
|
+
constants_1.millisecondsOfOneDay *
|
|
43
|
+
(Math.floor(xPosition / cellsWidth) - leftPagination - initialDateOffset));
|
|
44
|
+
minimalDate.setHours(12, 0, 0, 0);
|
|
45
|
+
return Date.parse(minimalDate.toString());
|
|
46
|
+
}
|
|
47
|
+
exports.minimalDateMilliseconds = minimalDateMilliseconds;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param millisecondsOfMinimalDate milliseconds of the minimal date
|
|
51
|
+
* @param initialDateOffset offset of number of cells for initial date
|
|
52
|
+
* @returns The minimal visible date object
|
|
53
|
+
*/
|
|
54
|
+
function defineMinimalVisibleDate(millisecondsOfMinimalDate, initialDateOffset) {
|
|
55
|
+
return new Date(millisecondsOfMinimalDate + initialDateOffset * constants_1.millisecondsOfOneDay);
|
|
56
|
+
}
|
|
57
|
+
exports.defineMinimalVisibleDate = defineMinimalVisibleDate;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param xPosition current x position in the grid horizontal scroll
|
|
61
|
+
* @param cellsWidth width of grid cells
|
|
62
|
+
* @param chunkRenderX extra rendered cells in a row
|
|
63
|
+
* @returns number X offset
|
|
64
|
+
*/
|
|
65
|
+
function defineXOffset(xPosition, cellsWidth, chunkRenderX) {
|
|
66
|
+
return Math.floor(xPosition / cellsWidth) - chunkRenderX;
|
|
67
|
+
}
|
|
68
|
+
exports.defineXOffset = defineXOffset;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @param paginationWidth width of pagination of horizontal axis of the grid
|
|
72
|
+
* @param chunkRenderX extra rendered cells in every row
|
|
73
|
+
* @param minimalDateMilliseconds milliseconds of the minimal date
|
|
74
|
+
* @returns an array containing all the dates that should be rendered base on position of x scroll
|
|
75
|
+
*/
|
|
76
|
+
function defineVisibleDatesArray(paginationWidth, chunkRenderX, minimalDateMilliseconds) {
|
|
77
|
+
let array = [];
|
|
78
|
+
for (let index = 0; index < paginationWidth + chunkRenderX * 2; index++) {
|
|
79
|
+
array[index] = new Date(minimalDateMilliseconds + constants_1.millisecondsOfOneDay * (index + 1));
|
|
80
|
+
}
|
|
81
|
+
return array;
|
|
82
|
+
}
|
|
83
|
+
exports.defineVisibleDatesArray = defineVisibleDatesArray;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @param yPosition current y position in the grid vertical scroll
|
|
87
|
+
* @param cellsHeight height of grid cells
|
|
88
|
+
* @param chunkRenderY extra rendered cells in every column
|
|
89
|
+
* @returns number Y offset
|
|
90
|
+
*/
|
|
91
|
+
function defineYOffset(yPosition, cellsHeight, chunkRenderY) {
|
|
92
|
+
let desfase = Math.floor(yPosition / cellsHeight) - chunkRenderY;
|
|
93
|
+
if (desfase < 0)
|
|
94
|
+
desfase = 0;
|
|
95
|
+
return desfase;
|
|
96
|
+
}
|
|
97
|
+
exports.defineYOffset = defineYOffset;
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @param paginationHeight height of pagination of the vertical axis of the grid
|
|
101
|
+
* @param chunkRenderY extra rendered cells in every column
|
|
102
|
+
* @param offset offset from top of the list
|
|
103
|
+
* @param listElementsIds all ids array
|
|
104
|
+
* @returns Array of the destinies that will be rendered
|
|
105
|
+
*/
|
|
106
|
+
function defineListElementsArrayVisibleList(paginationHeight, chunkRenderY, offset, listElementsIds) {
|
|
107
|
+
let array = [];
|
|
108
|
+
for (let index = 0; index < paginationHeight + chunkRenderY * 2; index++) {
|
|
109
|
+
if (listElementsIds[index + offset] && index + offset >= 0)
|
|
110
|
+
array[index] = listElementsIds[index + offset];
|
|
111
|
+
}
|
|
112
|
+
return array;
|
|
113
|
+
}
|
|
114
|
+
exports.defineListElementsArrayVisibleList = defineListElementsArrayVisibleList;
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
* @param leftPagination number of cells to the left
|
|
118
|
+
* @param language language object for traductions
|
|
119
|
+
* @returns string of the date, month followed by year
|
|
120
|
+
*/
|
|
121
|
+
function defineMonthsArray(leftPagination, rightPagination, language) {
|
|
122
|
+
let minimumDateMilliseconds = Date.parse(new Date().toString()) - leftPagination * constants_1.millisecondsOfOneDay;
|
|
123
|
+
let maximumDateMilliseconds = Date.parse(new Date().toString()) + rightPagination * constants_1.millisecondsOfOneDay;
|
|
124
|
+
let array = [];
|
|
125
|
+
let sideArray = [];
|
|
126
|
+
for (let index = 0; index * constants_1.millisecondsOfOneDay + minimumDateMilliseconds < maximumDateMilliseconds; index++) {
|
|
127
|
+
let dateObject = new Date(constants_1.millisecondsOfOneDay * index + minimumDateMilliseconds);
|
|
128
|
+
let firstDayOfTheMonth = dateObject;
|
|
129
|
+
firstDayOfTheMonth.setDate(1);
|
|
130
|
+
firstDayOfTheMonth.setHours(12, 0, 0, 0);
|
|
131
|
+
let dateString = (0, monthYearString_1.default)(dateObject, language);
|
|
132
|
+
if (!sideArray.includes(dateString)) {
|
|
133
|
+
sideArray.push(dateString);
|
|
134
|
+
array.push(react_1.default.createElement("option", {
|
|
135
|
+
key: (0, jsToSqlDate_1.default)(firstDayOfTheMonth),
|
|
136
|
+
value: (0, jsToSqlDate_1.default)(firstDayOfTheMonth),
|
|
137
|
+
}, dateString));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return array;
|
|
141
|
+
}
|
|
142
|
+
exports.defineMonthsArray = defineMonthsArray;
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param holdingClic boolean to know if mouse id down
|
|
146
|
+
* @param xClientPosition position x of the client
|
|
147
|
+
* @param yClientPosition position y of the client
|
|
148
|
+
* @param widthHorizontalBorder horizontal border of activation
|
|
149
|
+
* @param widthVerticalBorder vertical border of activation
|
|
150
|
+
* @param gridRef ref ofthe grid container
|
|
151
|
+
*/
|
|
152
|
+
function startAuthomaticScrollInGrid(holdingClic, xClientPosition, yClientPosition, widthHorizontalBorder, widthVerticalBorder, gridRef) {
|
|
153
|
+
if (holdingClic && gridRef.current !== null) {
|
|
154
|
+
if (xClientPosition < widthHorizontalBorder)
|
|
155
|
+
gridRef.current.scrollLeft -= 10;
|
|
156
|
+
if (xClientPosition > gridRef.current.offsetWidth - widthHorizontalBorder)
|
|
157
|
+
gridRef.current.scrollLeft += 10;
|
|
158
|
+
if (yClientPosition < widthVerticalBorder)
|
|
159
|
+
gridRef.current.scrollTop -= 10;
|
|
160
|
+
if (yClientPosition > gridRef.current.offsetHeight - widthVerticalBorder)
|
|
161
|
+
gridRef.current.scrollTop += 10;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.startAuthomaticScrollInGrid = startAuthomaticScrollInGrid;
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* @param holdingClic boolean to know if mouse id down
|
|
168
|
+
* @param xClientPosition position x of the client
|
|
169
|
+
* @param yClientPosition position y of the client
|
|
170
|
+
* @param widthHorizontalBorder horizontal border of activation
|
|
171
|
+
* @param widthVerticalBorder vertical border of activation
|
|
172
|
+
* @param gridContainer grid container
|
|
173
|
+
*/
|
|
174
|
+
function authomaticScrollInGrid(holdingClic, xClientPosition, yClientPosition, widthHorizontalBorder, widthVerticalBorder, gridContainer) {
|
|
175
|
+
if (holdingClic) {
|
|
176
|
+
if (xClientPosition) {
|
|
177
|
+
if (xClientPosition < widthHorizontalBorder)
|
|
178
|
+
gridContainer.scrollLeft -= widthHorizontalBorder - xClientPosition;
|
|
179
|
+
if (xClientPosition > gridContainer.offsetWidth - widthHorizontalBorder)
|
|
180
|
+
gridContainer.scrollLeft +=
|
|
181
|
+
xClientPosition + widthHorizontalBorder - gridContainer.offsetWidth;
|
|
182
|
+
}
|
|
183
|
+
if (yClientPosition) {
|
|
184
|
+
if (yClientPosition < widthVerticalBorder)
|
|
185
|
+
gridContainer.scrollTop -= widthVerticalBorder - yClientPosition;
|
|
186
|
+
if (yClientPosition > gridContainer.offsetHeight - widthVerticalBorder)
|
|
187
|
+
gridContainer.scrollTop +=
|
|
188
|
+
yClientPosition + widthVerticalBorder - gridContainer.offsetHeight;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.authomaticScrollInGrid = authomaticScrollInGrid;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.cells-row {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-flow: row;
|
|
4
|
-
}
|
|
5
|
-
|
|
1
|
+
.cells-row {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-flow: row;
|
|
4
|
+
}
|
|
5
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import "./CellsRow.css";
|
|
3
|
-
import { CellsRowsPropsType } from "./types";
|
|
4
|
-
declare const CellsRow: ({ listElementId, visibleDatesArray, width, height, cellsWidth, cellsHeight, ReactCellChildren, }: CellsRowsPropsType) => JSX.Element;
|
|
5
|
-
export default CellsRow;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./CellsRow.css";
|
|
3
|
+
import { CellsRowsPropsType } from "./types";
|
|
4
|
+
declare const CellsRow: ({ listElementId, visibleDatesArray, width, height, cellsWidth, cellsHeight, ReactCellChildren, }: CellsRowsPropsType) => JSX.Element;
|
|
5
|
+
export default CellsRow;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
require("./CellsRow.css");
|
|
8
|
-
//Componentes
|
|
9
|
-
const Cell_1 = __importDefault(require("../../individuals/Cell/Cell"));
|
|
10
|
-
//Utils
|
|
11
|
-
const jsToSqlDate_1 = __importDefault(require("../../../../../utils/jsToSqlDate"));
|
|
12
|
-
const CellsRow = ({ listElementId, visibleDatesArray, width, height, cellsWidth, cellsHeight, ReactCellChildren, }) => {
|
|
13
|
-
//Render
|
|
14
|
-
return (react_1.default.createElement("div", { className: "cells-row", style: {
|
|
15
|
-
width: width,
|
|
16
|
-
height: height,
|
|
17
|
-
} }, visibleDatesArray.length > 0 &&
|
|
18
|
-
visibleDatesArray.map((date) => (react_1.default.createElement(Cell_1.default, { key: listElementId + date.toString(), date: (0, jsToSqlDate_1.default)(date), listElementId: listElementId, width: cellsWidth, heigth: cellsHeight, ReactCellChildren: ReactCellChildren })))));
|
|
19
|
-
};
|
|
20
|
-
exports.default = CellsRow;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
require("./CellsRow.css");
|
|
8
|
+
//Componentes
|
|
9
|
+
const Cell_1 = __importDefault(require("../../individuals/Cell/Cell"));
|
|
10
|
+
//Utils
|
|
11
|
+
const jsToSqlDate_1 = __importDefault(require("../../../../../utils/jsToSqlDate"));
|
|
12
|
+
const CellsRow = ({ listElementId, visibleDatesArray, width, height, cellsWidth, cellsHeight, ReactCellChildren, }) => {
|
|
13
|
+
//Render
|
|
14
|
+
return (react_1.default.createElement("div", { className: "cells-row", style: {
|
|
15
|
+
width: width,
|
|
16
|
+
height: height,
|
|
17
|
+
} }, visibleDatesArray.length > 0 &&
|
|
18
|
+
visibleDatesArray.map((date) => (react_1.default.createElement(Cell_1.default, { key: listElementId + date.toString(), date: (0, jsToSqlDate_1.default)(date), listElementId: listElementId, width: cellsWidth, heigth: cellsHeight, ReactCellChildren: ReactCellChildren })))));
|
|
19
|
+
};
|
|
20
|
+
exports.default = CellsRow;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactCellChildrenType } from "../../../types";
|
|
2
|
-
|
|
3
|
-
export interface CellsRowsPropsType {
|
|
4
|
-
listElementId: string | number;
|
|
5
|
-
visibleDatesArray: Date[];
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
cellsWidth: number;
|
|
9
|
-
cellsHeight: number;
|
|
10
|
-
ReactCellChildren: ReactCellChildrenType;
|
|
11
|
-
}
|
|
1
|
+
import { ReactCellChildrenType } from "../../../types";
|
|
2
|
+
|
|
3
|
+
export interface CellsRowsPropsType {
|
|
4
|
+
listElementId: string | number;
|
|
5
|
+
visibleDatesArray: Date[];
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
cellsWidth: number;
|
|
9
|
+
cellsHeight: number;
|
|
10
|
+
ReactCellChildren: ReactCellChildrenType;
|
|
11
|
+
}
|