josenanodev-react-components-library 0.0.8 → 0.0.10

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.
Files changed (45) hide show
  1. package/dist/cjs/components/Multicalendar/Multicalendar.css +41 -231
  2. package/dist/cjs/components/Multicalendar/Multicalendar.d.ts +1 -1
  3. package/dist/cjs/components/Multicalendar/Multicalendar.js +45 -33
  4. package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.d.ts +1 -1
  5. package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.js +3 -3
  6. package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +5 -4
  7. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +1 -1
  8. package/dist/cjs/components/Multicalendar/types.d.ts +7 -3
  9. package/dist/cjs/components/SideBar/SideBar.css +50 -0
  10. package/dist/cjs/components/SideBar/SideBar.d.ts +8 -0
  11. package/dist/cjs/components/SideBar/SideBar.js +72 -0
  12. package/dist/cjs/components/SideBar/types.d.ts +7 -0
  13. package/dist/cjs/hooks/useOutsideClick.d.ts +6 -0
  14. package/dist/cjs/hooks/useOutsideClick.js +25 -0
  15. package/dist/cjs/hooks/useResizeObserver.d.ts +7 -0
  16. package/dist/cjs/hooks/useResizeObserver.js +30 -0
  17. package/dist/cjs/languages/en-EN.js +0 -170
  18. package/dist/cjs/languages/es-ES.js +0 -170
  19. package/dist/cjs/languages/it-IT.js +0 -170
  20. package/dist/cjs/languages/types.d.ts +0 -170
  21. package/dist/cjs/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +1 -1
  22. package/dist/cjs/stories/css-presets.css +77 -0
  23. package/dist/esm/components/Multicalendar/Multicalendar.css +41 -231
  24. package/dist/esm/components/Multicalendar/Multicalendar.d.ts +1 -1
  25. package/dist/esm/components/Multicalendar/Multicalendar.js +47 -35
  26. package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.d.ts +1 -1
  27. package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.js +3 -3
  28. package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +5 -4
  29. package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +1 -1
  30. package/dist/esm/components/Multicalendar/types.d.ts +7 -3
  31. package/dist/esm/components/SideBar/SideBar.css +50 -0
  32. package/dist/esm/components/SideBar/SideBar.d.ts +8 -0
  33. package/dist/esm/components/SideBar/SideBar.js +44 -0
  34. package/dist/esm/components/SideBar/types.d.ts +7 -0
  35. package/dist/esm/hooks/useOutsideClick.d.ts +6 -0
  36. package/dist/esm/hooks/useOutsideClick.js +23 -0
  37. package/dist/esm/hooks/useResizeObserver.d.ts +7 -0
  38. package/dist/esm/hooks/useResizeObserver.js +28 -0
  39. package/dist/esm/languages/en-EN.js +0 -170
  40. package/dist/esm/languages/es-ES.js +0 -170
  41. package/dist/esm/languages/it-IT.js +0 -170
  42. package/dist/esm/languages/types.d.ts +0 -170
  43. package/dist/esm/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +1 -1
  44. package/dist/esm/stories/css-presets.css +77 -0
  45. package/package.json +7 -7
@@ -11,19 +11,37 @@
11
11
  transition: 0.5s;
12
12
  }
13
13
 
