@innosolutions/inno-calendar 1.0.64 → 1.0.65
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/{agenda-widget-duVkXi_m.js → agenda-widget-CD_UoYWC.js} +245 -245
- package/dist/{agenda-widget-duVkXi_m.js.map → agenda-widget-CD_UoYWC.js.map} +1 -1
- package/dist/{agenda-widget-A-xsyqRf.cjs → agenda-widget-COxgmpv4.cjs} +2 -2
- package/dist/{agenda-widget-A-xsyqRf.cjs.map → agenda-widget-COxgmpv4.cjs.map} +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +165 -154
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/core/utils/view-storage.d.ts +64 -0
- package/dist/core/utils/view-storage.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +210 -199
- package/dist/position-utils-Do2ciBXl.cjs +2 -0
- package/dist/position-utils-Do2ciBXl.cjs.map +1 -0
- package/dist/{position-utils-DMVQFywD.js → position-utils-DpaKqYhO.js} +430 -346
- package/dist/position-utils-DpaKqYhO.js.map +1 -0
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/slot-selection-context-BlrL9b5P.cjs +2 -0
- package/dist/slot-selection-context-BlrL9b5P.cjs.map +1 -0
- package/dist/{slot-selection-context-CRstOosL.js → slot-selection-context-D3MW4WJ7.js} +159 -159
- package/dist/slot-selection-context-D3MW4WJ7.js.map +1 -0
- package/dist/{tailwind-calendar-CNhXkxzW.js → tailwind-calendar-CzbuXRmn.js} +65 -65
- package/dist/{tailwind-calendar-CNhXkxzW.js.map → tailwind-calendar-CzbuXRmn.js.map} +1 -1
- package/dist/{tailwind-calendar-VRvPJQwa.cjs → tailwind-calendar-smlkVdSq.cjs} +2 -2
- package/dist/{tailwind-calendar-VRvPJQwa.cjs.map → tailwind-calendar-smlkVdSq.cjs.map} +1 -1
- package/dist/{use-calendar-DkT1_V3j.cjs → use-calendar-Bd-d8oGj.cjs} +2 -2
- package/dist/{use-calendar-DkT1_V3j.cjs.map → use-calendar-Bd-d8oGj.cjs.map} +1 -1
- package/dist/{use-calendar-D8XaVe44.js → use-calendar-mU1joTwp.js} +53 -53
- package/dist/{use-calendar-D8XaVe44.js.map → use-calendar-mU1joTwp.js.map} +1 -1
- package/dist/{use-slot-selection-Dj_tWg1O.cjs → use-slot-selection-CCOSsRSh.cjs} +2 -2
- package/dist/{use-slot-selection-Dj_tWg1O.cjs.map → use-slot-selection-CCOSsRSh.cjs.map} +1 -1
- package/dist/{use-slot-selection-CWRk_17s.js → use-slot-selection-CauKdLYv.js} +3 -3
- package/dist/{use-slot-selection-CWRk_17s.js.map → use-slot-selection-CauKdLYv.js.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +120 -109
- package/dist/{week-view-DY167Wok.js → week-view-BQXIaSUZ.js} +3 -3
- package/dist/{week-view-DY167Wok.js.map → week-view-BQXIaSUZ.js.map} +1 -1
- package/dist/{week-view-C1Vu2ErD.cjs → week-view-xrKlAJos.cjs} +2 -2
- package/dist/{week-view-C1Vu2ErD.cjs.map → week-view-xrKlAJos.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/position-utils-BQpbtF6N.cjs +0 -2
- package/dist/position-utils-BQpbtF6N.cjs.map +0 -1
- package/dist/position-utils-DMVQFywD.js.map +0 -1
- package/dist/slot-selection-context-CRstOosL.js.map +0 -1
- package/dist/slot-selection-context-DBCZI2Dn.cjs +0 -2
- package/dist/slot-selection-context-DBCZI2Dn.cjs.map +0 -1
|
@@ -1,16 +1,89 @@
|
|
|
1
|
-
import { isValidElement as
|
|
2
|
-
function
|
|
1
|
+
import { isValidElement as q } from "react";
|
|
2
|
+
function I(t) {
|
|
3
3
|
if (t == null || typeof t == "boolean") return "";
|
|
4
4
|
if (typeof t == "string") return t;
|
|
5
5
|
if (typeof t == "number") return String(t);
|
|
6
|
-
if (Array.isArray(t)) return t.map(
|
|
7
|
-
if (
|
|
6
|
+
if (Array.isArray(t)) return t.map(I).join("");
|
|
7
|
+
if (q(t)) {
|
|
8
8
|
const e = t.props;
|
|
9
|
-
return
|
|
9
|
+
return I(e.children);
|
|
10
10
|
}
|
|
11
11
|
return "";
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const $ = "inno-calendar-view", _ = "inno-calendar-resource-view", Q = [
|
|
14
|
+
"day",
|
|
15
|
+
"week",
|
|
16
|
+
"month",
|
|
17
|
+
"year",
|
|
18
|
+
"agenda"
|
|
19
|
+
], Z = [
|
|
20
|
+
"timeline-day",
|
|
21
|
+
"timeline-3day",
|
|
22
|
+
"timeline-week",
|
|
23
|
+
"resource-day",
|
|
24
|
+
"resource-week"
|
|
25
|
+
];
|
|
26
|
+
function R(t) {
|
|
27
|
+
return typeof t == "string" && Q.includes(t);
|
|
28
|
+
}
|
|
29
|
+
function A(t) {
|
|
30
|
+
return typeof t == "string" && Z.includes(t);
|
|
31
|
+
}
|
|
32
|
+
function O() {
|
|
33
|
+
return typeof window < "u" && typeof window.localStorage < "u";
|
|
34
|
+
}
|
|
35
|
+
function B(t) {
|
|
36
|
+
if (!O()) return null;
|
|
37
|
+
try {
|
|
38
|
+
return window.localStorage.getItem(t);
|
|
39
|
+
} catch {
|
|
40
|
+
return console.warn(`[InnoCalendar] Failed to read "${t}" from localStorage`), null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function N(t, e) {
|
|
44
|
+
if (O())
|
|
45
|
+
try {
|
|
46
|
+
window.localStorage.setItem(t, e);
|
|
47
|
+
} catch {
|
|
48
|
+
console.warn(`[InnoCalendar] Failed to write "${t}" to localStorage`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function G(t) {
|
|
52
|
+
if (O())
|
|
53
|
+
try {
|
|
54
|
+
window.localStorage.removeItem(t);
|
|
55
|
+
} catch {
|
|
56
|
+
console.warn(`[InnoCalendar] Failed to remove "${t}" from localStorage`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function tt(t, e = $) {
|
|
60
|
+
R(t) && N(e, t);
|
|
61
|
+
}
|
|
62
|
+
function ht(t = $) {
|
|
63
|
+
const e = B(t);
|
|
64
|
+
return R(e) ? e : null;
|
|
65
|
+
}
|
|
66
|
+
function yt(t = $) {
|
|
67
|
+
G(t);
|
|
68
|
+
}
|
|
69
|
+
function et(t, e = _) {
|
|
70
|
+
A(t) && N(e, t);
|
|
71
|
+
}
|
|
72
|
+
function pt(t = _) {
|
|
73
|
+
const e = B(t);
|
|
74
|
+
return A(e) ? e : null;
|
|
75
|
+
}
|
|
76
|
+
function wt(t = _) {
|
|
77
|
+
G(t);
|
|
78
|
+
}
|
|
79
|
+
function Tt(t) {
|
|
80
|
+
if (R(t)) {
|
|
81
|
+
tt(t);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
A(t) && et(t);
|
|
85
|
+
}
|
|
86
|
+
const Et = [
|
|
14
87
|
"day",
|
|
15
88
|
"week",
|
|
16
89
|
"month",
|
|
@@ -20,7 +93,7 @@ const at = [
|
|
|
20
93
|
"resource-week",
|
|
21
94
|
"timeline-day",
|
|
22
95
|
"timeline-week"
|
|
23
|
-
],
|
|
96
|
+
], St = {
|
|
24
97
|
startHour: 8,
|
|
25
98
|
endHour: 18,
|
|
26
99
|
firstDayOfWeek: 1,
|
|
@@ -30,13 +103,13 @@ const at = [
|
|
|
30
103
|
timeFormat: "24h",
|
|
31
104
|
badgeVariant: "colored",
|
|
32
105
|
showCanceledEvents: !1
|
|
33
|
-
},
|
|
106
|
+
}, Mt = {
|
|
34
107
|
startHour: 0,
|
|
35
108
|
endHour: 24
|
|
36
|
-
},
|
|
109
|
+
}, bt = {
|
|
37
110
|
startHour: 8,
|
|
38
111
|
endHour: 18
|
|
39
|
-
},
|
|
112
|
+
}, Ht = {
|
|
40
113
|
day: {
|
|
41
114
|
type: "day",
|
|
42
115
|
slotMinTime: "00:00",
|
|
@@ -97,7 +170,7 @@ const at = [
|
|
|
97
170
|
type: "timeline-week",
|
|
98
171
|
slotDuration: "01:00:00"
|
|
99
172
|
}
|
|
100
|
-
},
|
|
173
|
+
}, It = {
|
|
101
174
|
blue: "#3b82f6",
|
|
102
175
|
green: "#22c55e",
|
|
103
176
|
red: "#ef4444",
|
|
@@ -108,7 +181,7 @@ const at = [
|
|
|
108
181
|
teal: "#14b8a6",
|
|
109
182
|
gray: "#6b7280",
|
|
110
183
|
indigo: "#6366f1"
|
|
111
|
-
},
|
|
184
|
+
}, kt = {
|
|
112
185
|
blue: { bg: "bg-blue-100", text: "text-blue-800", border: "border-blue-300" },
|
|
113
186
|
green: { bg: "bg-green-100", text: "text-green-800", border: "border-green-300" },
|
|
114
187
|
red: { bg: "bg-red-100", text: "text-red-800", border: "border-red-300" },
|
|
@@ -119,7 +192,7 @@ const at = [
|
|
|
119
192
|
teal: { bg: "bg-teal-100", text: "text-teal-800", border: "border-teal-300" },
|
|
120
193
|
gray: { bg: "bg-gray-100", text: "text-gray-800", border: "border-gray-300" },
|
|
121
194
|
indigo: { bg: "bg-indigo-100", text: "text-indigo-800", border: "border-indigo-300" }
|
|
122
|
-
},
|
|
195
|
+
}, Ft = {
|
|
123
196
|
"#3b82f6": "blue",
|
|
124
197
|
"#22c55e": "green",
|
|
125
198
|
"#ef4444": "red",
|
|
@@ -130,12 +203,12 @@ const at = [
|
|
|
130
203
|
"#14b8a6": "teal",
|
|
131
204
|
"#6b7280": "gray",
|
|
132
205
|
"#6366f1": "indigo"
|
|
133
|
-
},
|
|
134
|
-
function
|
|
206
|
+
}, xt = 24, Ct = 60, nt = 60 * 1e3, rt = 60 * nt, $t = 24 * rt, F = 64, _t = 32, Rt = 56, At = 200, at = 20;
|
|
207
|
+
function g(t) {
|
|
135
208
|
const e = new Date(t);
|
|
136
209
|
return e.setHours(0, 0, 0, 0), e;
|
|
137
210
|
}
|
|
138
|
-
function
|
|
211
|
+
function w(t) {
|
|
139
212
|
const e = new Date(t);
|
|
140
213
|
return e.setHours(23, 59, 59, 999), e;
|
|
141
214
|
}
|
|
@@ -143,19 +216,19 @@ function l(t, e) {
|
|
|
143
216
|
const n = new Date(t);
|
|
144
217
|
return n.setDate(n.getDate() + e), n;
|
|
145
218
|
}
|
|
146
|
-
function
|
|
219
|
+
function Ot(t, e) {
|
|
147
220
|
return l(t, -e);
|
|
148
221
|
}
|
|
149
222
|
function p(t, e) {
|
|
150
223
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
151
224
|
}
|
|
152
|
-
function
|
|
225
|
+
function P(t) {
|
|
153
226
|
return p(t, /* @__PURE__ */ new Date());
|
|
154
227
|
}
|
|
155
|
-
function
|
|
228
|
+
function Wt(t) {
|
|
156
229
|
return t.getDay();
|
|
157
230
|
}
|
|
158
|
-
function
|
|
231
|
+
function K(t) {
|
|
159
232
|
const e = t.getDay();
|
|
160
233
|
return e === 0 || e === 6;
|
|
161
234
|
}
|
|
@@ -163,108 +236,108 @@ function m(t, e = 1) {
|
|
|
163
236
|
const n = new Date(t), r = n.getDay(), a = (r < e ? 7 : 0) + r - e;
|
|
164
237
|
return n.setDate(n.getDate() - a), n.setHours(0, 0, 0, 0), n;
|
|
165
238
|
}
|
|
166
|
-
function
|
|
239
|
+
function T(t, e = 1) {
|
|
167
240
|
const n = m(t, e);
|
|
168
241
|
return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
|
|
169
242
|
}
|
|
170
|
-
function
|
|
243
|
+
function k(t, e) {
|
|
171
244
|
return l(t, e * 7);
|
|
172
245
|
}
|
|
173
|
-
function
|
|
246
|
+
function Ut(t, e) {
|
|
174
247
|
return l(t, -e * 7);
|
|
175
248
|
}
|
|
176
|
-
function
|
|
249
|
+
function vt(t) {
|
|
177
250
|
const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())), n = e.getUTCDay() || 7;
|
|
178
251
|
e.setUTCDate(e.getUTCDate() + 4 - n);
|
|
179
252
|
const r = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
|
|
180
253
|
return Math.ceil(((e.getTime() - r.getTime()) / 864e5 + 1) / 7);
|
|
181
254
|
}
|
|
182
|
-
function
|
|
255
|
+
function Yt(t, e, n = 1) {
|
|
183
256
|
const r = m(t, n), a = m(e, n);
|
|
184
257
|
return p(r, a);
|
|
185
258
|
}
|
|
186
|
-
function
|
|
259
|
+
function S(t) {
|
|
187
260
|
const e = new Date(t);
|
|
188
261
|
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
189
262
|
}
|
|
190
|
-
function
|
|
263
|
+
function M(t) {
|
|
191
264
|
const e = new Date(t.getFullYear(), t.getMonth() + 1, 0);
|
|
192
265
|
return e.setHours(23, 59, 59, 999), e;
|
|
193
266
|
}
|
|
194
|
-
function
|
|
267
|
+
function x(t, e) {
|
|
195
268
|
const n = new Date(t);
|
|
196
269
|
return n.setMonth(n.getMonth() + e), n;
|
|
197
270
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
271
|
+
function Vt(t, e) {
|
|
272
|
+
return x(t, -e);
|
|
200
273
|
}
|
|
201
|
-
function
|
|
274
|
+
function Lt(t) {
|
|
202
275
|
return new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
|
|
203
276
|
}
|
|
204
|
-
function
|
|
277
|
+
function W(t, e) {
|
|
205
278
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
|
|
206
279
|
}
|
|
207
|
-
function
|
|
280
|
+
function z(t) {
|
|
208
281
|
return new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
209
282
|
}
|
|
210
|
-
function
|
|
283
|
+
function ot(t) {
|
|
211
284
|
return new Date(t.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
212
285
|
}
|
|
213
|
-
function
|
|
286
|
+
function U(t, e) {
|
|
214
287
|
const n = new Date(t);
|
|
215
288
|
return n.setFullYear(n.getFullYear() + e), n;
|
|
216
289
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
290
|
+
function Bt(t, e) {
|
|
291
|
+
return U(t, -e);
|
|
219
292
|
}
|
|
220
|
-
function
|
|
293
|
+
function Nt(t, e) {
|
|
221
294
|
return t.getFullYear() === e.getFullYear();
|
|
222
295
|
}
|
|
223
|
-
function
|
|
296
|
+
function st(t, e) {
|
|
224
297
|
const n = new Date(t);
|
|
225
298
|
return n.setHours(n.getHours() + e), n;
|
|
226
299
|
}
|
|
227
|
-
function
|
|
300
|
+
function Gt(t, e) {
|
|
228
301
|
const n = new Date(t);
|
|
229
302
|
return n.setMinutes(n.getMinutes() + e), n;
|
|
230
303
|
}
|
|
231
|
-
function
|
|
304
|
+
function Pt(t, e, n = 0, r = 0) {
|
|
232
305
|
const a = new Date(t);
|
|
233
306
|
return a.setHours(e, n, r, 0), a;
|
|
234
307
|
}
|
|
235
|
-
function
|
|
308
|
+
function Kt(t) {
|
|
236
309
|
return t.getHours() + t.getMinutes() / 60;
|
|
237
310
|
}
|
|
238
|
-
function
|
|
311
|
+
function zt(t, e) {
|
|
239
312
|
return t.getTime() < e.getTime();
|
|
240
313
|
}
|
|
241
|
-
function
|
|
314
|
+
function jt(t, e) {
|
|
242
315
|
return t.getTime() > e.getTime();
|
|
243
316
|
}
|
|
244
|
-
function
|
|
317
|
+
function Jt(t, e, n) {
|
|
245
318
|
const r = t.getTime();
|
|
246
319
|
return r >= e.getTime() && r <= n.getTime();
|
|
247
320
|
}
|
|
248
|
-
function
|
|
321
|
+
function Xt(t) {
|
|
249
322
|
if (t.length !== 0)
|
|
250
323
|
return t.reduce((e, n) => n < e ? n : e);
|
|
251
324
|
}
|
|
252
|
-
function
|
|
325
|
+
function qt(t) {
|
|
253
326
|
if (t.length !== 0)
|
|
254
327
|
return t.reduce((e, n) => n > e ? n : e);
|
|
255
328
|
}
|
|
256
|
-
function
|
|
329
|
+
function v(t, e) {
|
|
257
330
|
return t.getTime() - e.getTime();
|
|
258
331
|
}
|
|
259
|
-
function
|
|
260
|
-
return Math.floor(
|
|
332
|
+
function Qt(t, e) {
|
|
333
|
+
return Math.floor(v(t, e) / 6e4);
|
|
261
334
|
}
|
|
262
|
-
function
|
|
263
|
-
return Math.floor(
|
|
335
|
+
function Zt(t, e) {
|
|
336
|
+
return Math.floor(v(t, e) / 36e5);
|
|
264
337
|
}
|
|
265
|
-
function
|
|
266
|
-
const n =
|
|
267
|
-
return Math.floor(
|
|
338
|
+
function te(t, e) {
|
|
339
|
+
const n = g(t), r = g(e);
|
|
340
|
+
return Math.floor(v(n, r) / 864e5);
|
|
268
341
|
}
|
|
269
342
|
function H(t, e = "24h") {
|
|
270
343
|
const n = t.getHours(), r = t.getMinutes();
|
|
@@ -274,155 +347,155 @@ function H(t, e = "24h") {
|
|
|
274
347
|
}
|
|
275
348
|
return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
|
|
276
349
|
}
|
|
277
|
-
function
|
|
350
|
+
function ee(t) {
|
|
278
351
|
const e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0");
|
|
279
352
|
return `${e}-${n}-${r}`;
|
|
280
353
|
}
|
|
281
|
-
function
|
|
354
|
+
function ne(t) {
|
|
282
355
|
return new Date(t);
|
|
283
356
|
}
|
|
284
|
-
function
|
|
357
|
+
function ut(t, e) {
|
|
285
358
|
const n = [];
|
|
286
|
-
let r =
|
|
287
|
-
const a =
|
|
359
|
+
let r = g(t);
|
|
360
|
+
const a = g(e);
|
|
288
361
|
for (; r <= a; )
|
|
289
362
|
n.push(new Date(r)), r = l(r, 1);
|
|
290
363
|
return n;
|
|
291
364
|
}
|
|
292
|
-
function
|
|
365
|
+
function re(t, e) {
|
|
293
366
|
const n = [];
|
|
294
367
|
let r = new Date(t);
|
|
295
368
|
for (; r <= e; )
|
|
296
|
-
n.push(new Date(r)), r =
|
|
369
|
+
n.push(new Date(r)), r = st(r, 1);
|
|
297
370
|
return n;
|
|
298
371
|
}
|
|
299
|
-
function
|
|
372
|
+
function ae(t = "en-US", e = "short") {
|
|
300
373
|
const n = new Intl.DateTimeFormat(t, { weekday: e }), r = [], a = new Date(2024, 0, 7);
|
|
301
|
-
for (let
|
|
302
|
-
r.push(n.format(l(a,
|
|
374
|
+
for (let o = 0; o < 7; o++)
|
|
375
|
+
r.push(n.format(l(a, o)));
|
|
303
376
|
return r;
|
|
304
377
|
}
|
|
305
|
-
function
|
|
378
|
+
function oe(t = "en-US", e = "long") {
|
|
306
379
|
const n = new Intl.DateTimeFormat(t, { month: e }), r = [];
|
|
307
380
|
for (let a = 0; a < 12; a++)
|
|
308
381
|
r.push(n.format(new Date(2024, a, 1)));
|
|
309
382
|
return r;
|
|
310
383
|
}
|
|
311
|
-
function
|
|
384
|
+
function se(t) {
|
|
312
385
|
const e = [];
|
|
313
386
|
for (let n = t.startHour; n <= t.endHour; n++)
|
|
314
387
|
e.push(n);
|
|
315
388
|
return e;
|
|
316
389
|
}
|
|
317
|
-
function
|
|
390
|
+
function ue(t, e = "24h") {
|
|
318
391
|
if (e === "12h") {
|
|
319
392
|
const n = t >= 12 ? "PM" : "AM";
|
|
320
393
|
return `${t % 12 || 12} ${n}`;
|
|
321
394
|
}
|
|
322
395
|
return `${String(t).padStart(2, "0")}:00`;
|
|
323
396
|
}
|
|
324
|
-
function
|
|
397
|
+
function ie(t, e = 1) {
|
|
325
398
|
const n = m(t, e), r = [];
|
|
326
399
|
for (let a = 0; a < 7; a++)
|
|
327
400
|
r.push(l(n, a));
|
|
328
401
|
return r;
|
|
329
402
|
}
|
|
330
|
-
function
|
|
331
|
-
const n =
|
|
332
|
-
return
|
|
403
|
+
function ce(t, e = 1) {
|
|
404
|
+
const n = S(t), r = M(t), a = m(n, e), o = T(r, e), s = t.getMonth();
|
|
405
|
+
return ut(a, o).map((c) => ({
|
|
333
406
|
date: c,
|
|
334
|
-
isCurrentMonth: c.getMonth() ===
|
|
407
|
+
isCurrentMonth: c.getMonth() === s,
|
|
335
408
|
isWeekend: c.getDay() === 0 || c.getDay() === 6
|
|
336
409
|
}));
|
|
337
410
|
}
|
|
338
|
-
function
|
|
411
|
+
function Y(t) {
|
|
339
412
|
if (t.isAllDay === !0) return !0;
|
|
340
413
|
if (t.isAllDay === !1) return !1;
|
|
341
|
-
const e = t.startDate.getHours(), n = t.startDate.getMinutes(), r = t.endDate.getHours(), a = t.endDate.getMinutes(),
|
|
414
|
+
const e = t.startDate.getHours(), n = t.startDate.getMinutes(), r = t.endDate.getHours(), a = t.endDate.getMinutes(), o = e === 0 && n === 0, s = r === 0 && a === 0 || // midnight next day
|
|
342
415
|
r === 23 && a >= 59;
|
|
343
|
-
return !!(
|
|
416
|
+
return !!(o && s);
|
|
344
417
|
}
|
|
345
|
-
function
|
|
418
|
+
function le(t) {
|
|
346
419
|
const e = [], n = [];
|
|
347
420
|
for (const r of t)
|
|
348
|
-
|
|
421
|
+
Y(r) ? n.push(r) : p(r.startDate, r.endDate) ? e.push(r) : n.push(r);
|
|
349
422
|
return { singleDay: e, multiDay: n };
|
|
350
423
|
}
|
|
351
|
-
function
|
|
424
|
+
function fe(t, e, n) {
|
|
352
425
|
return t.filter((r) => r.startDate <= n && r.endDate >= e);
|
|
353
426
|
}
|
|
354
|
-
function
|
|
427
|
+
function de(t, e, n) {
|
|
355
428
|
if (!n) return !0;
|
|
356
429
|
const r = t.getDay(), a = n[r];
|
|
357
430
|
return !a || !(a.enabled !== !1) || a.from === a.to ? !1 : e >= a.from && e < a.to;
|
|
358
431
|
}
|
|
359
|
-
function
|
|
432
|
+
function ge(t, e) {
|
|
360
433
|
const n = t.getDay(), r = e[n];
|
|
361
434
|
return !r || !(r.enabled !== !1) || r.from === r.to ? null : { from: r.from, to: r.to };
|
|
362
435
|
}
|
|
363
|
-
function
|
|
436
|
+
function me(t) {
|
|
364
437
|
const e = [];
|
|
365
438
|
for (let n = 0; n < 12; n++)
|
|
366
439
|
e.push(new Date(t, n, 1));
|
|
367
440
|
return e;
|
|
368
441
|
}
|
|
369
|
-
function
|
|
370
|
-
const r =
|
|
371
|
-
return t.filter((
|
|
372
|
-
const
|
|
373
|
-
return
|
|
442
|
+
function it(t, e, n) {
|
|
443
|
+
const r = g(e), a = w(n);
|
|
444
|
+
return t.filter((o) => {
|
|
445
|
+
const s = o.startDate, u = o.endDate;
|
|
446
|
+
return s <= a && u >= r;
|
|
374
447
|
});
|
|
375
448
|
}
|
|
376
|
-
function
|
|
449
|
+
function ct(t, e) {
|
|
377
450
|
return e.length === 0 ? t : t.filter(
|
|
378
451
|
(n) => n.scheduleTypeId !== void 0 && e.includes(n.scheduleTypeId)
|
|
379
452
|
);
|
|
380
453
|
}
|
|
381
|
-
function
|
|
454
|
+
function lt(t, e) {
|
|
382
455
|
return e.length === 0 ? t : t.filter(
|
|
383
456
|
(n) => n.resourceId !== void 0 && e.includes(n.resourceId)
|
|
384
457
|
);
|
|
385
458
|
}
|
|
386
|
-
function
|
|
459
|
+
function ft(t, e) {
|
|
387
460
|
if (!e.trim()) return t;
|
|
388
461
|
const n = e.toLowerCase();
|
|
389
462
|
return t.filter((r) => {
|
|
390
|
-
const a =
|
|
391
|
-
return a ||
|
|
463
|
+
const a = I(r.title).toLowerCase().includes(n), o = I(r.description).toLowerCase().includes(n);
|
|
464
|
+
return a || o;
|
|
392
465
|
});
|
|
393
466
|
}
|
|
394
|
-
function
|
|
467
|
+
function dt(t) {
|
|
395
468
|
return t.filter((e) => !e.isCanceled);
|
|
396
469
|
}
|
|
397
|
-
function
|
|
470
|
+
function De(t, e) {
|
|
398
471
|
let n = [...t];
|
|
399
|
-
return e.dateRange && (n =
|
|
472
|
+
return e.dateRange && (n = it(
|
|
400
473
|
n,
|
|
401
474
|
e.dateRange.startDate,
|
|
402
475
|
e.dateRange.endDate
|
|
403
|
-
)), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n =
|
|
476
|
+
)), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n = ct(n, e.scheduleTypeIds)), e.resourceIds && e.resourceIds.length > 0 && (n = lt(n, e.resourceIds)), e.search && (n = ft(n, e.search)), e.showCanceled || (n = dt(n)), n;
|
|
404
477
|
}
|
|
405
|
-
function
|
|
478
|
+
function he(t) {
|
|
406
479
|
return [...t].sort((e, n) => e.startDate.getTime() - n.startDate.getTime());
|
|
407
480
|
}
|
|
408
|
-
function
|
|
481
|
+
function ye(t) {
|
|
409
482
|
return [...t].sort((e, n) => e.endDate.getTime() - n.endDate.getTime());
|
|
410
483
|
}
|
|
411
|
-
function
|
|
484
|
+
function pe(t) {
|
|
412
485
|
return [...t].sort((e, n) => {
|
|
413
486
|
const r = e.endDate.getTime() - e.startDate.getTime();
|
|
414
487
|
return n.endDate.getTime() - n.startDate.getTime() - r;
|
|
415
488
|
});
|
|
416
489
|
}
|
|
417
|
-
function
|
|
490
|
+
function we(t) {
|
|
418
491
|
const e = /* @__PURE__ */ new Map();
|
|
419
492
|
for (const n of t) {
|
|
420
|
-
const r =
|
|
493
|
+
const r = g(n.startDate).toISOString(), a = e.get(r) ?? [];
|
|
421
494
|
a.push(n), e.set(r, a);
|
|
422
495
|
}
|
|
423
496
|
return e;
|
|
424
497
|
}
|
|
425
|
-
function
|
|
498
|
+
function Te(t) {
|
|
426
499
|
const e = /* @__PURE__ */ new Map();
|
|
427
500
|
for (const n of t) {
|
|
428
501
|
const r = e.get(n.scheduleTypeId) ?? [];
|
|
@@ -430,7 +503,7 @@ function re(t) {
|
|
|
430
503
|
}
|
|
431
504
|
return e;
|
|
432
505
|
}
|
|
433
|
-
function
|
|
506
|
+
function Ee(t) {
|
|
434
507
|
const e = /* @__PURE__ */ new Map();
|
|
435
508
|
for (const n of t) {
|
|
436
509
|
const r = e.get(n.resourceId) ?? [];
|
|
@@ -438,31 +511,31 @@ function ae(t) {
|
|
|
438
511
|
}
|
|
439
512
|
return e;
|
|
440
513
|
}
|
|
441
|
-
function
|
|
514
|
+
function Se(t, e) {
|
|
442
515
|
return t.filter((n) => {
|
|
443
|
-
const r =
|
|
516
|
+
const r = g(e), a = w(e);
|
|
444
517
|
return n.startDate <= a && n.endDate >= r;
|
|
445
518
|
});
|
|
446
519
|
}
|
|
447
|
-
function
|
|
520
|
+
function Me(t) {
|
|
448
521
|
return t.filter((e) => e.isAllDay);
|
|
449
522
|
}
|
|
450
|
-
function
|
|
523
|
+
function be(t) {
|
|
451
524
|
return t.filter((e) => !e.isAllDay);
|
|
452
525
|
}
|
|
453
|
-
function
|
|
526
|
+
function He(t) {
|
|
454
527
|
return t.filter((e) => e.isMultiDay ? !0 : !p(e.startDate, e.endDate));
|
|
455
528
|
}
|
|
456
|
-
function
|
|
529
|
+
function Ie(t) {
|
|
457
530
|
return t.isMultiDay ? !0 : !p(t.startDate, t.endDate);
|
|
458
531
|
}
|
|
459
|
-
function
|
|
532
|
+
function ke(t) {
|
|
460
533
|
return Math.floor((t.endDate.getTime() - t.startDate.getTime()) / 6e4);
|
|
461
534
|
}
|
|
462
|
-
function
|
|
535
|
+
function Fe(t, e = "blue") {
|
|
463
536
|
return t.color ?? e;
|
|
464
537
|
}
|
|
465
|
-
function
|
|
538
|
+
function xe(t, e, n = "blue") {
|
|
466
539
|
if (t.color) return t.color;
|
|
467
540
|
if (t.scheduleTypeId !== void 0 && e) {
|
|
468
541
|
const r = e.get(t.scheduleTypeId);
|
|
@@ -470,8 +543,8 @@ function ge(t, e, n = "blue") {
|
|
|
470
543
|
}
|
|
471
544
|
return n;
|
|
472
545
|
}
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
546
|
+
function Ce(t) {
|
|
547
|
+
if (Y(t)) {
|
|
475
548
|
if (p(t.startDate, t.endDate))
|
|
476
549
|
return "All day";
|
|
477
550
|
const n = t.startDate.toLocaleDateString(void 0, {
|
|
@@ -495,55 +568,55 @@ function de(t) {
|
|
|
495
568
|
}
|
|
496
569
|
return `${H(t.startDate)} - ${H(t.endDate)}`;
|
|
497
570
|
}
|
|
498
|
-
function
|
|
499
|
-
return !
|
|
571
|
+
function $e(t) {
|
|
572
|
+
return !Y(t);
|
|
500
573
|
}
|
|
501
|
-
function
|
|
574
|
+
function gt(t, e, n = 1) {
|
|
502
575
|
switch (e) {
|
|
503
576
|
case "day":
|
|
504
577
|
case "resource-day":
|
|
505
578
|
case "timeline-day":
|
|
506
579
|
return {
|
|
507
|
-
startDate:
|
|
508
|
-
endDate:
|
|
580
|
+
startDate: g(t),
|
|
581
|
+
endDate: w(t)
|
|
509
582
|
};
|
|
510
583
|
case "week":
|
|
511
584
|
case "resource-week":
|
|
512
585
|
case "timeline-week":
|
|
513
586
|
return {
|
|
514
587
|
startDate: m(t, n),
|
|
515
|
-
endDate:
|
|
588
|
+
endDate: T(t, n)
|
|
516
589
|
};
|
|
517
590
|
case "month": {
|
|
518
|
-
const r =
|
|
591
|
+
const r = S(t), a = M(t);
|
|
519
592
|
return {
|
|
520
593
|
startDate: m(r, n),
|
|
521
|
-
endDate:
|
|
594
|
+
endDate: T(a, n)
|
|
522
595
|
};
|
|
523
596
|
}
|
|
524
597
|
case "timeline-3day":
|
|
525
598
|
return {
|
|
526
|
-
startDate:
|
|
527
|
-
endDate:
|
|
599
|
+
startDate: g(t),
|
|
600
|
+
endDate: w(l(t, 2))
|
|
528
601
|
};
|
|
529
602
|
case "year":
|
|
530
603
|
return {
|
|
531
|
-
startDate:
|
|
532
|
-
endDate:
|
|
604
|
+
startDate: z(t),
|
|
605
|
+
endDate: ot(t)
|
|
533
606
|
};
|
|
534
607
|
case "agenda":
|
|
535
608
|
return {
|
|
536
|
-
startDate:
|
|
537
|
-
endDate:
|
|
609
|
+
startDate: g(t),
|
|
610
|
+
endDate: w(l(t, 29))
|
|
538
611
|
};
|
|
539
612
|
default:
|
|
540
613
|
return {
|
|
541
|
-
startDate:
|
|
542
|
-
endDate:
|
|
614
|
+
startDate: g(t),
|
|
615
|
+
endDate: w(t)
|
|
543
616
|
};
|
|
544
617
|
}
|
|
545
618
|
}
|
|
546
|
-
function
|
|
619
|
+
function _e(t, e) {
|
|
547
620
|
switch (e) {
|
|
548
621
|
case "day":
|
|
549
622
|
case "resource-day":
|
|
@@ -554,18 +627,18 @@ function De(t, e) {
|
|
|
554
627
|
case "week":
|
|
555
628
|
case "resource-week":
|
|
556
629
|
case "timeline-week":
|
|
557
|
-
return
|
|
630
|
+
return k(t, 1);
|
|
558
631
|
case "month":
|
|
559
|
-
return
|
|
632
|
+
return x(t, 1);
|
|
560
633
|
case "year":
|
|
561
|
-
return
|
|
634
|
+
return U(t, 1);
|
|
562
635
|
case "agenda":
|
|
563
|
-
return
|
|
636
|
+
return k(t, 1);
|
|
564
637
|
default:
|
|
565
638
|
return l(t, 1);
|
|
566
639
|
}
|
|
567
640
|
}
|
|
568
|
-
function
|
|
641
|
+
function Re(t, e) {
|
|
569
642
|
switch (e) {
|
|
570
643
|
case "day":
|
|
571
644
|
case "resource-day":
|
|
@@ -576,54 +649,54 @@ function he(t, e) {
|
|
|
576
649
|
case "week":
|
|
577
650
|
case "resource-week":
|
|
578
651
|
case "timeline-week":
|
|
579
|
-
return
|
|
652
|
+
return k(t, -1);
|
|
580
653
|
case "month":
|
|
581
|
-
return
|
|
654
|
+
return x(t, -1);
|
|
582
655
|
case "year":
|
|
583
|
-
return
|
|
656
|
+
return U(t, -1);
|
|
584
657
|
case "agenda":
|
|
585
|
-
return
|
|
658
|
+
return k(t, -1);
|
|
586
659
|
default:
|
|
587
660
|
return l(t, -1);
|
|
588
661
|
}
|
|
589
662
|
}
|
|
590
|
-
function
|
|
591
|
-
return
|
|
663
|
+
function Ae() {
|
|
664
|
+
return g(/* @__PURE__ */ new Date());
|
|
592
665
|
}
|
|
593
|
-
function
|
|
594
|
-
const n =
|
|
666
|
+
function Oe(t, e = 1) {
|
|
667
|
+
const n = S(t), r = M(t), a = m(n, e), o = T(r, e), s = [];
|
|
595
668
|
let u = a;
|
|
596
|
-
for (; u <=
|
|
597
|
-
|
|
669
|
+
for (; u <= o; )
|
|
670
|
+
s.push({
|
|
598
671
|
date: new Date(u),
|
|
599
|
-
isToday:
|
|
600
|
-
isCurrentMonth:
|
|
601
|
-
isWeekend:
|
|
672
|
+
isToday: P(u),
|
|
673
|
+
isCurrentMonth: W(u, t),
|
|
674
|
+
isWeekend: K(u),
|
|
602
675
|
dayOfWeek: u.getDay()
|
|
603
676
|
}), u = l(u, 1);
|
|
604
|
-
return
|
|
677
|
+
return s;
|
|
605
678
|
}
|
|
606
|
-
function
|
|
679
|
+
function We(t, e = 1) {
|
|
607
680
|
const n = m(t, e), r = [];
|
|
608
681
|
for (let a = 0; a < 7; a++) {
|
|
609
|
-
const
|
|
682
|
+
const o = l(n, a);
|
|
610
683
|
r.push({
|
|
611
|
-
date:
|
|
612
|
-
isToday:
|
|
613
|
-
isCurrentMonth:
|
|
614
|
-
isWeekend:
|
|
615
|
-
dayOfWeek:
|
|
684
|
+
date: o,
|
|
685
|
+
isToday: P(o),
|
|
686
|
+
isCurrentMonth: W(o, t),
|
|
687
|
+
isWeekend: K(o),
|
|
688
|
+
dayOfWeek: o.getDay()
|
|
616
689
|
});
|
|
617
690
|
}
|
|
618
691
|
return r;
|
|
619
692
|
}
|
|
620
|
-
function
|
|
621
|
-
const e =
|
|
693
|
+
function Ue(t) {
|
|
694
|
+
const e = z(t), n = [];
|
|
622
695
|
for (let r = 0; r < 12; r++) {
|
|
623
|
-
const a =
|
|
696
|
+
const a = x(e, r);
|
|
624
697
|
n.push({
|
|
625
698
|
date: a,
|
|
626
|
-
isToday:
|
|
699
|
+
isToday: W(a, /* @__PURE__ */ new Date()),
|
|
627
700
|
isCurrentMonth: !0,
|
|
628
701
|
isWeekend: !1,
|
|
629
702
|
dayOfWeek: a.getDay()
|
|
@@ -631,33 +704,33 @@ function we(t) {
|
|
|
631
704
|
}
|
|
632
705
|
return n;
|
|
633
706
|
}
|
|
634
|
-
function
|
|
707
|
+
function ve(t, e, n = 30) {
|
|
635
708
|
const r = [], a = 60 / n;
|
|
636
|
-
for (let
|
|
637
|
-
for (let
|
|
638
|
-
const u =
|
|
709
|
+
for (let o = t; o < e; o++)
|
|
710
|
+
for (let s = 0; s < a; s++) {
|
|
711
|
+
const u = s * n;
|
|
639
712
|
r.push({
|
|
640
|
-
hour:
|
|
713
|
+
hour: o,
|
|
641
714
|
minute: u,
|
|
642
|
-
label: `${
|
|
715
|
+
label: `${o.toString().padStart(2, "0")}:${u.toString().padStart(2, "0")}`
|
|
643
716
|
});
|
|
644
717
|
}
|
|
645
718
|
return r;
|
|
646
719
|
}
|
|
647
|
-
function
|
|
720
|
+
function Ye(t, e, n = "24h") {
|
|
648
721
|
const r = [];
|
|
649
722
|
for (let a = t; a <= e; a++) {
|
|
650
|
-
let
|
|
723
|
+
let o;
|
|
651
724
|
if (n === "12h") {
|
|
652
|
-
const
|
|
653
|
-
|
|
725
|
+
const s = a >= 12 ? "PM" : "AM";
|
|
726
|
+
o = `${a % 12 || 12} ${s}`;
|
|
654
727
|
} else
|
|
655
|
-
|
|
656
|
-
r.push({ hour: a, label:
|
|
728
|
+
o = `${a.toString().padStart(2, "0")}:00`;
|
|
729
|
+
r.push({ hour: a, label: o });
|
|
657
730
|
}
|
|
658
731
|
return r;
|
|
659
732
|
}
|
|
660
|
-
function
|
|
733
|
+
function Ve(t, e, n = "en-US") {
|
|
661
734
|
const r = new Intl.DateTimeFormat(n, {
|
|
662
735
|
weekday: "short",
|
|
663
736
|
month: "short",
|
|
@@ -669,34 +742,34 @@ function Se(t, e, n = "en-US") {
|
|
|
669
742
|
case "timeline-day":
|
|
670
743
|
return r.format(t);
|
|
671
744
|
case "timeline-3day": {
|
|
672
|
-
const
|
|
673
|
-
return `${a.format(
|
|
745
|
+
const o = g(t), s = l(t, 2);
|
|
746
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
674
747
|
}
|
|
675
748
|
case "week":
|
|
676
749
|
case "resource-week":
|
|
677
750
|
case "timeline-week": {
|
|
678
|
-
const
|
|
679
|
-
return `${a.format(
|
|
751
|
+
const o = m(t, 1), s = T(t, 1);
|
|
752
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
680
753
|
}
|
|
681
754
|
case "month": {
|
|
682
|
-
const
|
|
683
|
-
return `${a.format(
|
|
755
|
+
const o = S(t), s = M(t);
|
|
756
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
684
757
|
}
|
|
685
758
|
case "year":
|
|
686
759
|
return `Jan 1 - Dec 31, ${t.getFullYear()}`;
|
|
687
760
|
case "agenda": {
|
|
688
|
-
const
|
|
689
|
-
return `${a.format(
|
|
761
|
+
const o = S(t), s = M(t);
|
|
762
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
690
763
|
}
|
|
691
764
|
default:
|
|
692
765
|
return "";
|
|
693
766
|
}
|
|
694
767
|
}
|
|
695
|
-
function
|
|
696
|
-
const a =
|
|
697
|
-
return t.filter((
|
|
768
|
+
function Le(t, e, n, r = 1) {
|
|
769
|
+
const a = gt(e, n, r);
|
|
770
|
+
return t.filter((o) => o.startDate <= a.endDate && o.endDate >= a.startDate).length;
|
|
698
771
|
}
|
|
699
|
-
function
|
|
772
|
+
function Be(t, e, n = "en-US") {
|
|
700
773
|
const r = new Intl.DateTimeFormat(n, { month: "long", year: "numeric" }), a = new Intl.DateTimeFormat(n, {
|
|
701
774
|
weekday: "long",
|
|
702
775
|
month: "long",
|
|
@@ -711,8 +784,8 @@ function He(t, e, n = "en-US") {
|
|
|
711
784
|
case "week":
|
|
712
785
|
case "resource-week":
|
|
713
786
|
case "timeline-week": {
|
|
714
|
-
const
|
|
715
|
-
return u === c ? `${u} ${
|
|
787
|
+
const o = m(t, 1), s = T(t, 1), u = new Intl.DateTimeFormat(n, { month: "short" }).format(o), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s), i = o.getFullYear();
|
|
788
|
+
return u === c ? `${u} ${o.getDate()} - ${s.getDate()}, ${i}` : `${u} ${o.getDate()} - ${c} ${s.getDate()}, ${i}`;
|
|
716
789
|
}
|
|
717
790
|
case "month":
|
|
718
791
|
return r.format(t);
|
|
@@ -724,10 +797,10 @@ function He(t, e, n = "en-US") {
|
|
|
724
797
|
return r.format(t);
|
|
725
798
|
}
|
|
726
799
|
}
|
|
727
|
-
function
|
|
728
|
-
const r = new Intl.DateTimeFormat(n, { weekday: e }), a = [],
|
|
729
|
-
for (let
|
|
730
|
-
const u = (t +
|
|
800
|
+
function Ne(t = 1, e = "short", n = "en-US") {
|
|
801
|
+
const r = new Intl.DateTimeFormat(n, { weekday: e }), a = [], o = new Date(2024, 0, 7);
|
|
802
|
+
for (let s = 0; s < 7; s++) {
|
|
803
|
+
const u = (t + s) % 7, c = l(o, u);
|
|
731
804
|
a.push({
|
|
732
805
|
dayOfWeek: u,
|
|
733
806
|
label: r.format(c)
|
|
@@ -735,8 +808,8 @@ function ke(t = 1, e = "short", n = "en-US") {
|
|
|
735
808
|
}
|
|
736
809
|
return a;
|
|
737
810
|
}
|
|
738
|
-
function
|
|
739
|
-
const { startHour: a, endHour:
|
|
811
|
+
function mt(t, e, n, r = F) {
|
|
812
|
+
const { startHour: a, endHour: o } = n, s = o - a, u = s * r, c = t.startDate.getHours() + t.startDate.getMinutes() / 60, i = t.endDate.getHours() + t.endDate.getMinutes() / 60, d = Math.max(c, a), y = Math.min(i, o), D = (d - a) / s * u, h = (y - a) / s * u, f = Math.max(h - D, at);
|
|
740
813
|
return {
|
|
741
814
|
top: D,
|
|
742
815
|
height: f,
|
|
@@ -745,70 +818,70 @@ function nt(t, e, n, r = x) {
|
|
|
745
818
|
zIndex: 1
|
|
746
819
|
};
|
|
747
820
|
}
|
|
748
|
-
function
|
|
821
|
+
function Ge(t, e, n, r = F) {
|
|
749
822
|
if (t.length === 0) return [];
|
|
750
|
-
const a = [...t].sort((i,
|
|
751
|
-
const y = i.startDate.getTime() -
|
|
823
|
+
const a = [...t].sort((i, d) => {
|
|
824
|
+
const y = i.startDate.getTime() - d.startDate.getTime();
|
|
752
825
|
if (y !== 0) return y;
|
|
753
826
|
const D = i.endDate.getTime() - i.startDate.getTime();
|
|
754
|
-
return
|
|
755
|
-
}),
|
|
756
|
-
let
|
|
827
|
+
return d.endDate.getTime() - d.startDate.getTime() - D;
|
|
828
|
+
}), o = [];
|
|
829
|
+
let s = [], u = 0;
|
|
757
830
|
for (const i of a)
|
|
758
|
-
|
|
759
|
-
|
|
831
|
+
s.length === 0 || i.startDate.getTime() < u ? (s.push(i), u = Math.max(u, i.endDate.getTime())) : (o.push(s), s = [i], u = i.endDate.getTime());
|
|
832
|
+
s.length > 0 && o.push(s);
|
|
760
833
|
const c = [];
|
|
761
|
-
for (const i of
|
|
762
|
-
const
|
|
834
|
+
for (const i of o) {
|
|
835
|
+
const d = [];
|
|
763
836
|
for (const f of i) {
|
|
764
|
-
const
|
|
765
|
-
let
|
|
766
|
-
for (let b = 0; b <
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
771
|
-
|
|
837
|
+
const j = f.startDate.getTime(), J = f.endDate.getTime();
|
|
838
|
+
let E = -1;
|
|
839
|
+
for (let b = 0; b < d.length; b++) {
|
|
840
|
+
const C = d[b];
|
|
841
|
+
if (!C) continue;
|
|
842
|
+
const L = C[C.length - 1];
|
|
843
|
+
if (L && L.endTime <= j) {
|
|
844
|
+
E = b;
|
|
772
845
|
break;
|
|
773
846
|
}
|
|
774
847
|
}
|
|
775
|
-
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
const
|
|
848
|
+
E === -1 && (E = d.length, d.push([]));
|
|
849
|
+
const V = d[E];
|
|
850
|
+
V && V.push({ event: f, endTime: J });
|
|
851
|
+
const X = mt(f, e, n, r);
|
|
779
852
|
c.push({
|
|
780
853
|
event: f,
|
|
781
|
-
position:
|
|
782
|
-
column:
|
|
854
|
+
position: X,
|
|
855
|
+
column: E,
|
|
783
856
|
columnSpan: 1
|
|
784
857
|
});
|
|
785
858
|
}
|
|
786
|
-
const D = 100 /
|
|
859
|
+
const D = 100 / d.length, h = new Set(i.map((f) => f.id));
|
|
787
860
|
for (const f of c)
|
|
788
861
|
h.has(f.event.id) && (f.position.left = f.column * D, f.position.width = D * f.columnSpan, f.position.zIndex = f.column + 1);
|
|
789
862
|
}
|
|
790
863
|
return c;
|
|
791
864
|
}
|
|
792
|
-
function
|
|
793
|
-
const { startHour:
|
|
865
|
+
function Pe(t, e, n, r = F, a = 30) {
|
|
866
|
+
const { startHour: o, endHour: s } = n, u = s - o, c = u * r, i = t / c * u, y = (o + i) * 60, D = Math.round(y / a) * a, h = new Date(e);
|
|
794
867
|
return h.setHours(0, 0, 0, 0), h.setMinutes(D), h;
|
|
795
868
|
}
|
|
796
|
-
function
|
|
797
|
-
const { startHour: r, endHour: a } = e,
|
|
798
|
-
return (Math.max(r, Math.min(u, a)) - r) /
|
|
869
|
+
function Ke(t, e, n = F) {
|
|
870
|
+
const { startHour: r, endHour: a } = e, o = a - r, s = o * n, u = t.getHours() + t.getMinutes() / 60;
|
|
871
|
+
return (Math.max(r, Math.min(u, a)) - r) / o * s;
|
|
799
872
|
}
|
|
800
|
-
function
|
|
873
|
+
function ze(t, e) {
|
|
801
874
|
return t.startDate < e.endDate && t.endDate > e.startDate;
|
|
802
875
|
}
|
|
803
|
-
function
|
|
876
|
+
function je(t) {
|
|
804
877
|
if (t.length === 0) return [];
|
|
805
|
-
const e = [...t].sort((
|
|
878
|
+
const e = [...t].sort((o, s) => o.startDate.getTime() - s.startDate.getTime()), n = [];
|
|
806
879
|
let r = [], a = 0;
|
|
807
|
-
for (const
|
|
808
|
-
r.length === 0 ||
|
|
880
|
+
for (const o of e)
|
|
881
|
+
r.length === 0 || o.startDate.getTime() < a ? (r.push(o), a = Math.max(a, o.endDate.getTime())) : (r.length > 0 && n.push(r), r = [o], a = o.endDate.getTime());
|
|
809
882
|
return r.length > 0 && n.push(r), n;
|
|
810
883
|
}
|
|
811
|
-
function
|
|
884
|
+
function Je(t, e, n) {
|
|
812
885
|
const r = Math.max(0, Math.min(t, e)), a = Math.min(n, Math.max(t, e));
|
|
813
886
|
return {
|
|
814
887
|
top: r,
|
|
@@ -816,121 +889,132 @@ function Ce(t, e, n) {
|
|
|
816
889
|
};
|
|
817
890
|
}
|
|
818
891
|
export {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
892
|
+
Ye as $,
|
|
893
|
+
Y as A,
|
|
894
|
+
te as B,
|
|
895
|
+
Et as C,
|
|
896
|
+
bt as D,
|
|
897
|
+
It as E,
|
|
898
|
+
Zt as F,
|
|
899
|
+
v as G,
|
|
900
|
+
Ft as H,
|
|
901
|
+
Qt as I,
|
|
902
|
+
ut as J,
|
|
903
|
+
re as K,
|
|
904
|
+
w as L,
|
|
905
|
+
Ct as M,
|
|
906
|
+
M as N,
|
|
907
|
+
T as O,
|
|
908
|
+
ot as P,
|
|
909
|
+
ze as Q,
|
|
910
|
+
_ as R,
|
|
911
|
+
it as S,
|
|
912
|
+
lt as T,
|
|
913
|
+
ct as U,
|
|
914
|
+
ft as V,
|
|
915
|
+
dt as W,
|
|
916
|
+
ee as X,
|
|
917
|
+
Ce as Y,
|
|
918
|
+
ue as Z,
|
|
919
|
+
H as _,
|
|
920
|
+
$ as a,
|
|
921
|
+
g as a$,
|
|
922
|
+
Oe as a0,
|
|
923
|
+
ce as a1,
|
|
924
|
+
ve as a2,
|
|
925
|
+
We as a3,
|
|
926
|
+
Ue as a4,
|
|
927
|
+
Me as a5,
|
|
928
|
+
Wt as a6,
|
|
929
|
+
Lt as a7,
|
|
930
|
+
Kt as a8,
|
|
931
|
+
Fe as a9,
|
|
932
|
+
A as aA,
|
|
933
|
+
p as aB,
|
|
934
|
+
W as aC,
|
|
935
|
+
Yt as aD,
|
|
936
|
+
Nt as aE,
|
|
937
|
+
P as aF,
|
|
938
|
+
K as aG,
|
|
939
|
+
de as aH,
|
|
940
|
+
qt as aI,
|
|
941
|
+
Xt as aJ,
|
|
942
|
+
_e as aK,
|
|
943
|
+
Re as aL,
|
|
944
|
+
Ae as aM,
|
|
945
|
+
ne as aN,
|
|
946
|
+
I as aO,
|
|
947
|
+
ht as aP,
|
|
948
|
+
pt as aQ,
|
|
949
|
+
xe as aR,
|
|
950
|
+
tt as aS,
|
|
951
|
+
et as aT,
|
|
952
|
+
Tt as aU,
|
|
953
|
+
le as aV,
|
|
954
|
+
Pt as aW,
|
|
955
|
+
$e as aX,
|
|
956
|
+
pe as aY,
|
|
957
|
+
ye as aZ,
|
|
958
|
+
he as a_,
|
|
959
|
+
ke as aa,
|
|
960
|
+
Le as ab,
|
|
961
|
+
Se as ac,
|
|
962
|
+
fe as ad,
|
|
963
|
+
oe as ae,
|
|
964
|
+
He as af,
|
|
965
|
+
je as ag,
|
|
966
|
+
Ve as ah,
|
|
967
|
+
be as ai,
|
|
968
|
+
gt as aj,
|
|
969
|
+
Be as ak,
|
|
970
|
+
se as al,
|
|
971
|
+
ie as am,
|
|
972
|
+
vt as an,
|
|
973
|
+
Ne as ao,
|
|
899
974
|
ae as ap,
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
975
|
+
ge as aq,
|
|
976
|
+
me as ar,
|
|
977
|
+
we as as,
|
|
978
|
+
Ee as at,
|
|
979
|
+
Te as au,
|
|
980
|
+
jt as av,
|
|
981
|
+
zt as aw,
|
|
982
|
+
Jt as ax,
|
|
983
|
+
R as ay,
|
|
984
|
+
Ie as az,
|
|
985
|
+
Rt as b,
|
|
986
|
+
S as b0,
|
|
987
|
+
m as b1,
|
|
988
|
+
z as b2,
|
|
989
|
+
Ot as b3,
|
|
990
|
+
Vt as b4,
|
|
991
|
+
Ut as b5,
|
|
992
|
+
Bt as b6,
|
|
993
|
+
Ke as b7,
|
|
994
|
+
Pe as b8,
|
|
995
|
+
F as c,
|
|
996
|
+
St as d,
|
|
997
|
+
At as e,
|
|
998
|
+
_t as f,
|
|
999
|
+
Ht as g,
|
|
1000
|
+
Mt as h,
|
|
1001
|
+
kt as i,
|
|
1002
|
+
xt as j,
|
|
1003
|
+
at as k,
|
|
1004
|
+
$t as l,
|
|
1005
|
+
rt as m,
|
|
1006
|
+
nt as n,
|
|
1007
|
+
l as o,
|
|
1008
|
+
st as p,
|
|
1009
|
+
Gt as q,
|
|
1010
|
+
x as r,
|
|
1011
|
+
k as s,
|
|
1012
|
+
U as t,
|
|
1013
|
+
De as u,
|
|
1014
|
+
mt as v,
|
|
1015
|
+
Ge as w,
|
|
1016
|
+
Je as x,
|
|
1017
|
+
yt as y,
|
|
1018
|
+
wt as z
|
|
935
1019
|
};
|
|
936
|
-
//# sourceMappingURL=position-utils-
|
|
1020
|
+
//# sourceMappingURL=position-utils-DpaKqYhO.js.map
|