@innosolutions/inno-calendar 1.0.69 → 1.0.70
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-QSVTdgaz.js → agenda-widget-GRHaHwQ2.js} +38 -35
- package/dist/agenda-widget-GRHaHwQ2.js.map +1 -0
- package/dist/agenda-widget-TLJuxen3.cjs +2 -0
- package/dist/agenda-widget-TLJuxen3.cjs.map +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/core/types.d.ts +16 -9
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{slot-selection-context-CjS_VIPj.js → slot-selection-context-D6zo91K_.js} +121 -114
- package/dist/slot-selection-context-D6zo91K_.js.map +1 -0
- package/dist/slot-selection-context-DvTn_R-Z.cjs +2 -0
- package/dist/slot-selection-context-DvTn_R-Z.cjs.map +1 -0
- package/dist/{tailwind-calendar-KJ1XJ4gr.cjs → tailwind-calendar-BA7v_Wgx.cjs} +2 -2
- package/dist/{tailwind-calendar-KJ1XJ4gr.cjs.map → tailwind-calendar-BA7v_Wgx.cjs.map} +1 -1
- package/dist/{tailwind-calendar-B6qsueM3.js → tailwind-calendar-Bh1yB1jf.js} +2 -2
- package/dist/{tailwind-calendar-B6qsueM3.js.map → tailwind-calendar-Bh1yB1jf.js.map} +1 -1
- package/dist/{week-view-B1KsZsC3.js → week-view-BbtTpJTU.js} +2 -2
- package/dist/{week-view-B1KsZsC3.js.map → week-view-BbtTpJTU.js.map} +1 -1
- package/dist/{week-view-Dv-Uz0eT.cjs → week-view-D1wefMb8.cjs} +2 -2
- package/dist/{week-view-Dv-Uz0eT.cjs.map → week-view-D1wefMb8.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/agenda-widget-BJroIHYG.cjs +0 -2
- package/dist/agenda-widget-BJroIHYG.cjs.map +0 -1
- package/dist/agenda-widget-QSVTdgaz.js.map +0 -1
- package/dist/slot-selection-context-CjS_VIPj.js.map +0 -1
- package/dist/slot-selection-context-CmE-aWgt.cjs +0 -2
- package/dist/slot-selection-context-CmE-aWgt.cjs.map +0 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { jsx as $ } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { P as me, aR as pe, aX as ye, aP as
|
|
2
|
+
import { useState as I, useCallback as w, useContext as R, createContext as z, useMemo as W, useEffect as F, useRef as j } from "react";
|
|
3
|
+
import { P as me, aR as pe, aX as ye, aP as A } from "./position-utils-BzmOPdvQ.js";
|
|
4
4
|
const B = z(void 0);
|
|
5
|
-
function
|
|
5
|
+
function _e({
|
|
6
6
|
children: n,
|
|
7
7
|
onEventDrop: t
|
|
8
8
|
}) {
|
|
9
|
-
const [e, r] =
|
|
10
|
-
const
|
|
9
|
+
const [e, r] = I(null), d = w((s) => {
|
|
10
|
+
const f = typeof s.startDate == "string" ? new Date(s.startDate) : s.startDate, S = typeof s.endDate == "string" ? new Date(s.endDate) : s.endDate;
|
|
11
11
|
r({
|
|
12
12
|
event: s,
|
|
13
|
-
originalStartDate:
|
|
13
|
+
originalStartDate: f,
|
|
14
14
|
originalEndDate: S
|
|
15
15
|
});
|
|
16
|
-
}, []), c = w((s,
|
|
16
|
+
}, []), c = w((s, f, S, i) => {
|
|
17
17
|
r((H) => H ? {
|
|
18
18
|
...H,
|
|
19
19
|
previewDate: s,
|
|
20
|
-
previewHour:
|
|
20
|
+
previewHour: f,
|
|
21
21
|
previewMinute: S,
|
|
22
22
|
...i !== void 0 && { targetResourceId: i }
|
|
23
23
|
} : null);
|
|
24
24
|
}, []), g = w(() => {
|
|
25
25
|
if (!e) return null;
|
|
26
|
-
const { event: s, originalStartDate:
|
|
26
|
+
const { event: s, originalStartDate: f, originalEndDate: S, previewDate: i, previewHour: H, previewMinute: O, targetResourceId: v } = e, k = S.getTime() - f.getTime();
|
|
27
27
|
let D;
|
|
28
|
-
i ? (D = new Date(i), typeof H == "number" ? D.setHours(H,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
i ? (D = new Date(i), typeof H == "number" ? D.setHours(H, O ?? 0, 0, 0) : D.setHours(
|
|
29
|
+
f.getHours(),
|
|
30
|
+
f.getMinutes(),
|
|
31
|
+
f.getSeconds(),
|
|
32
32
|
0
|
|
33
|
-
)) : D =
|
|
34
|
-
const m = new Date(D.getTime() + k),
|
|
33
|
+
)) : D = f;
|
|
34
|
+
const m = new Date(D.getTime() + k), h = {
|
|
35
35
|
event: s,
|
|
36
36
|
newStartDate: D,
|
|
37
37
|
newEndDate: m,
|
|
38
38
|
...v !== void 0 && { newResourceId: v }
|
|
39
39
|
};
|
|
40
|
-
return r(null), t?.(
|
|
40
|
+
return r(null), t?.(h), h;
|
|
41
41
|
}, [e, t]), u = w(() => {
|
|
42
42
|
r(null);
|
|
43
43
|
}, []);
|
|
@@ -47,7 +47,7 @@ function Ue({
|
|
|
47
47
|
value: {
|
|
48
48
|
dragState: e,
|
|
49
49
|
isDragging: e !== null,
|
|
50
|
-
startDrag:
|
|
50
|
+
startDrag: d,
|
|
51
51
|
updateDragPreview: c,
|
|
52
52
|
endDrag: g,
|
|
53
53
|
cancelDrag: u
|
|
@@ -56,13 +56,13 @@ function Ue({
|
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function xe() {
|
|
60
60
|
const n = R(B);
|
|
61
61
|
if (!n)
|
|
62
62
|
throw new Error("useDragDrop must be used within a DragDropProvider");
|
|
63
63
|
return n;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Ve() {
|
|
66
66
|
return R(B) ?? null;
|
|
67
67
|
}
|
|
68
68
|
const be = {
|
|
@@ -112,12 +112,12 @@ function ve(n, t) {
|
|
|
112
112
|
console.warn("[InnoCalendar] Failed to save preferences to localStorage");
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Te(n = {}) {
|
|
116
116
|
const {
|
|
117
117
|
modes: t = {},
|
|
118
118
|
locked: e = {},
|
|
119
119
|
defaults: r = {},
|
|
120
|
-
storageKey:
|
|
120
|
+
storageKey: d = me,
|
|
121
121
|
disableStorage: c = !1
|
|
122
122
|
} = n, g = W(
|
|
123
123
|
() => ({
|
|
@@ -125,27 +125,27 @@ function Oe(n = {}) {
|
|
|
125
125
|
...r
|
|
126
126
|
}),
|
|
127
127
|
[r]
|
|
128
|
-
), [u, s] =
|
|
129
|
-
|
|
130
|
-
c || ve(
|
|
131
|
-
}, [u,
|
|
128
|
+
), [u, s] = I(() => c ? {} : Ie(d)), [f, S] = I({});
|
|
129
|
+
F(() => {
|
|
130
|
+
c || ve(d, u);
|
|
131
|
+
}, [u, d, c]);
|
|
132
132
|
const i = w(
|
|
133
133
|
(o) => t[o] ?? "user",
|
|
134
134
|
[t]
|
|
135
135
|
), H = w(
|
|
136
136
|
(o) => i(o) === "locked",
|
|
137
137
|
[i]
|
|
138
|
-
),
|
|
138
|
+
), O = w(
|
|
139
139
|
(o) => i(o) === "user" && !c,
|
|
140
140
|
[i, c]
|
|
141
141
|
), v = W(() => {
|
|
142
142
|
const o = { ...g };
|
|
143
143
|
for (const l of Object.keys(o)) {
|
|
144
144
|
const b = i(l);
|
|
145
|
-
b === "locked" && l in e ? o[l] = e[l] : b === "session" && l in
|
|
145
|
+
b === "locked" && l in e ? o[l] = e[l] : b === "session" && l in f ? o[l] = f[l] : b === "user" && l in u && (o[l] = u[l]);
|
|
146
146
|
}
|
|
147
147
|
return o;
|
|
148
|
-
}, [g, u,
|
|
148
|
+
}, [g, u, f, e, i]), k = w(
|
|
149
149
|
(o, l) => {
|
|
150
150
|
const b = i(o);
|
|
151
151
|
if (b === "locked") {
|
|
@@ -172,8 +172,8 @@ function Oe(n = {}) {
|
|
|
172
172
|
},
|
|
173
173
|
[i]
|
|
174
174
|
), m = w(() => {
|
|
175
|
-
s({}), S({}), c || localStorage.removeItem(
|
|
176
|
-
}, [
|
|
175
|
+
s({}), S({}), c || localStorage.removeItem(d);
|
|
176
|
+
}, [d, c]), h = w(
|
|
177
177
|
(o) => {
|
|
178
178
|
const l = i(o);
|
|
179
179
|
if (l === "locked") {
|
|
@@ -195,9 +195,9 @@ function Oe(n = {}) {
|
|
|
195
195
|
setPreference: k,
|
|
196
196
|
setPreferences: D,
|
|
197
197
|
resetPreferences: m,
|
|
198
|
-
resetPreference:
|
|
198
|
+
resetPreference: h,
|
|
199
199
|
isLocked: H,
|
|
200
|
-
isPersisted:
|
|
200
|
+
isPersisted: O,
|
|
201
201
|
getMode: i
|
|
202
202
|
};
|
|
203
203
|
}
|
|
@@ -216,29 +216,36 @@ const K = z(void 0), ue = {
|
|
|
216
216
|
// Friday
|
|
217
217
|
6: { enabled: !0, from: 8, to: 12 }
|
|
218
218
|
// Saturday
|
|
219
|
-
},
|
|
219
|
+
}, Oe = { start: 0, end: 24 };
|
|
220
220
|
function Fe({
|
|
221
221
|
children: n,
|
|
222
222
|
initialEvents: t = [],
|
|
223
223
|
initialUsers: e = [],
|
|
224
224
|
initialScheduleTypes: r = [],
|
|
225
|
-
initialView:
|
|
225
|
+
initialView: d,
|
|
226
226
|
initialDate: c,
|
|
227
227
|
initialSelectedUserId: g = "all",
|
|
228
228
|
initialScheduleTypeIds: u = [],
|
|
229
229
|
initialParticipantIds: s = [],
|
|
230
|
-
initialWorkingHoursView:
|
|
230
|
+
initialWorkingHoursView: f = "default",
|
|
231
231
|
initialSearchQuery: S = "",
|
|
232
232
|
preferencesConfig: i,
|
|
233
233
|
initialFocusEventId: H = null,
|
|
234
|
-
onDateChange:
|
|
234
|
+
onDateChange: O,
|
|
235
235
|
onViewChange: v
|
|
236
236
|
}) {
|
|
237
|
-
const { preferences: k, setPreference: D, isLocked: m } =
|
|
238
|
-
() =>
|
|
239
|
-
), [l, b] =
|
|
237
|
+
const { preferences: k, setPreference: D, isLocked: m } = Te(i), [h, o] = I(
|
|
238
|
+
() => pe() ?? d ?? "week"
|
|
239
|
+
), [l, b] = I(
|
|
240
240
|
c ?? /* @__PURE__ */ new Date()
|
|
241
|
-
)
|
|
241
|
+
);
|
|
242
|
+
F(() => {
|
|
243
|
+
if (d !== void 0 && h !== d) {
|
|
244
|
+
const a = setTimeout(() => v?.(h), 0);
|
|
245
|
+
return () => clearTimeout(a);
|
|
246
|
+
}
|
|
247
|
+
}, []);
|
|
248
|
+
const [p, P] = I(
|
|
242
249
|
g
|
|
243
250
|
), C = k.badgeVariant ?? "colored", Y = w(
|
|
244
251
|
(a) => {
|
|
@@ -248,27 +255,27 @@ function Fe({
|
|
|
248
255
|
), G = k.workingHours ?? ue, J = w(
|
|
249
256
|
(a) => {
|
|
250
257
|
if (!m("workingHours")) {
|
|
251
|
-
const y = k.workingHours ?? ue,
|
|
252
|
-
D("workingHours",
|
|
258
|
+
const y = k.workingHours ?? ue, T = typeof a == "function" ? a(y) : a;
|
|
259
|
+
D("workingHours", T);
|
|
253
260
|
}
|
|
254
261
|
},
|
|
255
262
|
[D, m, k.workingHours]
|
|
256
|
-
), E = k.visibleHours,
|
|
263
|
+
), E = k.visibleHours, x = W(() => E ? {
|
|
257
264
|
start: E.start ?? E.from ?? 0,
|
|
258
265
|
end: E.end ?? E.to ?? 24
|
|
259
|
-
} :
|
|
266
|
+
} : Oe, [E]), q = w(
|
|
260
267
|
(a) => {
|
|
261
268
|
if (!m("visibleHours")) {
|
|
262
|
-
const y = typeof a == "function" ? a(
|
|
269
|
+
const y = typeof a == "function" ? a(x) : a;
|
|
263
270
|
D("visibleHours", {
|
|
264
271
|
from: y.start,
|
|
265
272
|
to: y.end
|
|
266
273
|
});
|
|
267
274
|
}
|
|
268
275
|
},
|
|
269
|
-
[D, m,
|
|
270
|
-
), [de, fe] =
|
|
271
|
-
|
|
276
|
+
[D, m, x]
|
|
277
|
+
), [de, fe] = I(
|
|
278
|
+
f === "enabled" ? !0 : f === "disabled" ? !1 : k.showWorkingHoursOnly ?? !1
|
|
272
279
|
), X = de, Z = w(
|
|
273
280
|
(a) => {
|
|
274
281
|
fe(a), m("showWorkingHoursOnly") || D("showWorkingHoursOnly", a);
|
|
@@ -279,14 +286,14 @@ function Fe({
|
|
|
279
286
|
m("slotDuration") || D("slotDuration", a);
|
|
280
287
|
},
|
|
281
288
|
[D, m]
|
|
282
|
-
), [
|
|
283
|
-
|
|
289
|
+
), [V, ne] = I(t);
|
|
290
|
+
F(() => {
|
|
284
291
|
ne(t);
|
|
285
292
|
}, [t]);
|
|
286
|
-
const [
|
|
293
|
+
const [L, ge] = I(u), [N, We] = I(s), [U, we] = I(S), [re, oe] = I(
|
|
287
294
|
H ?? null
|
|
288
295
|
);
|
|
289
|
-
|
|
296
|
+
F(() => {
|
|
290
297
|
H && oe(H);
|
|
291
298
|
}, [H]);
|
|
292
299
|
const se = w(() => oe(null), []), ae = w(
|
|
@@ -296,34 +303,34 @@ function Fe({
|
|
|
296
303
|
[v, D, m]
|
|
297
304
|
), ie = w(
|
|
298
305
|
(a, y) => {
|
|
299
|
-
b(a),
|
|
306
|
+
b(a), O?.(a, y ?? h);
|
|
300
307
|
},
|
|
301
|
-
[
|
|
308
|
+
[O, h]
|
|
302
309
|
), ce = W(() => {
|
|
303
|
-
let a =
|
|
304
|
-
if (
|
|
305
|
-
(y) => y.scheduleTypeId !== void 0 &&
|
|
306
|
-
)),
|
|
307
|
-
(
|
|
310
|
+
let a = V;
|
|
311
|
+
if (L.length > 0 && (a = a.filter(
|
|
312
|
+
(y) => y.scheduleTypeId !== void 0 && L.includes(y.scheduleTypeId)
|
|
313
|
+
)), N.length > 0 && (a = a.filter((y) => y.participants?.length ? y.participants.some(
|
|
314
|
+
(T) => N.includes(T.id)
|
|
308
315
|
) : !1)), p !== "all" && (a = a.filter(
|
|
309
|
-
(y) => y.participants?.some((
|
|
310
|
-
)),
|
|
311
|
-
const y =
|
|
316
|
+
(y) => y.participants?.some((T) => T.id === p)
|
|
317
|
+
)), U.trim()) {
|
|
318
|
+
const y = U.toLowerCase();
|
|
312
319
|
a = a.filter(
|
|
313
|
-
(
|
|
320
|
+
(T) => A(T.title).toLowerCase().includes(y) || A(T.description).toLowerCase().includes(y) || A(T.scheduleTypeName).toLowerCase().includes(y) || T.participants?.some((De) => De.name.toLowerCase().includes(y))
|
|
314
321
|
);
|
|
315
322
|
}
|
|
316
323
|
return a;
|
|
317
324
|
}, [
|
|
318
|
-
x,
|
|
319
325
|
V,
|
|
320
|
-
|
|
326
|
+
L,
|
|
327
|
+
N,
|
|
321
328
|
p,
|
|
322
|
-
|
|
329
|
+
U
|
|
323
330
|
]), Se = W(
|
|
324
331
|
() => ({
|
|
325
332
|
// View & Navigation
|
|
326
|
-
view:
|
|
333
|
+
view: h,
|
|
327
334
|
setView: ae,
|
|
328
335
|
selectedDate: l,
|
|
329
336
|
setSelectedDate: ie,
|
|
@@ -336,7 +343,7 @@ function Fe({
|
|
|
336
343
|
// Time Configuration
|
|
337
344
|
workingHours: G,
|
|
338
345
|
setWorkingHours: J,
|
|
339
|
-
visibleHours:
|
|
346
|
+
visibleHours: x,
|
|
340
347
|
setVisibleHours: q,
|
|
341
348
|
showWorkingHoursOnly: X,
|
|
342
349
|
setShowWorkingHoursOnly: Z,
|
|
@@ -345,15 +352,15 @@ function Fe({
|
|
|
345
352
|
// Preferences
|
|
346
353
|
isPreferenceLocked: m,
|
|
347
354
|
// Data
|
|
348
|
-
events:
|
|
355
|
+
events: V,
|
|
349
356
|
setEvents: ne,
|
|
350
357
|
users: e,
|
|
351
358
|
scheduleTypes: r,
|
|
352
359
|
// Filters
|
|
353
|
-
selectedScheduleTypeIds:
|
|
360
|
+
selectedScheduleTypeIds: L,
|
|
354
361
|
setSelectedScheduleTypeIds: ge,
|
|
355
362
|
// Search
|
|
356
|
-
searchQuery:
|
|
363
|
+
searchQuery: U,
|
|
357
364
|
setSearchQuery: we,
|
|
358
365
|
// Computed
|
|
359
366
|
filteredEvents: ce,
|
|
@@ -362,7 +369,7 @@ function Fe({
|
|
|
362
369
|
clearFocusEventId: se
|
|
363
370
|
}),
|
|
364
371
|
[
|
|
365
|
-
|
|
372
|
+
h,
|
|
366
373
|
ae,
|
|
367
374
|
l,
|
|
368
375
|
ie,
|
|
@@ -371,18 +378,18 @@ function Fe({
|
|
|
371
378
|
Y,
|
|
372
379
|
G,
|
|
373
380
|
J,
|
|
374
|
-
|
|
381
|
+
x,
|
|
375
382
|
q,
|
|
376
383
|
X,
|
|
377
384
|
Z,
|
|
378
385
|
ee,
|
|
379
386
|
te,
|
|
380
387
|
m,
|
|
381
|
-
|
|
388
|
+
V,
|
|
382
389
|
e,
|
|
383
390
|
r,
|
|
384
|
-
V,
|
|
385
391
|
L,
|
|
392
|
+
U,
|
|
386
393
|
ce,
|
|
387
394
|
re,
|
|
388
395
|
se
|
|
@@ -390,7 +397,7 @@ function Fe({
|
|
|
390
397
|
);
|
|
391
398
|
return /* @__PURE__ */ $(K.Provider, { value: Se, children: n });
|
|
392
399
|
}
|
|
393
|
-
function
|
|
400
|
+
function M() {
|
|
394
401
|
const n = R(K);
|
|
395
402
|
if (!n)
|
|
396
403
|
throw new Error(
|
|
@@ -402,11 +409,11 @@ function Me() {
|
|
|
402
409
|
return R(K);
|
|
403
410
|
}
|
|
404
411
|
function Ne() {
|
|
405
|
-
const { view: n, setView: t, selectedDate: e, setSelectedDate: r, slotDuration:
|
|
406
|
-
return { view: n, setView: t, selectedDate: e, setSelectedDate: r, slotDuration:
|
|
412
|
+
const { view: n, setView: t, selectedDate: e, setSelectedDate: r, slotDuration: d } = M();
|
|
413
|
+
return { view: n, setView: t, selectedDate: e, setSelectedDate: r, slotDuration: d };
|
|
407
414
|
}
|
|
408
415
|
function je() {
|
|
409
|
-
const { events: n, setEvents: t, filteredEvents: e } =
|
|
416
|
+
const { events: n, setEvents: t, filteredEvents: e } = M();
|
|
410
417
|
return { events: n, setEvents: t, filteredEvents: e };
|
|
411
418
|
}
|
|
412
419
|
function Ae() {
|
|
@@ -415,15 +422,15 @@ function Ae() {
|
|
|
415
422
|
setSelectedScheduleTypeIds: t,
|
|
416
423
|
selectedUserId: e,
|
|
417
424
|
setSelectedUserId: r,
|
|
418
|
-
searchQuery:
|
|
425
|
+
searchQuery: d,
|
|
419
426
|
setSearchQuery: c
|
|
420
|
-
} =
|
|
427
|
+
} = M();
|
|
421
428
|
return {
|
|
422
429
|
selectedScheduleTypeIds: n,
|
|
423
430
|
setSelectedScheduleTypeIds: t,
|
|
424
431
|
selectedUserId: e,
|
|
425
432
|
setSelectedUserId: r,
|
|
426
|
-
searchQuery:
|
|
433
|
+
searchQuery: d,
|
|
427
434
|
setSearchQuery: c
|
|
428
435
|
};
|
|
429
436
|
}
|
|
@@ -433,20 +440,20 @@ function $e() {
|
|
|
433
440
|
setWorkingHours: t,
|
|
434
441
|
visibleHours: e,
|
|
435
442
|
setVisibleHours: r,
|
|
436
|
-
showWorkingHoursOnly:
|
|
443
|
+
showWorkingHoursOnly: d,
|
|
437
444
|
setShowWorkingHoursOnly: c
|
|
438
|
-
} =
|
|
445
|
+
} = M();
|
|
439
446
|
return {
|
|
440
447
|
workingHours: n,
|
|
441
448
|
setWorkingHours: t,
|
|
442
449
|
visibleHours: e,
|
|
443
450
|
setVisibleHours: r,
|
|
444
|
-
showWorkingHoursOnly:
|
|
451
|
+
showWorkingHoursOnly: d,
|
|
445
452
|
setShowWorkingHoursOnly: c
|
|
446
453
|
};
|
|
447
454
|
}
|
|
448
455
|
const Q = z(void 0);
|
|
449
|
-
function
|
|
456
|
+
function _(n) {
|
|
450
457
|
const t = new Date(n.date);
|
|
451
458
|
return typeof n.hour == "number" && t.setHours(n.hour, n.minute ?? 0, 0, 0), t;
|
|
452
459
|
}
|
|
@@ -457,8 +464,8 @@ function Pe(n) {
|
|
|
457
464
|
function Ce(n, t) {
|
|
458
465
|
return n.getFullYear() === t.getFullYear() && n.getMonth() === t.getMonth() && n.getDate() === t.getDate();
|
|
459
466
|
}
|
|
460
|
-
function le(n, t, e, r,
|
|
461
|
-
const c =
|
|
467
|
+
function le(n, t, e, r, d = 30) {
|
|
468
|
+
const c = _(n), g = _(t);
|
|
462
469
|
let u = c, s = g;
|
|
463
470
|
if (g < c && (u = g, s = c), e === "day")
|
|
464
471
|
if (Ce(u, s)) {
|
|
@@ -467,8 +474,8 @@ function le(n, t, e, r, f = 30) {
|
|
|
467
474
|
} else
|
|
468
475
|
u.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999);
|
|
469
476
|
else {
|
|
470
|
-
const
|
|
471
|
-
s = new Date(s.getTime() +
|
|
477
|
+
const f = d * 60 * 1e3;
|
|
478
|
+
s = new Date(s.getTime() + f);
|
|
472
479
|
const S = s.getTime() - u.getTime(), i = r * 60 * 1e3;
|
|
473
480
|
S < i && (s = new Date(u.getTime() + i));
|
|
474
481
|
}
|
|
@@ -478,39 +485,39 @@ function le(n, t, e, r, f = 30) {
|
|
|
478
485
|
};
|
|
479
486
|
}
|
|
480
487
|
function Ee(n, t, e, r) {
|
|
481
|
-
const
|
|
488
|
+
const d = _(n), c = _(t), g = _(e), u = c <= g ? c : g, s = c <= g ? g : c;
|
|
482
489
|
if (r === "day") {
|
|
483
|
-
const
|
|
484
|
-
|
|
490
|
+
const f = new Date(d);
|
|
491
|
+
f.setHours(0, 0, 0, 0);
|
|
485
492
|
const S = new Date(u);
|
|
486
493
|
S.setHours(0, 0, 0, 0);
|
|
487
494
|
const i = new Date(s);
|
|
488
|
-
return i.setHours(0, 0, 0, 0),
|
|
495
|
+
return i.setHours(0, 0, 0, 0), f >= S && f <= i;
|
|
489
496
|
}
|
|
490
|
-
return
|
|
497
|
+
return d >= u && d <= s;
|
|
491
498
|
}
|
|
492
499
|
function ze({
|
|
493
500
|
children: n,
|
|
494
501
|
mode: t = "time",
|
|
495
502
|
onSelect: e,
|
|
496
503
|
minDurationMinutes: r = 30,
|
|
497
|
-
slotDurationMinutes:
|
|
504
|
+
slotDurationMinutes: d = 30,
|
|
498
505
|
enabled: c = !0
|
|
499
506
|
}) {
|
|
500
|
-
const [g, u] =
|
|
501
|
-
|
|
502
|
-
|
|
507
|
+
const [g, u] = I(null), s = j(!1), f = j(!1), S = j(null), i = w(() => {
|
|
508
|
+
f.current = !0, S.current && clearTimeout(S.current), S.current = setTimeout(() => {
|
|
509
|
+
f.current = !1;
|
|
503
510
|
}, 300);
|
|
504
511
|
}, []), H = w(
|
|
505
512
|
(o) => {
|
|
506
|
-
!c ||
|
|
513
|
+
!c || f.current || (s.current = !0, u({
|
|
507
514
|
start: o,
|
|
508
515
|
end: o,
|
|
509
516
|
isSelecting: !0
|
|
510
517
|
}));
|
|
511
518
|
},
|
|
512
519
|
[c]
|
|
513
|
-
),
|
|
520
|
+
), O = w(
|
|
514
521
|
(o) => {
|
|
515
522
|
c && s.current && u((l) => l ? {
|
|
516
523
|
...l,
|
|
@@ -526,7 +533,7 @@ function ze({
|
|
|
526
533
|
o.end,
|
|
527
534
|
t,
|
|
528
535
|
r,
|
|
529
|
-
|
|
536
|
+
d
|
|
530
537
|
);
|
|
531
538
|
return e?.(l), {
|
|
532
539
|
...o,
|
|
@@ -535,7 +542,7 @@ function ze({
|
|
|
535
542
|
}), setTimeout(() => {
|
|
536
543
|
u(null);
|
|
537
544
|
}, 100));
|
|
538
|
-
}, [t, r,
|
|
545
|
+
}, [t, r, d, e]), k = w(() => {
|
|
539
546
|
s.current = !1, u(null);
|
|
540
547
|
}, []), D = w(
|
|
541
548
|
(o) => g ? Ee(o, g.start, g.end, t) : !1,
|
|
@@ -545,12 +552,12 @@ function ze({
|
|
|
545
552
|
g.end,
|
|
546
553
|
t,
|
|
547
554
|
r,
|
|
548
|
-
|
|
549
|
-
) : null, [g, t, r,
|
|
555
|
+
d
|
|
556
|
+
) : null, [g, t, r, d]), h = W(
|
|
550
557
|
() => ({
|
|
551
558
|
isSelecting: g?.isSelecting ?? !1,
|
|
552
559
|
startSelection: H,
|
|
553
|
-
updateSelection:
|
|
560
|
+
updateSelection: O,
|
|
554
561
|
endSelection: v,
|
|
555
562
|
cancelSelection: k,
|
|
556
563
|
isSlotSelected: D,
|
|
@@ -561,7 +568,7 @@ function ze({
|
|
|
561
568
|
[
|
|
562
569
|
g?.isSelecting,
|
|
563
570
|
H,
|
|
564
|
-
|
|
571
|
+
O,
|
|
565
572
|
v,
|
|
566
573
|
k,
|
|
567
574
|
D,
|
|
@@ -570,7 +577,7 @@ function ze({
|
|
|
570
577
|
i
|
|
571
578
|
]
|
|
572
579
|
);
|
|
573
|
-
return /* @__PURE__ */ $(Q.Provider, { value:
|
|
580
|
+
return /* @__PURE__ */ $(Q.Provider, { value: h, children: n });
|
|
574
581
|
}
|
|
575
582
|
function Be() {
|
|
576
583
|
const n = R(Q);
|
|
@@ -582,22 +589,22 @@ function Ke() {
|
|
|
582
589
|
return R(Q);
|
|
583
590
|
}
|
|
584
591
|
export {
|
|
585
|
-
|
|
592
|
+
_e as D,
|
|
586
593
|
Fe as I,
|
|
587
594
|
ze as S,
|
|
588
595
|
ke as a,
|
|
589
596
|
be as b,
|
|
590
597
|
He as c,
|
|
591
|
-
|
|
592
|
-
|
|
598
|
+
xe as d,
|
|
599
|
+
M as e,
|
|
593
600
|
je as f,
|
|
594
601
|
Ae as g,
|
|
595
602
|
$e as h,
|
|
596
603
|
Ne as i,
|
|
597
|
-
|
|
604
|
+
Ve as j,
|
|
598
605
|
Me as k,
|
|
599
606
|
Ke as l,
|
|
600
607
|
Be as m,
|
|
601
|
-
|
|
608
|
+
Te as u
|
|
602
609
|
};
|
|
603
|
-
//# sourceMappingURL=slot-selection-context-
|
|
610
|
+
//# sourceMappingURL=slot-selection-context-D6zo91K_.js.map
|