14
- .multicalendar .controles {
14
+ .multicalendar .div-upper-left-component {
15
+ grid-area: fil;
16
+ position: relative;
17
+ width: 100%;
18
+ height: 100%;
19
+ z-index: 2;
20
+ background-color: white;
21
+ border-bottom: 1px solid rgb(235, 235, 235);
22
+ border-right: 1px solid rgb(235, 235, 235);
23
+ box-sizing: border-box;
24
+ display: flex;
25
+ flex-flow: column;
26
+ justify-content: center;
27
+ align-items: center;
28
+ }
29
+
30
+ .multicalendar .controls {
15
31
  grid-area: con;
16
32
  height: 100%;
17
33
  padding: 2px;
18
34
  box-sizing: border-box;
19
35
  display: flex;
20
- justify-content: space-between;
21
36
  align-items: center;
37
+ justify-content: space-between;
38
+ flex-wrap: wrap;
22
39
  box-sizing: border-box;
23
40
  border-bottom: var(--border-tenues);
41
+
24
42
  }
25
43
 
26
- .multicalendar .filtros-logo {
44
+ .multicalendar .div-upper-left-component {
27
45
  grid-area: fil;
28
46
  position: relative;
29
47
  width: 100%;
@@ -38,19 +56,8 @@
38
56
  justify-content: flex-end;
39
57
  }
40
58
 
41
- .multicalendar .filtros-logo .logo {
42
- max-height: 68px;
43
- width: fit-content;
44
- align-self: center;
45
- }
46
-
47
- .multicalendar .filtros-logo .pop-up-filtros {
48
- position: absolute;
49
- top: 100%;
50
- left: 8px;
51
- }
52
59
 
53
- .multicalendar .eje-vertical {
60
+ .multicalendar .vertical-axis {
54
61
  grid-area: ver;
55
62
  position: relative;
56
63
  width: 100%;
@@ -59,19 +66,19 @@
59
66
  z-index: 1;
60
67
  }
61
68
 
62
- .multicalendar .eje-horizontal {
69
+ .multicalendar .horizontal-axis {
63
70
  grid-area: hor;
64
71
  position: relative;
65
72
  max-width: 100%;
66
73
  height: 100%;
67
74
  }
68
75
 
69
- .multicalendar .controles .div-dropdown-fechas-boton-hoy {
76
+ .multicalendar .controls .div-dates-navigation {
70
77
  display: flex;
71
78
  align-items: center;
72
79
  }
73
80
 
74
- .multicalendar .controles .div-dropdown-fechas-boton-hoy button {
81
+ .multicalendar .controls .div-dates-navigation button {
75
82
  cursor: pointer;
76
83
  margin: 0px;
77
84
  position: relative;
@@ -89,131 +96,13 @@
89
96
  height: calc(100% - 16px);
90
97
  }
91
98
 
92
- .multicalendar .controles {
93
- display: flex;
94
- align-items: center;
95
- justify-content: space-between;
96
- flex-wrap: wrap;
97
- }
98
-
99
- .multicalendar .controles .reload-properties-button,
100
- .multicalendar .controles .reload-prices-button {
101
- height: 30px;
102
- cursor: pointer;
103
- display: flex;
104
- align-items: center;
105
- justify-content: center;
106
- text-align: center;
107
- text-decoration: none;
108
- font-size: 14px;
109
- color: rgb(255, 255, 255);
110
- font-weight: 600;
111
- border-radius: 4px;
112
- border-color: transparent;
113
- border-style: solid;
114
- border-width: 2px;
115
- background: var(--primary-color);
116
- width: 180px;
117
- transition: all 0.2s;
118
- }
119
-
120
- .multicalendar .controles .reload-properties-button:disabled,
121
- .multicalendar .controles .reload-prices-button:disabled {
122
- background: rgb(255, 255, 255);
123
- color: var(--primary-color);
124
- border-color: var(--primary-color);
125
- }
126
-
127
- .multicalendar .controles .reload-properties-button svg,
128
- .multicalendar .controles .reload-prices-button svg {
129
- animation-name: refrescando-precios-giro;
130
- animation-duration: 1s;
131
- animation-iteration-count: infinite;
132
- font-size: 20px;
133
- }
134
-
135
- .multicalendar .controles .boton-refrescar {
136
- height: 30px;
137
- cursor: pointer;
138
- display: flex;
139
- align-items: center;
140
- justify-content: center;
141
- text-align: center;
142
- text-decoration: none;
143
- width: auto;
144
- touch-action: manipulation;
145
- font-size: 14px;
146
- line-height: 14px;
147
- letter-spacing: normal;
148
- color: rgb(255, 255, 255);
149
- font-weight: 600;
150
- border-radius: 4px;
151
- border-color: transparent;
152
- border-style: solid;
153
- border-width: 2px;
154
- background: var(--primary-color);
155
- width: 90px;
156
- transition: all 0.2s;
157
- }
158
-
159
- .multicalendar .controles .boton-refrescar:focus {
160
- outline: none;
161
- }
162
-
163
- .multicalendar .controles .boton-refrescar:disabled {
164
- background: rgb(255, 255, 255);
165
- color: var(--primary-color);
166
- border-color: var(--primary-color);
167
- }
168
-
169
- .multicalendar .controles .boton-refrescar svg {
170
- animation-name: refrescando-precios-giro;
171
- animation-duration: 1s;
172
- animation-iteration-count: infinite;
173
- font-size: 26px;
174
- }
175
-
176
- .multicalendar .controles .div-boton-toggle-reservaciones {
177
- display: flex;
178
- align-items: center;
179
- height: 28px;
180
- }
181
-
182
- .multicalendar .controles .div-boton-toggle-reservaciones p {
183
- margin: 0px;
184
- position: relative;
185
- text-align: center;
186
- text-decoration: none;
187
- padding: 4px 8px;
188
- box-sizing: border-box;
189
- color: dimgray;
190
- font-weight: 600;
191
- font-size: 16px;
192
- height: 100%;
193
- }
194
-
195
- .multicalendar .controles .div-boton-toggle-multidashboard-pickup {
196
- display: flex;
197
- align-items: center;
198
- height: 28px;
199
- }
200
-
201
- .multicalendar .controles .div-boton-toggle-multidashboard-pickup p {
99
+ .multicalendar .controls .div-aditional-controls-components {
202
100
  display: flex;
101
+ justify-content: flex-end;
203
102
  align-items: center;
204
- margin: 0px;
205
- position: relative;
206
- text-align: center;
207
- text-decoration: none;
208
- padding: 4px 8px;
209
- box-sizing: border-box;
210
- color: dimgray;
211
- font-weight: 600;
212
- font-size: 14px;
213
- height: 100%;
214
103
  }
215
104
 
216
- .multicalendar .div-contenedor-principal {
105
+ .multicalendar .div-main-container {
217
106
  grid-area: gri;
218
107
  height: 100%;
219
108
  position: relative;
@@ -221,7 +110,7 @@
221
110
  overflow: hidden;
222
111
  }
223
112
 
224
- .multicalendar .div-contenedor-principal .div-cargando-contenedor-principal {
113
+ .multicalendar .div-main-container .div-cargando-contenedor-principal {
225
114
  position: absolute;
226
115
  top: 0;
227
116
  left: 0;
@@ -234,53 +123,28 @@
234
123
  background-color: rgba(236, 236, 236, 0.8);
235
124
  }
236
125
 
237
- .multicalendar .contendor-principal {
126
+ .multicalendar .main-container {
238
127
  position: relative;
239
128
  min-width: 100%;
240
129
  height: 100%;
241
130
  overflow-x: scroll;
242
131
  }
243
132
 
244
- .multicalendar .contendor-principal .div-filas-celdas {
245
- box-sizing: border-box;
246
- }
247
-
248
- .multicalendar .contendor-principal .div-filas-celdas .div-altura-filas-celdas {
249
- box-sizing: border-box;
250
- }
251
-
252
- .multicalendar .eje-vertical .lista-anuncios {
133
+ .multicalendar .vertical-axis .div-list-element-column {
253
134
  height: 100%;
254
135
  overflow-y: scroll;
255
136
  box-sizing: border-box;
256
137
  }
257
138
 
258
- .multicalendar .eje-vertical .lista-anuncios .div-cargando-lista-anuncios {
259
- position: absolute;
260
- top: 0;
261
- left: 0;
262
- width: 100%;
263
- height: 100%;
264
- display: flex;
265
- justify-content: center;
266
- align-items: center;
267
- z-index: 2;
268
- background-color: rgba(72, 72, 72, 0.1);
269
- }
270
-
271
- .multicalendar .eje-vertical .lista-anuncios .div-altura-lista-anuncios {
272
- box-sizing: border-box;
273
- }
274
-
275
- .multicalendar .eje-horizontal .div-botones-fechas {
139
+ .multicalendar .horizontal-axis .div-weeks-buttons {
276
140
  position: absolute;
277
141
  bottom: 0;
278
142
  width: 100%;
279
143
  height: 64px;
280
144
  }
281
145
 
282
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-pasada,
283
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-siguiente {
146
+ .multicalendar .horizontal-axis .div-weeks-buttons .past-week-button,
147
+ .multicalendar .horizontal-axis .div-weeks-buttons .next-week-button {
284
148
  z-index: 2;
285
149
  position: absolute;
286
150
  background-color: transparent;
@@ -297,27 +161,27 @@
297
161
  box-shadow: 0px 0px 8px 8px white;
298
162
  }
299
163
 
300
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-pasada:hover,
301
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-siguiente:hover {
164
+ .multicalendar .horizontal-axis .div-weeks-buttons .past-week-button:hover,
165
+ .multicalendar .horizontal-axis .div-weeks-buttons .next-week-button:hover {
302
166
  background: rgb(247, 247, 247);
303
167
  box-shadow: 0px 0px 8px 8px rgb(247 247 247);
304
168
  }
305
169
 
306
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-pasada:active,
307
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-siguiente:active {
170
+ .multicalendar .horizontal-axis .div-weeks-buttons .past-week-button:active,
171
+ .multicalendar .horizontal-axis .div-weeks-buttons .next-week-button:active {
308
172
  background: rgb(167, 167, 167);
309
173
  box-shadow: 0px 0px 8px 8px rgb(167, 167, 167);
310
174
  }
311
175
 
312
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-pasada {
176
+ .multicalendar .horizontal-axis .div-weeks-buttons .past-week-button {
313
177
  left: 5px;
314
178
  }
315
179
 
316
- .multicalendar .eje-horizontal .div-botones-fechas .boton-semana-siguiente {
180
+ .multicalendar .horizontal-axis .div-weeks-buttons .next-week-button {
317
181
  right: 5px;
318
182
  }
319
183
 
320
- .multicalendar .eje-horizontal .div-fila-fechas {
184
+ .multicalendar .horizontal-axis .div-dates-row {
321
185
  position: absolute;
322
186
  bottom: 0;
323
187
  width: 100%;
@@ -325,57 +189,3 @@
325
189
  border-bottom: 1px solid rgb(235, 235, 235);
326
190
  box-sizing: border-box;
327
191
  }
328
-
329
- .multicalendar .div-multidashboard-pickup {
330
- grid-area: das;
331
- height: 100%;
332
- background: rgb(255, 255, 255);
333
- border-left: 1px solid rgb(228, 228, 228);
334
- overflow-y: auto;
335
- transition: all 0.5s;
336
- }
337
-
338
- .div-multidashboard-pickup-abierto {
339
- width: 540px;
340
- }
341
-
342
- .div-multidashboard-pickup-cerrado {
343
- width: 0px;
344
- }
345
-
346
- .multicalendar .div-multidashboard-pickup::-webkit-scrollbar {
347
- display: none;
348
- }
349
-
350
- @keyframes refrescando-precios-giro {
351
- from {
352
- transform: rotate(0deg);
353
- }
354
- to {
355
- transform: rotate(360deg);
356
- }
357
- }
358
-
359
- @media screen and (max-width: 970px) {
360
- .multicalendar .controles .boton-refrescar {
361
- font-size: 12px;
362
- width: 75px;
363
- }
364
- .multicalendar .boton-competidores .boton-desplegable {
365
- font-size: 12px;
366
- }
367
- .multicalendar .boton-sin-cambios-que-sincronizar {
368
- min-width: 175px;
369
- font-size: 12px;
370
- }
371
- .multicalendar .controles .div-boton-toggle-multidashboard-pickup p {
372
- font-size: 12px;
373
- }
374
- .multicalendar .dropdown-navegador-meses {
375
- width: 155px;
376
- font-size: 12px;
377
- }
378
- .multicalendar .controles .div-dropdown-fechas-boton-hoy button {
379
- font-size: 12px;
380
- }
381
- }
@@ -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, cellsWidth, cellsHeight, verticalAxisWidth, horizontalAxisHeight, horizontalInitialCellQuantity, chunkRenderX, chunkRenderY, dynamicPagination, draggingOverDateCells, logoUrl, waitTimeForCalls, callsOnScrollingStops, }: MulticalendarPropsType) => JSX.Element;
4
+ declare const Multicalendar: ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible, cellsWidth, cellsHeight, verticalAxisWidth, horizontalAxisHeight, pastDaysInitialQuantity, futureDaysInitialQuantity, chunkRenderX, chunkRenderY, dynamicDaysQuantity, draggingOverDateCells, waitTimeForCalls, callsOnScrollingMoves, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }: MulticalendarPropsType) => JSX.Element;
5
5
  export default Multicalendar;
@@ -2,22 +2,22 @@ import React, { useEffect, useState, useRef } from "react";
2
2
  import * as Funciones from "./MulticalendarOwnFunctions";
3
3
  import "./Multicalendar.css";
4
4
  //Assets
5
- import * as BootstrapIcons from "react-icons/bs";
5
+ import { BsChevronLeft, BsChevronRight } from "react-icons/bs";
6
6
  //Componentes
7
7
  import DatesRow from "./subcomponents/individuals/DatesRow/DatesRow";
8
8
  import ListElementsColumn from "./subcomponents/composites/ListElementsColumn/ListElementsColumn";
9
9
  import DatesGrid from "./subcomponents/composites/DatesGrid/DatesGrid";
10
- import DropdownNavegadorMeses from "./subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation";
10
+ import DropdownMonthNavigation from "./subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation";
11
11
  //Hooks
12
12
  import useWindowSize from "../../hooks/useWindowsSize";
13
13
  //Utils
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, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, horizontalAxisHeight = 148, horizontalInitialCellQuantity = 1000, chunkRenderX = 0, chunkRenderY = 0, dynamicPagination = false, draggingOverDateCells = false, logoUrl, waitTimeForCalls = 500, callsOnScrollingStops, }) => {
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, callsOnScrollingMoves, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }) => {
18
18
  //Constantes del componente
19
19
  const origin = {
20
- x: Math.ceil(horizontalInitialCellQuantity / 2) * cellsWidth,
20
+ x: pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) * cellsWidth : 0,
21
21
  y: 0,
22
22
  };
23
23
  const initialDateOffset = 2 + chunkRenderX;
@@ -28,8 +28,8 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
28
28
  //Estados
29
29
  const [firtsCall, setFirtsCall] = useState(false);
30
30
  const [windowWidth, windowHeight] = useWindowSize();
31
- const [rightPagination, setRightPagination] = useState(Math.ceil(horizontalInitialCellQuantity / 2));
32
- const [leftPagination, setLeftPagination] = useState(0);
31
+ const [futureDaysQuantity, setFutureDaysQuantity] = useState(Math.ceil(futureDaysInitialQuantity));
32
+ const [pastDaysQuantity, setPastDaysQuantity] = useState(pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) : 0);
33
33
  const [paginationWidth, setPaginationWidth] = useState(0);
34
34
  const [paginationHeight, setPaginationHeight] = useState(0);
35
35
  const [xOffset, setXOffset] = useState(1);
@@ -49,6 +49,14 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
49
49
  const [clientYPositionOnGrid, setClientYPositionOnGrid] = useState(undefined);
50
50
  const [scrollingOnCourse, setScrollingOnCourse] = useState(false);
51
51
  //UseEffects
52
+ useEffect(() => {
53
+ if (pastDatesVisible) {
54
+ setPastDaysQuantity(Math.ceil(pastDaysInitialQuantity));
55
+ }
56
+ else {
57
+ setPastDaysQuantity(0);
58
+ }
59
+ }, [pastDatesVisible, pastDaysInitialQuantity]);
52
60
  useEffect(() => {
53
61
  //Delegamos un cambio de estado a los primero renderes para evitar duplicado de llamadas a la API
54
62
  if (!firtsCall) {
@@ -137,7 +145,7 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
137
145
  });
138
146
  }
139
147
  setXOffset(Funciones.defineXOffset(xPosition, cellsWidth, chunkRenderX));
140
- const fechaMinimaMilisegundos = Funciones.minimalDateMilliseconds(xPosition, cellsWidth, leftPagination, initialDateOffset);
148
+ const fechaMinimaMilisegundos = Funciones.minimalDateMilliseconds(xPosition, cellsWidth, pastDaysQuantity, initialDateOffset);
141
149
  setMinimumVisibleDate(Funciones.defineMinimalVisibleDate(fechaMinimaMilisegundos, initialDateOffset));
142
150
  if (updateList)
143
151
  setUpdateList(false);
@@ -150,7 +158,7 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
150
158
  chunkRenderX,
151
159
  cellsWidth,
152
160
  initialDateOffset,
153
- leftPagination,
161
+ pastDaysQuantity,
154
162
  renderCoordinates.x,
155
163
  renderCoordinates.y,
156
164
  origin.x,
@@ -169,7 +177,10 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
169
177
  }
170
178
  }, [xPosition, yPosition, idTimeoutForCalls, waitTimeForCalls]);
171
179
  useEffect(() => {
172
- if (!scrollingOnCourse && callsOnScrollingStops) {
180
+ if (scrollingOnCourse && callsOnScrollingMoves) {
181
+ callsOnScrollingMoves();
182
+ }
183
+ else if (!scrollingOnCourse && callsOnScrollingStops) {
173
184
  callsOnScrollingStops();
174
185
  }
175
186
  // eslint-disable-next-line
@@ -188,46 +199,46 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
188
199
  gridTemplateColumns: `${verticalAxisWidth}px`,
189
200
  gridTemplateRows: `70px ${horizontalAxisHeight - 70}px calc(100% - ${horizontalAxisHeight}px`,
190
201
  } },
191
- React.createElement("div", { className: "controles" },
192
- React.createElement("div", { className: "div-dropdown-fechas-boton-hoy" },
193
- React.createElement(DropdownNavegadorMeses, { minimumVisibleDate: minimumVisibleDate, onChangeAction: (valorDeOpcion) => {
194
- Funciones.scrollByDate(new Date(Number(Date.parse(sqlToJsDate(valorDeOpcion).toString()))), gridWrapperRef, leftPagination, cellsWidth);
195
- }, options: Funciones.defineMonthsArray(leftPagination, language) }),
196
- React.createElement("button", { onClick: () => Funciones.scrollByDate(new Date(), gridWrapperRef, leftPagination, cellsWidth) }, language["Today"])),
197
- React.createElement("div", { className: "div-botones-superior-derecho" })),
198
- React.createElement("div", { className: "filtros-logo" }, logoUrl && React.createElement("img", { className: "logo", src: logoUrl, alt: "logo" })),
199
- React.createElement("div", { className: "eje-vertical" },
200
- React.createElement("div", { ref: destiniesColumnRef, className: "lista-anuncios", onScroll: (e) => {
202
+ React.createElement("div", { className: "controls" },
203
+ React.createElement("div", { className: "div-dates-navigation" },
204
+ React.createElement(DropdownMonthNavigation, { minimumVisibleDate: minimumVisibleDate, onChangeAction: (valorDeOpcion) => {
205
+ Funciones.scrollByDate(new Date(Number(Date.parse(sqlToJsDate(valorDeOpcion).toString()))), gridWrapperRef, pastDaysQuantity, cellsWidth);
206
+ }, options: Funciones.defineMonthsArray(pastDaysQuantity, futureDaysQuantity, language) }),
207
+ React.createElement("button", { onClick: () => Funciones.scrollByDate(new Date(), gridWrapperRef, pastDaysQuantity, cellsWidth) }, language["Today"])),
208
+ aditionalControlsComponents && (React.createElement("div", { className: "div-aditional-controls-components" }, aditionalControlsComponents))),
209
+ React.createElement("div", { className: "div-upper-left-component" }, upperLeftComponent),
210
+ React.createElement("div", { className: "vertical-axis" },
211
+ React.createElement("div", { ref: destiniesColumnRef, className: "div-list-element-column", onScroll: (e) => {
201
212
  // Se puede hacer funcion
202
213
  if (gridWrapperRef.current !== null)
203
214
  gridWrapperRef.current.scrollTop = e.target.scrollTop;
204
215
  } },
205
216
  React.createElement(ListElementsColumn, { listHeight: cellsHeight * listElementsIdsArray.length, yOffset: yOffset, elementsHeight: cellsHeight, idsArray: visibleListElementsIds, ReactListElementChildren: ReactListElementChildren }))),
206
- React.createElement("div", { className: "eje-horizontal" },
207
- React.createElement("div", { className: "div-botones-fechas" },
208
- React.createElement("button", { className: "boton-semana-pasada", onClick: () => {
217
+ React.createElement("div", { className: "horizontal-axis" },
218
+ React.createElement("div", { className: "div-weeks-buttons" },
219
+ React.createElement("button", { className: "past-week-button", onClick: () => {
209
220
  // Se puede hacer funcion
210
221
  if (datesRowRef.current !== null)
211
222
  datesRowRef.current.scroll({
212
223
  left: datesRowRef.current.scrollLeft - cellsWidth * 7,
213
224
  });
214
225
  } },
215
- React.createElement(BootstrapIcons.BsChevronLeft, null)),
226
+ React.createElement(BsChevronLeft, null)),
216
227
  React.createElement("button", { onClick: () => {
217
228
  // Se puede hacer funcion
218
229
  if (datesRowRef.current !== null)
219
230
  datesRowRef.current.scroll({
220
231
  left: datesRowRef.current.scrollLeft + cellsWidth * 7,
221
232
  });
222
- }, className: "boton-semana-siguiente" },
223
- React.createElement(BootstrapIcons.BsChevronRight, null))),
224
- React.createElement("div", { ref: datesRowRef, className: "div-fila-fechas", onScroll: (e) => {
233
+ }, className: "next-week-button" },
234
+ React.createElement(BsChevronRight, null))),
235
+ React.createElement("div", { ref: datesRowRef, className: "div-dates-row", onScroll: (e) => {
225
236
  if (gridWrapperRef.current !== null)
226
237
  gridWrapperRef.current.scrollLeft = e.target.scrollLeft;
227
238
  } },
228
- React.createElement(DatesRow, { visibleDates: visibleDates, width: (leftPagination + rightPagination) * cellsWidth, height: 64, cellsWidth: cellsWidth, cellsHeight: 64, offset: xOffset, language: language }))),
229
- React.createElement("div", { className: "div-contenedor-principal" },
230
- React.createElement("div", { ref: gridWrapperRef, className: "contendor-principal", onScroll: (e) => {
239
+ React.createElement(DatesRow, { visibleDates: visibleDates, width: (pastDaysQuantity + futureDaysQuantity) * cellsWidth, height: 64, cellsWidth: cellsWidth, cellsHeight: 64, offset: xOffset, language: language }))),
240
+ React.createElement("div", { className: "div-main-container" },
241
+ React.createElement("div", { ref: gridWrapperRef, className: "main-container", onScroll: (e) => {
231
242
  if (datesRowRef.current !== null) {
232
243
  datesRowRef.current.scrollLeft = e.target.scrollLeft;
233
244
  setXPosition(e.target.scrollLeft);
@@ -236,15 +247,16 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
236
247
  destiniesColumnRef.current.scrollTop = e.target.scrollTop;
237
248
  setYPosition(e.target.scrollTop);
238
249
  }
239
- if (dynamicPagination &&
250
+ if (dynamicDaysQuantity &&
240
251
  e.target.scrollLeft +
241
252
  e.target.offsetWidth >
242
- (leftPagination + rightPagination) * cellsWidth - cellsWidth) {
243
- setRightPagination(rightPagination + 1);
253
+ (pastDaysQuantity + futureDaysQuantity) * cellsWidth - cellsWidth) {
254
+ setFutureDaysQuantity(futureDaysQuantity + 1);
244
255
  }
245
- if (dynamicPagination &&
256
+ if (pastDatesVisible &&
257
+ dynamicDaysQuantity &&
246
258
  e.target.scrollLeft < cellsWidth) {
247
- setLeftPagination(leftPagination + 1);
259
+ setPastDaysQuantity(pastDaysQuantity + 1);
248
260
  e.target.scrollLeft = cellsWidth * 3;
249
261
  }
250
262
  Funciones.authomaticScrollInGrid(draggingOverDateCells, clientXPositionOnGrid, clientYPositionOnGrid, cellsWidth, cellsHeight, e.target);
@@ -257,6 +269,6 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
257
269
  Funciones.startAuthomaticScrollInGrid(draggingOverDateCells, x, y, cellsWidth, cellsHeight, gridWrapperRef);
258
270
  }
259
271
  } },
260
- React.createElement(DatesGrid, { gridWidth: (leftPagination + rightPagination) * cellsWidth, gridHeight: cellsHeight * listElementsIdsArray.length, xOffset: xOffset, yOffset: yOffset, cellsWidth: cellsWidth, cellsHeight: cellsHeight, visibleListElementsIdsArray: visibleListElementsIds, visibleDates: visibleDates, ReactCellChildren: ReactCellChildren })))));
272
+ React.createElement(DatesGrid, { gridWidth: (pastDaysQuantity + futureDaysQuantity) * cellsWidth, gridHeight: cellsHeight * listElementsIdsArray.length, xOffset: xOffset, yOffset: yOffset, cellsWidth: cellsWidth, cellsHeight: cellsHeight, visibleListElementsIdsArray: visibleListElementsIds, visibleDates: visibleDates, ReactCellChildren: ReactCellChildren })))));
261
273
  };
262
274
  export default Multicalendar;
@@ -63,7 +63,7 @@ export declare function defineListElementsArrayVisibleList(paginationHeight: num
63
63
  * @param language language object for traductions
64
64
  * @returns string of the date, month followed by year
65
65
  */
66
- export declare function defineMonthsArray(leftPagination: number, language: languageType): JSX.Element[];
66
+ export declare function defineMonthsArray(leftPagination: number, rightPagination: number, language: languageType): JSX.Element[];
67
67
  /**
68
68
  *
69
69
  * @param holdingClic boolean to know if mouse id down
@@ -95,7 +95,7 @@ export function defineListElementsArrayVisibleList(paginationHeight, chunkRender
95
95
  let array = [];
96
96
  for (let index = 0; index < paginationHeight + chunkRenderY * 2; index++) {
97
97
  if (listElementsIds[index + offset] && index + offset >= 0)
98
- array[index] = Object.assign({}, listElementsIds[index + offset]);
98
+ array[index] = listElementsIds[index + offset];
99
99
  }
100
100
  return array;
101
101
  }
@@ -105,9 +105,9 @@ export function defineListElementsArrayVisibleList(paginationHeight, chunkRender
105
105
  * @param language language object for traductions
106
106
  * @returns string of the date, month followed by year
107
107
  */
108
- export function defineMonthsArray(leftPagination, language) {
108
+ export function defineMonthsArray(leftPagination, rightPagination, language) {
109
109
  let minimumDateMilliseconds = Date.parse(new Date().toString()) - leftPagination * millisecondsOfOneDay;
110
- let maximumDateMilliseconds = Date.parse(new Date().toString()) + leftPagination * millisecondsOfOneDay;
110
+ let maximumDateMilliseconds = Date.parse(new Date().toString()) + rightPagination * millisecondsOfOneDay;
111
111
  let array = [];
112
112
  let sideArray = [];
113
113
  for (let index = 0; index * millisecondsOfOneDay + minimumDateMilliseconds < maximumDateMilliseconds; index++) {
@@ -1,6 +1,7 @@
1
1
  .dates-grid {
2
- box-sizing: border-box;
3
- }
2
+ box-sizing: border-box;
3
+ overflow: hidden;
4
+ }
4
5
  .dates-grid .div-cells-row-height {
5
- box-sizing: border-box;
6
- }
6
+ box-sizing: border-box;
7
+ }
@@ -30,7 +30,7 @@ const DatesRow = ({ visibleDates, width, height, cellsWidth, cellsHeight, offset
30
30
  height: height,
31
31
  paddingLeft: offset * cellsWidth,
32
32
  } }, visibleDates.length > 0 &&
33
- visibleDates.map((dateObject) => (React.createElement("div", { className: "date-cell", style: {
33
+ visibleDates.map((dateObject) => (React.createElement("div", { key: dateObject.toString(), className: "date-cell", style: {
34
34
  width: cellsWidth,
35
35
  height: cellsHeight,
36
36
  } },
@@ -6,18 +6,22 @@ export interface MulticalendarPropsType {
6
6
  ReactListElementChildren: ReactListElementChildrenType;
7
7
  listElementsIdsArray: string[] | number[];
8
8
  language: languageType;
9
+ pastDatesVisible?: boolean
9
10
  cellsWidth?: number;
10
11
  cellsHeight?: number;
11
12
  verticalAxisWidth?: number;
12
13
  horizontalAxisHeight?: number;
13
- horizontalInitialCellQuantity?: number;
14
+ pastDaysInitialQuantity?: number;
15
+ futureDaysInitialQuantity?: number;
14
16
  chunkRenderX?: number;
15
17
  chunkRenderY?: number;
16
18
  draggingOverDateCells?: boolean;
17
- dynamicPagination?: boolean;
18
- logoUrl?: string;
19
+ dynamicDaysQuantity?: boolean;
19
20
  waitTimeForCalls?: number;
21
+ callsOnScrollingMoves?: Function;
20
22
  callsOnScrollingStops?: Function;
23
+ aditionalControlsComponents?: JSX.Element | JSX.Element[]
24
+ upperLeftComponent?: JSX.Element
21
25
  }
22
26
 
23
27
  export interface RenderCoordinatesType {