@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,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as h, useCallback as w, useContext as R, createContext as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import { jsx as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useCallback as w, useContext as R, createContext as $, useMemo as W, useEffect as A, useRef as N } from "react";
|
|
3
|
+
import { aP as me, aQ as pe, aU as ye, aO as j } from "./position-utils-DpaKqYhO.js";
|
|
4
|
+
const z = $(void 0);
|
|
5
|
+
function _e({
|
|
6
6
|
children: n,
|
|
7
7
|
onEventDrop: t
|
|
8
8
|
}) {
|
|
@@ -13,19 +13,19 @@ function Le({
|
|
|
13
13
|
originalStartDate: d,
|
|
14
14
|
originalEndDate: S
|
|
15
15
|
});
|
|
16
|
-
}, []), c = w((s, d, S,
|
|
17
|
-
r((
|
|
18
|
-
...
|
|
16
|
+
}, []), c = w((s, d, S, i) => {
|
|
17
|
+
r((H) => H ? {
|
|
18
|
+
...H,
|
|
19
19
|
previewDate: s,
|
|
20
20
|
previewHour: d,
|
|
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: d, originalEndDate: S, previewDate:
|
|
26
|
+
const { event: s, originalStartDate: d, originalEndDate: S, previewDate: i, previewHour: H, previewMinute: T, targetResourceId: v } = e, k = S.getTime() - d.getTime();
|
|
27
27
|
let D;
|
|
28
|
-
|
|
28
|
+
i ? (D = new Date(i), typeof H == "number" ? D.setHours(H, T ?? 0, 0, 0) : D.setHours(
|
|
29
29
|
d.getHours(),
|
|
30
30
|
d.getMinutes(),
|
|
31
31
|
d.getSeconds(),
|
|
@@ -41,8 +41,8 @@ function Le({
|
|
|
41
41
|
}, [e, t]), u = w(() => {
|
|
42
42
|
r(null);
|
|
43
43
|
}, []);
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
return /* @__PURE__ */ Q(
|
|
45
|
+
z.Provider,
|
|
46
46
|
{
|
|
47
47
|
value: {
|
|
48
48
|
dragState: e,
|
|
@@ -56,19 +56,19 @@ function Le({
|
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const n = R(
|
|
59
|
+
function xe() {
|
|
60
|
+
const n = R(z);
|
|
61
61
|
if (!n)
|
|
62
62
|
throw new Error("useDragDrop must be used within a DragDropProvider");
|
|
63
63
|
return n;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return R(
|
|
65
|
+
function Fe() {
|
|
66
|
+
return R(z) ?? null;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const be = "inno-calendar-preferences", He = {
|
|
69
69
|
from: 0,
|
|
70
70
|
to: 24
|
|
71
|
-
},
|
|
71
|
+
}, ke = {
|
|
72
72
|
0: { enabled: !1, from: 8, to: 18 },
|
|
73
73
|
// Sunday - disabled
|
|
74
74
|
1: { enabled: !0, from: 8, to: 18 },
|
|
@@ -83,17 +83,17 @@ const me = "inno-calendar-preferences", pe = {
|
|
|
83
83
|
// Friday
|
|
84
84
|
6: { enabled: !1, from: 8, to: 18 }
|
|
85
85
|
// Saturday - disabled
|
|
86
|
-
},
|
|
86
|
+
}, he = 30, Ie = {
|
|
87
87
|
view: "month",
|
|
88
88
|
badgeVariant: "colored",
|
|
89
|
-
slotDuration:
|
|
90
|
-
visibleHours:
|
|
91
|
-
workingHours:
|
|
89
|
+
slotDuration: he,
|
|
90
|
+
visibleHours: He,
|
|
91
|
+
workingHours: ke,
|
|
92
92
|
showWorkingHoursOnly: !1,
|
|
93
93
|
showWeekends: !0,
|
|
94
94
|
firstDayOfWeek: 1
|
|
95
95
|
};
|
|
96
|
-
function
|
|
96
|
+
function ve(n) {
|
|
97
97
|
if (typeof window > "u") return {};
|
|
98
98
|
try {
|
|
99
99
|
const t = localStorage.getItem(n);
|
|
@@ -104,7 +104,7 @@ function ke(n) {
|
|
|
104
104
|
return console.warn("[InnoCalendar] Failed to load preferences from localStorage"), {};
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Oe(n, t) {
|
|
108
108
|
if (!(typeof window > "u"))
|
|
109
109
|
try {
|
|
110
110
|
localStorage.setItem(n, JSON.stringify(t));
|
|
@@ -112,83 +112,83 @@ function he(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: f =
|
|
120
|
+
storageKey: f = be,
|
|
121
121
|
disableStorage: c = !1
|
|
122
122
|
} = n, g = W(
|
|
123
123
|
() => ({
|
|
124
|
-
...
|
|
124
|
+
...Ie,
|
|
125
125
|
...r
|
|
126
126
|
}),
|
|
127
127
|
[r]
|
|
128
|
-
), [u, s] = h(() => c ? {} :
|
|
128
|
+
), [u, s] = h(() => c ? {} : ve(f)), [d, S] = h({});
|
|
129
129
|
A(() => {
|
|
130
|
-
c ||
|
|
130
|
+
c || Oe(f, u);
|
|
131
131
|
}, [u, f, c]);
|
|
132
|
-
const
|
|
132
|
+
const i = w(
|
|
133
133
|
(o) => t[o] ?? "user",
|
|
134
134
|
[t]
|
|
135
|
-
),
|
|
136
|
-
(o) =>
|
|
137
|
-
[
|
|
135
|
+
), H = w(
|
|
136
|
+
(o) => i(o) === "locked",
|
|
137
|
+
[i]
|
|
138
138
|
), T = w(
|
|
139
|
-
(o) =>
|
|
140
|
-
[
|
|
139
|
+
(o) => i(o) === "user" && !c,
|
|
140
|
+
[i, c]
|
|
141
141
|
), v = W(() => {
|
|
142
142
|
const o = { ...g };
|
|
143
143
|
for (const l of Object.keys(o)) {
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const b = i(l);
|
|
145
|
+
b === "locked" && l in e ? o[l] = e[l] : b === "session" && l in d ? o[l] = d[l] : b === "user" && l in u && (o[l] = u[l]);
|
|
146
146
|
}
|
|
147
147
|
return o;
|
|
148
|
-
}, [g, u, d, e,
|
|
148
|
+
}, [g, u, d, e, i]), k = w(
|
|
149
149
|
(o, l) => {
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
150
|
+
const b = i(o);
|
|
151
|
+
if (b === "locked") {
|
|
152
152
|
console.warn(`[InnoCalendar] Preference "${o}" is locked and cannot be modified`);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
b === "session" ? S((p) => ({ ...p, [o]: l })) : s((p) => ({ ...p, [o]: l }));
|
|
156
156
|
},
|
|
157
|
-
[
|
|
157
|
+
[i]
|
|
158
158
|
), D = w(
|
|
159
159
|
(o) => {
|
|
160
|
-
const l = {},
|
|
160
|
+
const l = {}, b = {};
|
|
161
161
|
for (const p of Object.keys(o)) {
|
|
162
|
-
const C =
|
|
162
|
+
const C = i(p), P = o[p];
|
|
163
163
|
if (P !== void 0) {
|
|
164
164
|
if (C === "locked") {
|
|
165
165
|
console.warn(`[InnoCalendar] Preference "${p}" is locked and cannot be modified`);
|
|
166
166
|
continue;
|
|
167
167
|
}
|
|
168
|
-
C === "session" ? l[p] = P :
|
|
168
|
+
C === "session" ? l[p] = P : b[p] = P;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
Object.keys(l).length > 0 && S((p) => ({ ...p, ...l })), Object.keys(
|
|
171
|
+
Object.keys(l).length > 0 && S((p) => ({ ...p, ...l })), Object.keys(b).length > 0 && s((p) => ({ ...p, ...b }));
|
|
172
172
|
},
|
|
173
|
-
[
|
|
173
|
+
[i]
|
|
174
174
|
), m = w(() => {
|
|
175
175
|
s({}), S({}), c || localStorage.removeItem(f);
|
|
176
176
|
}, [f, c]), I = w(
|
|
177
177
|
(o) => {
|
|
178
|
-
const l =
|
|
178
|
+
const l = i(o);
|
|
179
179
|
if (l === "locked") {
|
|
180
180
|
console.warn(`[InnoCalendar] Preference "${o}" is locked and cannot be reset`);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
l === "session" ? S((
|
|
184
|
-
const { [o]: p, ...C } =
|
|
183
|
+
l === "session" ? S((b) => {
|
|
184
|
+
const { [o]: p, ...C } = b;
|
|
185
185
|
return C;
|
|
186
|
-
}) : s((
|
|
187
|
-
const { [o]: p, ...C } =
|
|
186
|
+
}) : s((b) => {
|
|
187
|
+
const { [o]: p, ...C } = b;
|
|
188
188
|
return C;
|
|
189
189
|
});
|
|
190
190
|
},
|
|
191
|
-
[
|
|
191
|
+
[i]
|
|
192
192
|
);
|
|
193
193
|
return {
|
|
194
194
|
preferences: v,
|
|
@@ -196,12 +196,12 @@ function Ie(n = {}) {
|
|
|
196
196
|
setPreferences: D,
|
|
197
197
|
resetPreferences: m,
|
|
198
198
|
resetPreference: I,
|
|
199
|
-
isLocked:
|
|
199
|
+
isLocked: H,
|
|
200
200
|
isPersisted: T,
|
|
201
|
-
getMode:
|
|
201
|
+
getMode: i
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
const
|
|
204
|
+
const B = $(void 0), ue = {
|
|
205
205
|
0: { enabled: !1, from: 8, to: 17 },
|
|
206
206
|
// Sunday
|
|
207
207
|
1: { enabled: !0, from: 8, to: 17 },
|
|
@@ -216,8 +216,8 @@ const Q = z(void 0), ue = {
|
|
|
216
216
|
// Friday
|
|
217
217
|
6: { enabled: !0, from: 8, to: 12 }
|
|
218
218
|
// Saturday
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, Ce = { start: 0, end: 24 };
|
|
220
|
+
function Me({
|
|
221
221
|
children: n,
|
|
222
222
|
initialEvents: t = [],
|
|
223
223
|
initialUsers: e = [],
|
|
@@ -229,26 +229,26 @@ function _e({
|
|
|
229
229
|
initialParticipantIds: s = [],
|
|
230
230
|
initialWorkingHoursView: d = "default",
|
|
231
231
|
initialSearchQuery: S = "",
|
|
232
|
-
preferencesConfig:
|
|
233
|
-
initialFocusEventId:
|
|
232
|
+
preferencesConfig: i,
|
|
233
|
+
initialFocusEventId: H = null,
|
|
234
234
|
onDateChange: T,
|
|
235
235
|
onViewChange: v
|
|
236
236
|
}) {
|
|
237
|
-
const { preferences: k, setPreference: D, isLocked: m } =
|
|
238
|
-
f ?? k.view ?? "week"
|
|
239
|
-
), [l,
|
|
237
|
+
const { preferences: k, setPreference: D, isLocked: m } = Te(i), [I, o] = h(
|
|
238
|
+
f ?? k.view ?? me() ?? pe() ?? "week"
|
|
239
|
+
), [l, b] = h(
|
|
240
240
|
c ?? /* @__PURE__ */ new Date()
|
|
241
241
|
), [p, C] = h(
|
|
242
242
|
g
|
|
243
|
-
), P = k.badgeVariant ?? "colored",
|
|
244
|
-
(
|
|
245
|
-
m("badgeVariant") || D("badgeVariant",
|
|
243
|
+
), P = k.badgeVariant ?? "colored", Y = w(
|
|
244
|
+
(a) => {
|
|
245
|
+
m("badgeVariant") || D("badgeVariant", a);
|
|
246
246
|
},
|
|
247
247
|
[D, m]
|
|
248
248
|
), G = k.workingHours ?? ue, J = w(
|
|
249
|
-
(
|
|
249
|
+
(a) => {
|
|
250
250
|
if (!m("workingHours")) {
|
|
251
|
-
const
|
|
251
|
+
const y = k.workingHours ?? ue, O = typeof a == "function" ? a(y) : a;
|
|
252
252
|
D("workingHours", O);
|
|
253
253
|
}
|
|
254
254
|
},
|
|
@@ -256,13 +256,13 @@ function _e({
|
|
|
256
256
|
), E = k.visibleHours, _ = W(() => E ? {
|
|
257
257
|
start: E.start ?? E.from ?? 0,
|
|
258
258
|
end: E.end ?? E.to ?? 24
|
|
259
|
-
} :
|
|
260
|
-
(
|
|
259
|
+
} : Ce, [E]), q = w(
|
|
260
|
+
(a) => {
|
|
261
261
|
if (!m("visibleHours")) {
|
|
262
|
-
const
|
|
262
|
+
const y = typeof a == "function" ? a(_) : a;
|
|
263
263
|
D("visibleHours", {
|
|
264
|
-
from:
|
|
265
|
-
to:
|
|
264
|
+
from: y.start,
|
|
265
|
+
to: y.end
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
},
|
|
@@ -270,69 +270,69 @@ function _e({
|
|
|
270
270
|
), [de, fe] = h(
|
|
271
271
|
d === "enabled" ? !0 : d === "disabled" ? !1 : k.showWorkingHoursOnly ?? !1
|
|
272
272
|
), X = de, Z = w(
|
|
273
|
-
(
|
|
274
|
-
fe(
|
|
273
|
+
(a) => {
|
|
274
|
+
fe(a), m("showWorkingHoursOnly") || D("showWorkingHoursOnly", a);
|
|
275
275
|
},
|
|
276
276
|
[D, m]
|
|
277
277
|
), ee = k.slotDuration ?? 30, te = w(
|
|
278
|
-
(
|
|
279
|
-
m("slotDuration") || D("slotDuration",
|
|
278
|
+
(a) => {
|
|
279
|
+
m("slotDuration") || D("slotDuration", a);
|
|
280
280
|
},
|
|
281
281
|
[D, m]
|
|
282
282
|
), [x, ne] = h(t);
|
|
283
283
|
A(() => {
|
|
284
284
|
ne(t);
|
|
285
285
|
}, [t]);
|
|
286
|
-
const [
|
|
287
|
-
|
|
286
|
+
const [V, ge] = h(u), [M, Re] = h(s), [L, we] = h(S), [re, oe] = h(
|
|
287
|
+
H ?? null
|
|
288
288
|
);
|
|
289
289
|
A(() => {
|
|
290
|
-
|
|
291
|
-
}, [
|
|
292
|
-
const se = w(() => oe(null), []),
|
|
293
|
-
(
|
|
294
|
-
o(
|
|
290
|
+
H && oe(H);
|
|
291
|
+
}, [H]);
|
|
292
|
+
const se = w(() => oe(null), []), ae = w(
|
|
293
|
+
(a) => {
|
|
294
|
+
o(a), m("view") || D("view", a), ye(a), v?.(a);
|
|
295
295
|
},
|
|
296
296
|
[v, D, m]
|
|
297
|
-
),
|
|
298
|
-
(
|
|
299
|
-
|
|
297
|
+
), ie = w(
|
|
298
|
+
(a, y) => {
|
|
299
|
+
b(a), T?.(a, y ?? I);
|
|
300
300
|
},
|
|
301
301
|
[T, I]
|
|
302
302
|
), ce = W(() => {
|
|
303
|
-
let
|
|
304
|
-
if (
|
|
305
|
-
(
|
|
306
|
-
)), M.length > 0 && (
|
|
303
|
+
let a = x;
|
|
304
|
+
if (V.length > 0 && (a = a.filter(
|
|
305
|
+
(y) => y.scheduleTypeId !== void 0 && V.includes(y.scheduleTypeId)
|
|
306
|
+
)), M.length > 0 && (a = a.filter((y) => y.participants?.length ? y.participants.some(
|
|
307
307
|
(O) => M.includes(O.id)
|
|
308
|
-
) : !1)), p !== "all" && (
|
|
309
|
-
(
|
|
310
|
-
)),
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
(O) => j(O.title).toLowerCase().includes(
|
|
308
|
+
) : !1)), p !== "all" && (a = a.filter(
|
|
309
|
+
(y) => y.participants?.some((O) => O.id === p)
|
|
310
|
+
)), L.trim()) {
|
|
311
|
+
const y = L.toLowerCase();
|
|
312
|
+
a = a.filter(
|
|
313
|
+
(O) => j(O.title).toLowerCase().includes(y) || j(O.description).toLowerCase().includes(y) || j(O.scheduleTypeName).toLowerCase().includes(y) || O.participants?.some((De) => De.name.toLowerCase().includes(y))
|
|
314
314
|
);
|
|
315
315
|
}
|
|
316
|
-
return
|
|
316
|
+
return a;
|
|
317
317
|
}, [
|
|
318
318
|
x,
|
|
319
|
-
|
|
319
|
+
V,
|
|
320
320
|
M,
|
|
321
321
|
p,
|
|
322
|
-
|
|
322
|
+
L
|
|
323
323
|
]), Se = W(
|
|
324
324
|
() => ({
|
|
325
325
|
// View & Navigation
|
|
326
326
|
view: I,
|
|
327
|
-
setView:
|
|
327
|
+
setView: ae,
|
|
328
328
|
selectedDate: l,
|
|
329
|
-
setSelectedDate:
|
|
329
|
+
setSelectedDate: ie,
|
|
330
330
|
// User Filtering
|
|
331
331
|
selectedUserId: p,
|
|
332
332
|
setSelectedUserId: C,
|
|
333
333
|
// Visual Customization
|
|
334
334
|
badgeVariant: P,
|
|
335
|
-
setBadgeVariant:
|
|
335
|
+
setBadgeVariant: Y,
|
|
336
336
|
// Time Configuration
|
|
337
337
|
workingHours: G,
|
|
338
338
|
setWorkingHours: J,
|
|
@@ -350,10 +350,10 @@ function _e({
|
|
|
350
350
|
users: e,
|
|
351
351
|
scheduleTypes: r,
|
|
352
352
|
// Filters
|
|
353
|
-
selectedScheduleTypeIds:
|
|
353
|
+
selectedScheduleTypeIds: V,
|
|
354
354
|
setSelectedScheduleTypeIds: ge,
|
|
355
355
|
// Search
|
|
356
|
-
searchQuery:
|
|
356
|
+
searchQuery: L,
|
|
357
357
|
setSearchQuery: we,
|
|
358
358
|
// Computed
|
|
359
359
|
filteredEvents: ce,
|
|
@@ -363,12 +363,12 @@ function _e({
|
|
|
363
363
|
}),
|
|
364
364
|
[
|
|
365
365
|
I,
|
|
366
|
-
ie,
|
|
367
|
-
l,
|
|
368
366
|
ae,
|
|
367
|
+
l,
|
|
368
|
+
ie,
|
|
369
369
|
p,
|
|
370
370
|
P,
|
|
371
|
-
|
|
371
|
+
Y,
|
|
372
372
|
G,
|
|
373
373
|
J,
|
|
374
374
|
_,
|
|
@@ -381,35 +381,35 @@ function _e({
|
|
|
381
381
|
x,
|
|
382
382
|
e,
|
|
383
383
|
r,
|
|
384
|
-
L,
|
|
385
384
|
V,
|
|
385
|
+
L,
|
|
386
386
|
ce,
|
|
387
387
|
re,
|
|
388
388
|
se
|
|
389
389
|
]
|
|
390
390
|
);
|
|
391
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ Q(B.Provider, { value: Se, children: n });
|
|
392
392
|
}
|
|
393
393
|
function F() {
|
|
394
|
-
const n = R(
|
|
394
|
+
const n = R(B);
|
|
395
395
|
if (!n)
|
|
396
396
|
throw new Error(
|
|
397
397
|
"useInnoCalendar must be used within an InnoCalendarProvider"
|
|
398
398
|
);
|
|
399
399
|
return n;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
return R(
|
|
401
|
+
function Ne() {
|
|
402
|
+
return R(B);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function je() {
|
|
405
405
|
const { view: n, setView: t, selectedDate: e, setSelectedDate: r, slotDuration: f } = F();
|
|
406
406
|
return { view: n, setView: t, selectedDate: e, setSelectedDate: r, slotDuration: f };
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Ae() {
|
|
409
409
|
const { events: n, setEvents: t, filteredEvents: e } = F();
|
|
410
410
|
return { events: n, setEvents: t, filteredEvents: e };
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Qe() {
|
|
413
413
|
const {
|
|
414
414
|
selectedScheduleTypeIds: n,
|
|
415
415
|
setSelectedScheduleTypeIds: t,
|
|
@@ -427,7 +427,7 @@ function Ne() {
|
|
|
427
427
|
setSearchQuery: c
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function $e() {
|
|
431
431
|
const {
|
|
432
432
|
workingHours: n,
|
|
433
433
|
setWorkingHours: t,
|
|
@@ -445,51 +445,51 @@ function je() {
|
|
|
445
445
|
setShowWorkingHoursOnly: c
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
const
|
|
448
|
+
const K = $(void 0);
|
|
449
449
|
function U(n) {
|
|
450
450
|
const t = new Date(n.date);
|
|
451
451
|
return typeof n.hour == "number" && t.setHours(n.hour, n.minute ?? 0, 0, 0), t;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Pe(n) {
|
|
454
454
|
const t = new Date(n), e = t.getMinutes(), r = Math.floor(e / 30) * 30;
|
|
455
455
|
return t.setMinutes(r, 0, 0), t;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Ee(n, t) {
|
|
458
458
|
return n.getFullYear() === t.getFullYear() && n.getMonth() === t.getMonth() && n.getDate() === t.getDate();
|
|
459
459
|
}
|
|
460
460
|
function le(n, t, e, r, f = 30) {
|
|
461
461
|
const c = U(n), g = U(t);
|
|
462
462
|
let u = c, s = g;
|
|
463
463
|
if (g < c && (u = g, s = c), e === "day")
|
|
464
|
-
if (
|
|
465
|
-
const S =
|
|
464
|
+
if (Ee(u, s)) {
|
|
465
|
+
const S = Pe(/* @__PURE__ */ new Date());
|
|
466
466
|
u = new Date(u), u.setHours(S.getHours(), S.getMinutes(), 0, 0), s = new Date(u.getTime() + r * 60 * 1e3);
|
|
467
467
|
} else
|
|
468
468
|
u.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999);
|
|
469
469
|
else {
|
|
470
470
|
const d = f * 60 * 1e3;
|
|
471
471
|
s = new Date(s.getTime() + d);
|
|
472
|
-
const S = s.getTime() - u.getTime(),
|
|
473
|
-
S <
|
|
472
|
+
const S = s.getTime() - u.getTime(), i = r * 60 * 1e3;
|
|
473
|
+
S < i && (s = new Date(u.getTime() + i));
|
|
474
474
|
}
|
|
475
475
|
return {
|
|
476
476
|
startDate: u,
|
|
477
477
|
endDate: s
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function We(n, t, e, r) {
|
|
481
481
|
const f = U(n), c = U(t), g = U(e), u = c <= g ? c : g, s = c <= g ? g : c;
|
|
482
482
|
if (r === "day") {
|
|
483
483
|
const d = new Date(f);
|
|
484
484
|
d.setHours(0, 0, 0, 0);
|
|
485
485
|
const S = new Date(u);
|
|
486
486
|
S.setHours(0, 0, 0, 0);
|
|
487
|
-
const
|
|
488
|
-
return
|
|
487
|
+
const i = new Date(s);
|
|
488
|
+
return i.setHours(0, 0, 0, 0), d >= S && d <= i;
|
|
489
489
|
}
|
|
490
490
|
return f >= u && f <= s;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function ze({
|
|
493
493
|
children: n,
|
|
494
494
|
mode: t = "time",
|
|
495
495
|
onSelect: e,
|
|
@@ -497,11 +497,11 @@ function Ae({
|
|
|
497
497
|
slotDurationMinutes: f = 30,
|
|
498
498
|
enabled: c = !0
|
|
499
499
|
}) {
|
|
500
|
-
const [g, u] = h(null), s = N(!1), d = N(!1), S = N(null),
|
|
500
|
+
const [g, u] = h(null), s = N(!1), d = N(!1), S = N(null), i = w(() => {
|
|
501
501
|
d.current = !0, S.current && clearTimeout(S.current), S.current = setTimeout(() => {
|
|
502
502
|
d.current = !1;
|
|
503
503
|
}, 300);
|
|
504
|
-
}, []),
|
|
504
|
+
}, []), H = w(
|
|
505
505
|
(o) => {
|
|
506
506
|
!c || d.current || (s.current = !0, u({
|
|
507
507
|
start: o,
|
|
@@ -538,7 +538,7 @@ function Ae({
|
|
|
538
538
|
}, [t, r, f, e]), k = w(() => {
|
|
539
539
|
s.current = !1, u(null);
|
|
540
540
|
}, []), D = w(
|
|
541
|
-
(o) => g ?
|
|
541
|
+
(o) => g ? We(o, g.start, g.end, t) : !1,
|
|
542
542
|
[g, t]
|
|
543
543
|
), m = w(() => g ? le(
|
|
544
544
|
g.start,
|
|
@@ -549,56 +549,56 @@ function Ae({
|
|
|
549
549
|
) : null, [g, t, r, f]), I = W(
|
|
550
550
|
() => ({
|
|
551
551
|
isSelecting: g?.isSelecting ?? !1,
|
|
552
|
-
startSelection:
|
|
552
|
+
startSelection: H,
|
|
553
553
|
updateSelection: T,
|
|
554
554
|
endSelection: v,
|
|
555
555
|
cancelSelection: k,
|
|
556
556
|
isSlotSelected: D,
|
|
557
557
|
getSelectionResult: m,
|
|
558
558
|
mode: t,
|
|
559
|
-
suppressSelection:
|
|
559
|
+
suppressSelection: i
|
|
560
560
|
}),
|
|
561
561
|
[
|
|
562
562
|
g?.isSelecting,
|
|
563
|
-
|
|
563
|
+
H,
|
|
564
564
|
T,
|
|
565
565
|
v,
|
|
566
566
|
k,
|
|
567
567
|
D,
|
|
568
568
|
m,
|
|
569
569
|
t,
|
|
570
|
-
|
|
570
|
+
i
|
|
571
571
|
]
|
|
572
572
|
);
|
|
573
|
-
return /* @__PURE__ */
|
|
573
|
+
return /* @__PURE__ */ Q(K.Provider, { value: I, children: n });
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
const n = R(
|
|
575
|
+
function Be() {
|
|
576
|
+
const n = R(K);
|
|
577
577
|
if (!n)
|
|
578
578
|
throw new Error("useSlotSelectionContext must be used within a SlotSelectionProvider");
|
|
579
579
|
return n;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
return R(
|
|
581
|
+
function Ke() {
|
|
582
|
+
return R(K);
|
|
583
583
|
}
|
|
584
584
|
export {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
585
|
+
_e as D,
|
|
586
|
+
Me as I,
|
|
587
|
+
be as P,
|
|
588
|
+
ze as S,
|
|
589
|
+
he as a,
|
|
590
|
+
He as b,
|
|
591
|
+
ke as c,
|
|
592
|
+
xe as d,
|
|
593
593
|
F as e,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
594
|
+
Ae as f,
|
|
595
|
+
Qe as g,
|
|
596
|
+
$e as h,
|
|
597
|
+
je as i,
|
|
598
|
+
Fe as j,
|
|
599
|
+
Ne as k,
|
|
600
|
+
Ke as l,
|
|
601
|
+
Be as m,
|
|
602
|
+
Te as u
|
|
603
603
|
};
|
|
604
|
-
//# sourceMappingURL=slot-selection-context-
|
|
604
|
+
//# sourceMappingURL=slot-selection-context-D3MW4WJ7.js.map
|