josenanodev-react-components-library 0.0.8 → 0.0.9
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.css +41 -231
- package/dist/cjs/components/Multicalendar/Multicalendar.d.ts +1 -1
- package/dist/cjs/components/Multicalendar/Multicalendar.js +45 -33
- package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.d.ts +1 -1
- package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.js +3 -3
- package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +5 -4
- package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +1 -1
- package/dist/cjs/components/Multicalendar/types.d.ts +7 -3
- package/dist/cjs/languages/en-EN.js +0 -170
- package/dist/cjs/languages/es-ES.js +0 -170
- package/dist/cjs/languages/it-IT.js +0 -170
- package/dist/cjs/languages/types.d.ts +0 -170
- package/dist/cjs/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +1 -1
- package/dist/cjs/stories/css-presets.css +77 -0
- package/dist/esm/components/Multicalendar/Multicalendar.css +41 -231
- package/dist/esm/components/Multicalendar/Multicalendar.d.ts +1 -1
- package/dist/esm/components/Multicalendar/Multicalendar.js +47 -35
- package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.d.ts +1 -1
- package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.js +3 -3
- package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +5 -4
- package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +1 -1
- package/dist/esm/components/Multicalendar/types.d.ts +7 -3
- package/dist/esm/languages/en-EN.js +0 -170
- package/dist/esm/languages/es-ES.js +0 -170
- package/dist/esm/languages/it-IT.js +0 -170
- package/dist/esm/languages/types.d.ts +0 -170
- package/dist/esm/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +1 -1
- package/dist/esm/stories/css-presets.css +77 -0
- package/package.json +6 -7
|
@@ -11,19 +11,37 @@
|
|
|
11
11
|
transition: 0.5s;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.multicalendar .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
76
|
+
.multicalendar .controls .div-dates-navigation {
|
|
70
77
|
display: flex;
|
|
71
78
|
align-items: center;
|
|
72
79
|
}
|
|
73
80
|
|
|
74
|
-
.multicalendar .
|
|
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 .
|
|
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-
|
|
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-
|
|
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 .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
283
|
-
.multicalendar .
|
|
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 .
|
|
301
|
-
.multicalendar .
|
|
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 .
|
|
307
|
-
.multicalendar .
|
|
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 .
|
|
176
|
+
.multicalendar .horizontal-axis .div-weeks-buttons .past-week-button {
|
|
313
177
|
left: 5px;
|
|
314
178
|
}
|
|
315
179
|
|
|
316
|
-
.multicalendar .
|
|
180
|
+
.multicalendar .horizontal-axis .div-weeks-buttons .next-week-button {
|
|
317
181
|
right: 5px;
|
|
318
182
|
}
|
|
319
183
|
|
|
320
|
-
.multicalendar .
|
|
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,
|
|
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;
|
|
@@ -30,7 +30,7 @@ const react_1 = __importStar(require("react"));
|
|
|
30
30
|
const Funciones = __importStar(require("./MulticalendarOwnFunctions"));
|
|
31
31
|
require("./Multicalendar.css");
|
|
32
32
|
//Assets
|
|
33
|
-
const
|
|
33
|
+
const bs_1 = require("react-icons/bs");
|
|
34
34
|
//Componentes
|
|
35
35
|
const DatesRow_1 = __importDefault(require("./subcomponents/individuals/DatesRow/DatesRow"));
|
|
36
36
|
const ListElementsColumn_1 = __importDefault(require("./subcomponents/composites/ListElementsColumn/ListElementsColumn"));
|
|
@@ -42,10 +42,10 @@ 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, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, horizontalAxisHeight = 148,
|
|
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, callsOnScrollingMoves, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, }) => {
|
|
46
46
|
//Constantes del componente
|
|
47
47
|
const origin = {
|
|
48
|
-
x: Math.ceil(
|
|
48
|
+
x: pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) * cellsWidth : 0,
|
|
49
49
|
y: 0,
|
|
50
50
|
};
|
|
51
51
|
const initialDateOffset = 2 + chunkRenderX;
|
|
@@ -56,8 +56,8 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
56
56
|
//Estados
|
|
57
57
|
const [firtsCall, setFirtsCall] = (0, react_1.useState)(false);
|
|
58
58
|
const [windowWidth, windowHeight] = (0, useWindowsSize_1.default)();
|
|
59
|
-
const [
|
|
60
|
-
const [
|
|
59
|
+
const [futureDaysQuantity, setFutureDaysQuantity] = (0, react_1.useState)(Math.ceil(futureDaysInitialQuantity));
|
|
60
|
+
const [pastDaysQuantity, setPastDaysQuantity] = (0, react_1.useState)(pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) : 0);
|
|
61
61
|
const [paginationWidth, setPaginationWidth] = (0, react_1.useState)(0);
|
|
62
62
|
const [paginationHeight, setPaginationHeight] = (0, react_1.useState)(0);
|
|
63
63
|
const [xOffset, setXOffset] = (0, react_1.useState)(1);
|
|
@@ -77,6 +77,14 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
77
77
|
const [clientYPositionOnGrid, setClientYPositionOnGrid] = (0, react_1.useState)(undefined);
|
|
78
78
|
const [scrollingOnCourse, setScrollingOnCourse] = (0, react_1.useState)(false);
|
|
79
79
|
//UseEffects
|
|
80
|
+
(0, react_1.useEffect)(() => {
|
|
81
|
+
if (pastDatesVisible) {
|
|
82
|
+
setPastDaysQuantity(Math.ceil(pastDaysInitialQuantity));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
setPastDaysQuantity(0);
|
|
86
|
+
}
|
|
87
|
+
}, [pastDatesVisible, pastDaysInitialQuantity]);
|
|
80
88
|
(0, react_1.useEffect)(() => {
|
|
81
89
|
//Delegamos un cambio de estado a los primero renderes para evitar duplicado de llamadas a la API
|
|
82
90
|
if (!firtsCall) {
|
|
@@ -165,7 +173,7 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
165
173
|
});
|
|
166
174
|
}
|
|
167
175
|
setXOffset(Funciones.defineXOffset(xPosition, cellsWidth, chunkRenderX));
|
|
168
|
-
const fechaMinimaMilisegundos = Funciones.minimalDateMilliseconds(xPosition, cellsWidth,
|
|
176
|
+
const fechaMinimaMilisegundos = Funciones.minimalDateMilliseconds(xPosition, cellsWidth, pastDaysQuantity, initialDateOffset);
|
|
169
177
|
setMinimumVisibleDate(Funciones.defineMinimalVisibleDate(fechaMinimaMilisegundos, initialDateOffset));
|
|
170
178
|
if (updateList)
|
|
171
179
|
setUpdateList(false);
|
|
@@ -178,7 +186,7 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
178
186
|
chunkRenderX,
|
|
179
187
|
cellsWidth,
|
|
180
188
|
initialDateOffset,
|
|
181
|
-
|
|
189
|
+
pastDaysQuantity,
|
|
182
190
|
renderCoordinates.x,
|
|
183
191
|
renderCoordinates.y,
|
|
184
192
|
origin.x,
|
|
@@ -197,7 +205,10 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
197
205
|
}
|
|
198
206
|
}, [xPosition, yPosition, idTimeoutForCalls, waitTimeForCalls]);
|
|
199
207
|
(0, react_1.useEffect)(() => {
|
|
200
|
-
if (
|
|
208
|
+
if (scrollingOnCourse && callsOnScrollingMoves) {
|
|
209
|
+
callsOnScrollingMoves();
|
|
210
|
+
}
|
|
211
|
+
else if (!scrollingOnCourse && callsOnScrollingStops) {
|
|
201
212
|
callsOnScrollingStops();
|
|
202
213
|
}
|
|
203
214
|
// eslint-disable-next-line
|
|
@@ -216,46 +227,46 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
216
227
|
gridTemplateColumns: `${verticalAxisWidth}px`,
|
|
217
228
|
gridTemplateRows: `70px ${horizontalAxisHeight - 70}px calc(100% - ${horizontalAxisHeight}px`,
|
|
218
229
|
} },
|
|
219
|
-
react_1.default.createElement("div", { className: "
|
|
220
|
-
react_1.default.createElement("div", { className: "div-
|
|
230
|
+
react_1.default.createElement("div", { className: "controls" },
|
|
231
|
+
react_1.default.createElement("div", { className: "div-dates-navigation" },
|
|
221
232
|
react_1.default.createElement(DropdownMonthNavigation_1.default, { minimumVisibleDate: minimumVisibleDate, onChangeAction: (valorDeOpcion) => {
|
|
222
|
-
Funciones.scrollByDate(new Date(Number(Date.parse((0, sqlToJsDate_1.default)(valorDeOpcion).toString()))), gridWrapperRef,
|
|
223
|
-
}, options: Funciones.defineMonthsArray(
|
|
224
|
-
react_1.default.createElement("button", { onClick: () => Funciones.scrollByDate(new Date(), gridWrapperRef,
|
|
225
|
-
react_1.default.createElement("div", { className: "div-
|
|
226
|
-
react_1.default.createElement("div", { className: "
|
|
227
|
-
react_1.default.createElement("div", { className: "
|
|
228
|
-
react_1.default.createElement("div", { ref: destiniesColumnRef, className: "
|
|
233
|
+
Funciones.scrollByDate(new Date(Number(Date.parse((0, sqlToJsDate_1.default)(valorDeOpcion).toString()))), gridWrapperRef, pastDaysQuantity, cellsWidth);
|
|
234
|
+
}, options: Funciones.defineMonthsArray(pastDaysQuantity, futureDaysQuantity, language) }),
|
|
235
|
+
react_1.default.createElement("button", { onClick: () => Funciones.scrollByDate(new Date(), gridWrapperRef, pastDaysQuantity, cellsWidth) }, language["Today"])),
|
|
236
|
+
aditionalControlsComponents && (react_1.default.createElement("div", { className: "div-aditional-controls-components" }, aditionalControlsComponents))),
|
|
237
|
+
react_1.default.createElement("div", { className: "div-upper-left-component" }, upperLeftComponent),
|
|
238
|
+
react_1.default.createElement("div", { className: "vertical-axis" },
|
|
239
|
+
react_1.default.createElement("div", { ref: destiniesColumnRef, className: "div-list-element-column", onScroll: (e) => {
|
|
229
240
|
// Se puede hacer funcion
|
|
230
241
|
if (gridWrapperRef.current !== null)
|
|
231
242
|
gridWrapperRef.current.scrollTop = e.target.scrollTop;
|
|
232
243
|
} },
|
|
233
244
|
react_1.default.createElement(ListElementsColumn_1.default, { listHeight: cellsHeight * listElementsIdsArray.length, yOffset: yOffset, elementsHeight: cellsHeight, idsArray: visibleListElementsIds, ReactListElementChildren: ReactListElementChildren }))),
|
|
234
|
-
react_1.default.createElement("div", { className: "
|
|
235
|
-
react_1.default.createElement("div", { className: "div-
|
|
236
|
-
react_1.default.createElement("button", { className: "
|
|
245
|
+
react_1.default.createElement("div", { className: "horizontal-axis" },
|
|
246
|
+
react_1.default.createElement("div", { className: "div-weeks-buttons" },
|
|
247
|
+
react_1.default.createElement("button", { className: "past-week-button", onClick: () => {
|
|
237
248
|
// Se puede hacer funcion
|
|
238
249
|
if (datesRowRef.current !== null)
|
|
239
250
|
datesRowRef.current.scroll({
|
|
240
251
|
left: datesRowRef.current.scrollLeft - cellsWidth * 7,
|
|
241
252
|
});
|
|
242
253
|
} },
|
|
243
|
-
react_1.default.createElement(
|
|
254
|
+
react_1.default.createElement(bs_1.BsChevronLeft, null)),
|
|
244
255
|
react_1.default.createElement("button", { onClick: () => {
|
|
245
256
|
// Se puede hacer funcion
|
|
246
257
|
if (datesRowRef.current !== null)
|
|
247
258
|
datesRowRef.current.scroll({
|
|
248
259
|
left: datesRowRef.current.scrollLeft + cellsWidth * 7,
|
|
249
260
|
});
|
|
250
|
-
}, className: "
|
|
251
|
-
react_1.default.createElement(
|
|
252
|
-
react_1.default.createElement("div", { ref: datesRowRef, className: "div-
|
|
261
|
+
}, className: "next-week-button" },
|
|
262
|
+
react_1.default.createElement(bs_1.BsChevronRight, null))),
|
|
263
|
+
react_1.default.createElement("div", { ref: datesRowRef, className: "div-dates-row", onScroll: (e) => {
|
|
253
264
|
if (gridWrapperRef.current !== null)
|
|
254
265
|
gridWrapperRef.current.scrollLeft = e.target.scrollLeft;
|
|
255
266
|
} },
|
|
256
|
-
react_1.default.createElement(DatesRow_1.default, { visibleDates: visibleDates, width: (
|
|
257
|
-
react_1.default.createElement("div", { className: "div-
|
|
258
|
-
react_1.default.createElement("div", { ref: gridWrapperRef, className: "
|
|
267
|
+
react_1.default.createElement(DatesRow_1.default, { visibleDates: visibleDates, width: (pastDaysQuantity + futureDaysQuantity) * cellsWidth, height: 64, cellsWidth: cellsWidth, cellsHeight: 64, offset: xOffset, language: language }))),
|
|
268
|
+
react_1.default.createElement("div", { className: "div-main-container" },
|
|
269
|
+
react_1.default.createElement("div", { ref: gridWrapperRef, className: "main-container", onScroll: (e) => {
|
|
259
270
|
if (datesRowRef.current !== null) {
|
|
260
271
|
datesRowRef.current.scrollLeft = e.target.scrollLeft;
|
|
261
272
|
setXPosition(e.target.scrollLeft);
|
|
@@ -264,15 +275,16 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
264
275
|
destiniesColumnRef.current.scrollTop = e.target.scrollTop;
|
|
265
276
|
setYPosition(e.target.scrollTop);
|
|
266
277
|
}
|
|
267
|
-
if (
|
|
278
|
+
if (dynamicDaysQuantity &&
|
|
268
279
|
e.target.scrollLeft +
|
|
269
280
|
e.target.offsetWidth >
|
|
270
|
-
(
|
|
271
|
-
|
|
281
|
+
(pastDaysQuantity + futureDaysQuantity) * cellsWidth - cellsWidth) {
|
|
282
|
+
setFutureDaysQuantity(futureDaysQuantity + 1);
|
|
272
283
|
}
|
|
273
|
-
if (
|
|
284
|
+
if (pastDatesVisible &&
|
|
285
|
+
dynamicDaysQuantity &&
|
|
274
286
|
e.target.scrollLeft < cellsWidth) {
|
|
275
|
-
|
|
287
|
+
setPastDaysQuantity(pastDaysQuantity + 1);
|
|
276
288
|
e.target.scrollLeft = cellsWidth * 3;
|
|
277
289
|
}
|
|
278
290
|
Funciones.authomaticScrollInGrid(draggingOverDateCells, clientXPositionOnGrid, clientYPositionOnGrid, cellsWidth, cellsHeight, e.target);
|
|
@@ -285,6 +297,6 @@ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChi
|
|
|
285
297
|
Funciones.startAuthomaticScrollInGrid(draggingOverDateCells, x, y, cellsWidth, cellsHeight, gridWrapperRef);
|
|
286
298
|
}
|
|
287
299
|
} },
|
|
288
|
-
react_1.default.createElement(DatesGrid_1.default, { gridWidth: (
|
|
300
|
+
react_1.default.createElement(DatesGrid_1.default, { gridWidth: (pastDaysQuantity + futureDaysQuantity) * cellsWidth, gridHeight: cellsHeight * listElementsIdsArray.length, xOffset: xOffset, yOffset: yOffset, cellsWidth: cellsWidth, cellsHeight: cellsHeight, visibleListElementsIdsArray: visibleListElementsIds, visibleDates: visibleDates, ReactCellChildren: ReactCellChildren })))));
|
|
289
301
|
};
|
|
290
302
|
exports.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
|
|
@@ -107,7 +107,7 @@ function defineListElementsArrayVisibleList(paginationHeight, chunkRenderY, offs
|
|
|
107
107
|
let array = [];
|
|
108
108
|
for (let index = 0; index < paginationHeight + chunkRenderY * 2; index++) {
|
|
109
109
|
if (listElementsIds[index + offset] && index + offset >= 0)
|
|
110
|
-
array[index] =
|
|
110
|
+
array[index] = listElementsIds[index + offset];
|
|
111
111
|
}
|
|
112
112
|
return array;
|
|
113
113
|
}
|
|
@@ -118,9 +118,9 @@ exports.defineListElementsArrayVisibleList = defineListElementsArrayVisibleList;
|
|
|
118
118
|
* @param language language object for traductions
|
|
119
119
|
* @returns string of the date, month followed by year
|
|
120
120
|
*/
|
|
121
|
-
function defineMonthsArray(leftPagination, language) {
|
|
121
|
+
function defineMonthsArray(leftPagination, rightPagination, language) {
|
|
122
122
|
let minimumDateMilliseconds = Date.parse(new Date().toString()) - leftPagination * constants_1.millisecondsOfOneDay;
|
|
123
|
-
let maximumDateMilliseconds = Date.parse(new Date().toString()) +
|
|
123
|
+
let maximumDateMilliseconds = Date.parse(new Date().toString()) + rightPagination * constants_1.millisecondsOfOneDay;
|
|
124
124
|
let array = [];
|
|
125
125
|
let sideArray = [];
|
|
126
126
|
for (let index = 0; index * constants_1.millisecondsOfOneDay + minimumDateMilliseconds < maximumDateMilliseconds; index++) {
|
|
@@ -35,7 +35,7 @@ const DatesRow = ({ visibleDates, width, height, cellsWidth, cellsHeight, offset
|
|
|
35
35
|
height: height,
|
|
36
36
|
paddingLeft: offset * cellsWidth,
|
|
37
37
|
} }, visibleDates.length > 0 &&
|
|
38
|
-
visibleDates.map((dateObject) => (react_1.default.createElement("div", { className: "date-cell", style: {
|
|
38
|
+
visibleDates.map((dateObject) => (react_1.default.createElement("div", { key: dateObject.toString(), className: "date-cell", style: {
|
|
39
39
|
width: cellsWidth,
|
|
40
40
|
height: cellsHeight,
|
|
41
41
|
} },
|
|
@@ -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
|
-
|
|
14
|
+
pastDaysInitialQuantity?: number;
|
|
15
|
+
futureDaysInitialQuantity?: number;
|
|
14
16
|
chunkRenderX?: number;
|
|
15
17
|
chunkRenderY?: number;
|
|
16
18
|
draggingOverDateCells?: boolean;
|
|
17
|
-
|
|
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 {
|