react-big-schedule 1.0.0
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/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/react-big-schedule-index.mjs +2907 -0
- package/dist/style.css +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,2907 @@
|
|
|
1
|
+
var qt = Object.defineProperty;
|
|
2
|
+
var Yt = (y, t, e) => t in y ? qt(y, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[t] = e;
|
|
3
|
+
var M = (y, t, e) => (Yt(y, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import st, { Component as _e, createElement as he, useState as $t } from "react";
|
|
5
|
+
import u, { PropTypes as oe } from "prop-types";
|
|
6
|
+
import { MinusSquareOutlined as Bt, PlusSquareOutlined as Vt, CloseOutlined as Gt, LeftOutlined as Xt, RightOutlined as Ut } from "@ant-design/icons";
|
|
7
|
+
import { Row as ue, Col as ee, Popover as He, Radio as it, Calendar as Qt } from "antd";
|
|
8
|
+
import { DragSource as Jt, DropTarget as Kt } from "react-dnd";
|
|
9
|
+
import je from "moment";
|
|
10
|
+
import { rrulestr as ke, RRuleSet as Zt } from "rrule";
|
|
11
|
+
var We = { exports: {} }, me = {};
|
|
12
|
+
/**
|
|
13
|
+
* @license React
|
|
14
|
+
* react-jsx-runtime.production.min.js
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
var et;
|
|
22
|
+
function er() {
|
|
23
|
+
if (et)
|
|
24
|
+
return me;
|
|
25
|
+
et = 1;
|
|
26
|
+
var y = st, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
27
|
+
function i(a, d, c) {
|
|
28
|
+
var h, p = {}, f = null, m = null;
|
|
29
|
+
c !== void 0 && (f = "" + c), d.key !== void 0 && (f = "" + d.key), d.ref !== void 0 && (m = d.ref);
|
|
30
|
+
for (h in d)
|
|
31
|
+
r.call(d, h) && !o.hasOwnProperty(h) && (p[h] = d[h]);
|
|
32
|
+
if (a && a.defaultProps)
|
|
33
|
+
for (h in d = a.defaultProps, d)
|
|
34
|
+
p[h] === void 0 && (p[h] = d[h]);
|
|
35
|
+
return { $$typeof: t, type: a, key: f, ref: m, props: p, _owner: s.current };
|
|
36
|
+
}
|
|
37
|
+
return me.Fragment = e, me.jsx = i, me.jsxs = i, me;
|
|
38
|
+
}
|
|
39
|
+
var ge = {};
|
|
40
|
+
/**
|
|
41
|
+
* @license React
|
|
42
|
+
* react-jsx-runtime.development.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/
|
|
49
|
+
var tt;
|
|
50
|
+
function tr() {
|
|
51
|
+
return tt || (tt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
52
|
+
var y = st, t = Symbol.for("react.element"), e = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), E = Symbol.iterator, C = "@@iterator";
|
|
53
|
+
function R(n) {
|
|
54
|
+
if (n === null || typeof n != "object")
|
|
55
|
+
return null;
|
|
56
|
+
var g = E && n[E] || n[C];
|
|
57
|
+
return typeof g == "function" ? g : null;
|
|
58
|
+
}
|
|
59
|
+
var x = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
60
|
+
function v(n) {
|
|
61
|
+
{
|
|
62
|
+
for (var g = arguments.length, b = new Array(g > 1 ? g - 1 : 0), I = 1; I < g; I++)
|
|
63
|
+
b[I - 1] = arguments[I];
|
|
64
|
+
T("error", n, b);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function T(n, g, b) {
|
|
68
|
+
{
|
|
69
|
+
var I = x.ReactDebugCurrentFrame, z = I.getStackAddendum();
|
|
70
|
+
z !== "" && (g += "%s", b = b.concat([z]));
|
|
71
|
+
var $ = b.map(function(N) {
|
|
72
|
+
return String(N);
|
|
73
|
+
});
|
|
74
|
+
$.unshift("Warning: " + g), Function.prototype.apply.call(console[n], console, $);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
var w = !1, j = !1, k = !1, O = !1, P = !1, S;
|
|
78
|
+
S = Symbol.for("react.module.reference");
|
|
79
|
+
function W(n) {
|
|
80
|
+
return !!(typeof n == "string" || typeof n == "function" || n === r || n === o || P || n === s || n === c || n === h || O || n === m || w || j || k || typeof n == "object" && n !== null && (n.$$typeof === f || n.$$typeof === p || n.$$typeof === i || n.$$typeof === a || n.$$typeof === d || // This needs to include all possible module reference object
|
|
81
|
+
// types supported by any Flight configuration anywhere since
|
|
82
|
+
// we don't know which Flight build this will end up being used
|
|
83
|
+
// with.
|
|
84
|
+
n.$$typeof === S || n.getModuleId !== void 0));
|
|
85
|
+
}
|
|
86
|
+
function q(n, g, b) {
|
|
87
|
+
var I = n.displayName;
|
|
88
|
+
if (I)
|
|
89
|
+
return I;
|
|
90
|
+
var z = g.displayName || g.name || "";
|
|
91
|
+
return z !== "" ? b + "(" + z + ")" : b;
|
|
92
|
+
}
|
|
93
|
+
function Q(n) {
|
|
94
|
+
return n.displayName || "Context";
|
|
95
|
+
}
|
|
96
|
+
function V(n) {
|
|
97
|
+
if (n == null)
|
|
98
|
+
return null;
|
|
99
|
+
if (typeof n.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
|
|
100
|
+
return n.displayName || n.name || null;
|
|
101
|
+
if (typeof n == "string")
|
|
102
|
+
return n;
|
|
103
|
+
switch (n) {
|
|
104
|
+
case r:
|
|
105
|
+
return "Fragment";
|
|
106
|
+
case e:
|
|
107
|
+
return "Portal";
|
|
108
|
+
case o:
|
|
109
|
+
return "Profiler";
|
|
110
|
+
case s:
|
|
111
|
+
return "StrictMode";
|
|
112
|
+
case c:
|
|
113
|
+
return "Suspense";
|
|
114
|
+
case h:
|
|
115
|
+
return "SuspenseList";
|
|
116
|
+
}
|
|
117
|
+
if (typeof n == "object")
|
|
118
|
+
switch (n.$$typeof) {
|
|
119
|
+
case a:
|
|
120
|
+
var g = n;
|
|
121
|
+
return Q(g) + ".Consumer";
|
|
122
|
+
case i:
|
|
123
|
+
var b = n;
|
|
124
|
+
return Q(b._context) + ".Provider";
|
|
125
|
+
case d:
|
|
126
|
+
return q(n, n.render, "ForwardRef");
|
|
127
|
+
case p:
|
|
128
|
+
var I = n.displayName || null;
|
|
129
|
+
return I !== null ? I : V(n.type) || "Memo";
|
|
130
|
+
case f: {
|
|
131
|
+
var z = n, $ = z._payload, N = z._init;
|
|
132
|
+
try {
|
|
133
|
+
return V(N($));
|
|
134
|
+
} catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
var K = Object.assign, G = 0, A, F, Y, B, ne, Le, Pe;
|
|
142
|
+
function Ae() {
|
|
143
|
+
}
|
|
144
|
+
Ae.__reactDisabledLog = !0;
|
|
145
|
+
function vt() {
|
|
146
|
+
{
|
|
147
|
+
if (G === 0) {
|
|
148
|
+
A = console.log, F = console.info, Y = console.warn, B = console.error, ne = console.group, Le = console.groupCollapsed, Pe = console.groupEnd;
|
|
149
|
+
var n = {
|
|
150
|
+
configurable: !0,
|
|
151
|
+
enumerable: !0,
|
|
152
|
+
value: Ae,
|
|
153
|
+
writable: !0
|
|
154
|
+
};
|
|
155
|
+
Object.defineProperties(console, {
|
|
156
|
+
info: n,
|
|
157
|
+
log: n,
|
|
158
|
+
warn: n,
|
|
159
|
+
error: n,
|
|
160
|
+
group: n,
|
|
161
|
+
groupCollapsed: n,
|
|
162
|
+
groupEnd: n
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
G++;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function Et() {
|
|
169
|
+
{
|
|
170
|
+
if (G--, G === 0) {
|
|
171
|
+
var n = {
|
|
172
|
+
configurable: !0,
|
|
173
|
+
enumerable: !0,
|
|
174
|
+
writable: !0
|
|
175
|
+
};
|
|
176
|
+
Object.defineProperties(console, {
|
|
177
|
+
log: K({}, n, {
|
|
178
|
+
value: A
|
|
179
|
+
}),
|
|
180
|
+
info: K({}, n, {
|
|
181
|
+
value: F
|
|
182
|
+
}),
|
|
183
|
+
warn: K({}, n, {
|
|
184
|
+
value: Y
|
|
185
|
+
}),
|
|
186
|
+
error: K({}, n, {
|
|
187
|
+
value: B
|
|
188
|
+
}),
|
|
189
|
+
group: K({}, n, {
|
|
190
|
+
value: ne
|
|
191
|
+
}),
|
|
192
|
+
groupCollapsed: K({}, n, {
|
|
193
|
+
value: Le
|
|
194
|
+
}),
|
|
195
|
+
groupEnd: K({}, n, {
|
|
196
|
+
value: Pe
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
G < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
var Re = x.ReactCurrentDispatcher, Ce;
|
|
204
|
+
function ve(n, g, b) {
|
|
205
|
+
{
|
|
206
|
+
if (Ce === void 0)
|
|
207
|
+
try {
|
|
208
|
+
throw Error();
|
|
209
|
+
} catch (z) {
|
|
210
|
+
var I = z.stack.trim().match(/\n( *(at )?)/);
|
|
211
|
+
Ce = I && I[1] || "";
|
|
212
|
+
}
|
|
213
|
+
return `
|
|
214
|
+
` + Ce + n;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
var Se = !1, Ee;
|
|
218
|
+
{
|
|
219
|
+
var bt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
220
|
+
Ee = new bt();
|
|
221
|
+
}
|
|
222
|
+
function ze(n, g) {
|
|
223
|
+
if (!n || Se)
|
|
224
|
+
return "";
|
|
225
|
+
{
|
|
226
|
+
var b = Ee.get(n);
|
|
227
|
+
if (b !== void 0)
|
|
228
|
+
return b;
|
|
229
|
+
}
|
|
230
|
+
var I;
|
|
231
|
+
Se = !0;
|
|
232
|
+
var z = Error.prepareStackTrace;
|
|
233
|
+
Error.prepareStackTrace = void 0;
|
|
234
|
+
var $;
|
|
235
|
+
$ = Re.current, Re.current = null, vt();
|
|
236
|
+
try {
|
|
237
|
+
if (g) {
|
|
238
|
+
var N = function() {
|
|
239
|
+
throw Error();
|
|
240
|
+
};
|
|
241
|
+
if (Object.defineProperty(N.prototype, "props", {
|
|
242
|
+
set: function() {
|
|
243
|
+
throw Error();
|
|
244
|
+
}
|
|
245
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
246
|
+
try {
|
|
247
|
+
Reflect.construct(N, []);
|
|
248
|
+
} catch (se) {
|
|
249
|
+
I = se;
|
|
250
|
+
}
|
|
251
|
+
Reflect.construct(n, [], N);
|
|
252
|
+
} else {
|
|
253
|
+
try {
|
|
254
|
+
N.call();
|
|
255
|
+
} catch (se) {
|
|
256
|
+
I = se;
|
|
257
|
+
}
|
|
258
|
+
n.call(N.prototype);
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
try {
|
|
262
|
+
throw Error();
|
|
263
|
+
} catch (se) {
|
|
264
|
+
I = se;
|
|
265
|
+
}
|
|
266
|
+
n();
|
|
267
|
+
}
|
|
268
|
+
} catch (se) {
|
|
269
|
+
if (se && I && typeof se.stack == "string") {
|
|
270
|
+
for (var _ = se.stack.split(`
|
|
271
|
+
`), Z = I.stack.split(`
|
|
272
|
+
`), U = _.length - 1, J = Z.length - 1; U >= 1 && J >= 0 && _[U] !== Z[J]; )
|
|
273
|
+
J--;
|
|
274
|
+
for (; U >= 1 && J >= 0; U--, J--)
|
|
275
|
+
if (_[U] !== Z[J]) {
|
|
276
|
+
if (U !== 1 || J !== 1)
|
|
277
|
+
do
|
|
278
|
+
if (U--, J--, J < 0 || _[U] !== Z[J]) {
|
|
279
|
+
var te = `
|
|
280
|
+
` + _[U].replace(" at new ", " at ");
|
|
281
|
+
return n.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", n.displayName)), typeof n == "function" && Ee.set(n, te), te;
|
|
282
|
+
}
|
|
283
|
+
while (U >= 1 && J >= 0);
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} finally {
|
|
288
|
+
Se = !1, Re.current = $, Et(), Error.prepareStackTrace = z;
|
|
289
|
+
}
|
|
290
|
+
var ce = n ? n.displayName || n.name : "", Ze = ce ? ve(ce) : "";
|
|
291
|
+
return typeof n == "function" && Ee.set(n, Ze), Ze;
|
|
292
|
+
}
|
|
293
|
+
function yt(n, g, b) {
|
|
294
|
+
return ze(n, !1);
|
|
295
|
+
}
|
|
296
|
+
function xt(n) {
|
|
297
|
+
var g = n.prototype;
|
|
298
|
+
return !!(g && g.isReactComponent);
|
|
299
|
+
}
|
|
300
|
+
function be(n, g, b) {
|
|
301
|
+
if (n == null)
|
|
302
|
+
return "";
|
|
303
|
+
if (typeof n == "function")
|
|
304
|
+
return ze(n, xt(n));
|
|
305
|
+
if (typeof n == "string")
|
|
306
|
+
return ve(n);
|
|
307
|
+
switch (n) {
|
|
308
|
+
case c:
|
|
309
|
+
return ve("Suspense");
|
|
310
|
+
case h:
|
|
311
|
+
return ve("SuspenseList");
|
|
312
|
+
}
|
|
313
|
+
if (typeof n == "object")
|
|
314
|
+
switch (n.$$typeof) {
|
|
315
|
+
case d:
|
|
316
|
+
return yt(n.render);
|
|
317
|
+
case p:
|
|
318
|
+
return be(n.type, g, b);
|
|
319
|
+
case f: {
|
|
320
|
+
var I = n, z = I._payload, $ = I._init;
|
|
321
|
+
try {
|
|
322
|
+
return be($(z), g, b);
|
|
323
|
+
} catch {
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return "";
|
|
328
|
+
}
|
|
329
|
+
var ye = Object.prototype.hasOwnProperty, Fe = {}, qe = x.ReactDebugCurrentFrame;
|
|
330
|
+
function xe(n) {
|
|
331
|
+
if (n) {
|
|
332
|
+
var g = n._owner, b = be(n.type, n._source, g ? g.type : null);
|
|
333
|
+
qe.setExtraStackFrame(b);
|
|
334
|
+
} else
|
|
335
|
+
qe.setExtraStackFrame(null);
|
|
336
|
+
}
|
|
337
|
+
function Rt(n, g, b, I, z) {
|
|
338
|
+
{
|
|
339
|
+
var $ = Function.call.bind(ye);
|
|
340
|
+
for (var N in n)
|
|
341
|
+
if ($(n, N)) {
|
|
342
|
+
var _ = void 0;
|
|
343
|
+
try {
|
|
344
|
+
if (typeof n[N] != "function") {
|
|
345
|
+
var Z = Error((I || "React class") + ": " + b + " type `" + N + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[N] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
346
|
+
throw Z.name = "Invariant Violation", Z;
|
|
347
|
+
}
|
|
348
|
+
_ = n[N](g, N, I, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
349
|
+
} catch (U) {
|
|
350
|
+
_ = U;
|
|
351
|
+
}
|
|
352
|
+
_ && !(_ instanceof Error) && (xe(z), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", I || "React class", b, N, typeof _), xe(null)), _ instanceof Error && !(_.message in Fe) && (Fe[_.message] = !0, xe(z), v("Failed %s type: %s", b, _.message), xe(null));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
var Ct = Array.isArray;
|
|
357
|
+
function De(n) {
|
|
358
|
+
return Ct(n);
|
|
359
|
+
}
|
|
360
|
+
function St(n) {
|
|
361
|
+
{
|
|
362
|
+
var g = typeof Symbol == "function" && Symbol.toStringTag, b = g && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
363
|
+
return b;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function Dt(n) {
|
|
367
|
+
try {
|
|
368
|
+
return Ye(n), !1;
|
|
369
|
+
} catch {
|
|
370
|
+
return !0;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function Ye(n) {
|
|
374
|
+
return "" + n;
|
|
375
|
+
}
|
|
376
|
+
function $e(n) {
|
|
377
|
+
if (Dt(n))
|
|
378
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", St(n)), Ye(n);
|
|
379
|
+
}
|
|
380
|
+
var fe = x.ReactCurrentOwner, wt = {
|
|
381
|
+
key: !0,
|
|
382
|
+
ref: !0,
|
|
383
|
+
__self: !0,
|
|
384
|
+
__source: !0
|
|
385
|
+
}, Be, Ve, we;
|
|
386
|
+
we = {};
|
|
387
|
+
function Tt(n) {
|
|
388
|
+
if (ye.call(n, "ref")) {
|
|
389
|
+
var g = Object.getOwnPropertyDescriptor(n, "ref").get;
|
|
390
|
+
if (g && g.isReactWarning)
|
|
391
|
+
return !1;
|
|
392
|
+
}
|
|
393
|
+
return n.ref !== void 0;
|
|
394
|
+
}
|
|
395
|
+
function Mt(n) {
|
|
396
|
+
if (ye.call(n, "key")) {
|
|
397
|
+
var g = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
398
|
+
if (g && g.isReactWarning)
|
|
399
|
+
return !1;
|
|
400
|
+
}
|
|
401
|
+
return n.key !== void 0;
|
|
402
|
+
}
|
|
403
|
+
function It(n, g) {
|
|
404
|
+
if (typeof n.ref == "string" && fe.current && g && fe.current.stateNode !== g) {
|
|
405
|
+
var b = V(fe.current.type);
|
|
406
|
+
we[b] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', V(fe.current.type), n.ref), we[b] = !0);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function jt(n, g) {
|
|
410
|
+
{
|
|
411
|
+
var b = function() {
|
|
412
|
+
Be || (Be = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
|
413
|
+
};
|
|
414
|
+
b.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
415
|
+
get: b,
|
|
416
|
+
configurable: !0
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function kt(n, g) {
|
|
421
|
+
{
|
|
422
|
+
var b = function() {
|
|
423
|
+
Ve || (Ve = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
|
424
|
+
};
|
|
425
|
+
b.isReactWarning = !0, Object.defineProperty(n, "ref", {
|
|
426
|
+
get: b,
|
|
427
|
+
configurable: !0
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
var Wt = function(n, g, b, I, z, $, N) {
|
|
432
|
+
var _ = {
|
|
433
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
434
|
+
$$typeof: t,
|
|
435
|
+
// Built-in properties that belong on the element
|
|
436
|
+
type: n,
|
|
437
|
+
key: g,
|
|
438
|
+
ref: b,
|
|
439
|
+
props: N,
|
|
440
|
+
// Record the component responsible for creating this element.
|
|
441
|
+
_owner: $
|
|
442
|
+
};
|
|
443
|
+
return _._store = {}, Object.defineProperty(_._store, "validated", {
|
|
444
|
+
configurable: !1,
|
|
445
|
+
enumerable: !1,
|
|
446
|
+
writable: !0,
|
|
447
|
+
value: !1
|
|
448
|
+
}), Object.defineProperty(_, "_self", {
|
|
449
|
+
configurable: !1,
|
|
450
|
+
enumerable: !1,
|
|
451
|
+
writable: !1,
|
|
452
|
+
value: I
|
|
453
|
+
}), Object.defineProperty(_, "_source", {
|
|
454
|
+
configurable: !1,
|
|
455
|
+
enumerable: !1,
|
|
456
|
+
writable: !1,
|
|
457
|
+
value: z
|
|
458
|
+
}), Object.freeze && (Object.freeze(_.props), Object.freeze(_)), _;
|
|
459
|
+
};
|
|
460
|
+
function _t(n, g, b, I, z) {
|
|
461
|
+
{
|
|
462
|
+
var $, N = {}, _ = null, Z = null;
|
|
463
|
+
b !== void 0 && ($e(b), _ = "" + b), Mt(g) && ($e(g.key), _ = "" + g.key), Tt(g) && (Z = g.ref, It(g, z));
|
|
464
|
+
for ($ in g)
|
|
465
|
+
ye.call(g, $) && !wt.hasOwnProperty($) && (N[$] = g[$]);
|
|
466
|
+
if (n && n.defaultProps) {
|
|
467
|
+
var U = n.defaultProps;
|
|
468
|
+
for ($ in U)
|
|
469
|
+
N[$] === void 0 && (N[$] = U[$]);
|
|
470
|
+
}
|
|
471
|
+
if (_ || Z) {
|
|
472
|
+
var J = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
|
473
|
+
_ && jt(N, J), Z && kt(N, J);
|
|
474
|
+
}
|
|
475
|
+
return Wt(n, _, Z, z, I, fe.current, N);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
var Te = x.ReactCurrentOwner, Ge = x.ReactDebugCurrentFrame;
|
|
479
|
+
function de(n) {
|
|
480
|
+
if (n) {
|
|
481
|
+
var g = n._owner, b = be(n.type, n._source, g ? g.type : null);
|
|
482
|
+
Ge.setExtraStackFrame(b);
|
|
483
|
+
} else
|
|
484
|
+
Ge.setExtraStackFrame(null);
|
|
485
|
+
}
|
|
486
|
+
var Me;
|
|
487
|
+
Me = !1;
|
|
488
|
+
function Ie(n) {
|
|
489
|
+
return typeof n == "object" && n !== null && n.$$typeof === t;
|
|
490
|
+
}
|
|
491
|
+
function Xe() {
|
|
492
|
+
{
|
|
493
|
+
if (Te.current) {
|
|
494
|
+
var n = V(Te.current.type);
|
|
495
|
+
if (n)
|
|
496
|
+
return `
|
|
497
|
+
|
|
498
|
+
Check the render method of \`` + n + "`.";
|
|
499
|
+
}
|
|
500
|
+
return "";
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function Ht(n) {
|
|
504
|
+
{
|
|
505
|
+
if (n !== void 0) {
|
|
506
|
+
var g = n.fileName.replace(/^.*[\\\/]/, ""), b = n.lineNumber;
|
|
507
|
+
return `
|
|
508
|
+
|
|
509
|
+
Check your code at ` + g + ":" + b + ".";
|
|
510
|
+
}
|
|
511
|
+
return "";
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
var Ue = {};
|
|
515
|
+
function Ot(n) {
|
|
516
|
+
{
|
|
517
|
+
var g = Xe();
|
|
518
|
+
if (!g) {
|
|
519
|
+
var b = typeof n == "string" ? n : n.displayName || n.name;
|
|
520
|
+
b && (g = `
|
|
521
|
+
|
|
522
|
+
Check the top-level render call using <` + b + ">.");
|
|
523
|
+
}
|
|
524
|
+
return g;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
function Qe(n, g) {
|
|
528
|
+
{
|
|
529
|
+
if (!n._store || n._store.validated || n.key != null)
|
|
530
|
+
return;
|
|
531
|
+
n._store.validated = !0;
|
|
532
|
+
var b = Ot(g);
|
|
533
|
+
if (Ue[b])
|
|
534
|
+
return;
|
|
535
|
+
Ue[b] = !0;
|
|
536
|
+
var I = "";
|
|
537
|
+
n && n._owner && n._owner !== Te.current && (I = " It was passed a child from " + V(n._owner.type) + "."), de(n), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, I), de(null);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
function Je(n, g) {
|
|
541
|
+
{
|
|
542
|
+
if (typeof n != "object")
|
|
543
|
+
return;
|
|
544
|
+
if (De(n))
|
|
545
|
+
for (var b = 0; b < n.length; b++) {
|
|
546
|
+
var I = n[b];
|
|
547
|
+
Ie(I) && Qe(I, g);
|
|
548
|
+
}
|
|
549
|
+
else if (Ie(n))
|
|
550
|
+
n._store && (n._store.validated = !0);
|
|
551
|
+
else if (n) {
|
|
552
|
+
var z = R(n);
|
|
553
|
+
if (typeof z == "function" && z !== n.entries)
|
|
554
|
+
for (var $ = z.call(n), N; !(N = $.next()).done; )
|
|
555
|
+
Ie(N.value) && Qe(N.value, g);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function Nt(n) {
|
|
560
|
+
{
|
|
561
|
+
var g = n.type;
|
|
562
|
+
if (g == null || typeof g == "string")
|
|
563
|
+
return;
|
|
564
|
+
var b;
|
|
565
|
+
if (typeof g == "function")
|
|
566
|
+
b = g.propTypes;
|
|
567
|
+
else if (typeof g == "object" && (g.$$typeof === d || // Note: Memo only checks outer props here.
|
|
568
|
+
// Inner props are checked in the reconciler.
|
|
569
|
+
g.$$typeof === p))
|
|
570
|
+
b = g.propTypes;
|
|
571
|
+
else
|
|
572
|
+
return;
|
|
573
|
+
if (b) {
|
|
574
|
+
var I = V(g);
|
|
575
|
+
Rt(b, n.props, "prop", I, n);
|
|
576
|
+
} else if (g.PropTypes !== void 0 && !Me) {
|
|
577
|
+
Me = !0;
|
|
578
|
+
var z = V(g);
|
|
579
|
+
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", z || "Unknown");
|
|
580
|
+
}
|
|
581
|
+
typeof g.getDefaultProps == "function" && !g.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function Lt(n) {
|
|
585
|
+
{
|
|
586
|
+
for (var g = Object.keys(n.props), b = 0; b < g.length; b++) {
|
|
587
|
+
var I = g[b];
|
|
588
|
+
if (I !== "children" && I !== "key") {
|
|
589
|
+
de(n), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", I), de(null);
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
n.ref !== null && (de(n), v("Invalid attribute `ref` supplied to `React.Fragment`."), de(null));
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function Ke(n, g, b, I, z, $) {
|
|
597
|
+
{
|
|
598
|
+
var N = W(n);
|
|
599
|
+
if (!N) {
|
|
600
|
+
var _ = "";
|
|
601
|
+
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (_ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
602
|
+
var Z = Ht(z);
|
|
603
|
+
Z ? _ += Z : _ += Xe();
|
|
604
|
+
var U;
|
|
605
|
+
n === null ? U = "null" : De(n) ? U = "array" : n !== void 0 && n.$$typeof === t ? (U = "<" + (V(n.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : U = typeof n, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", U, _);
|
|
606
|
+
}
|
|
607
|
+
var J = _t(n, g, b, z, $);
|
|
608
|
+
if (J == null)
|
|
609
|
+
return J;
|
|
610
|
+
if (N) {
|
|
611
|
+
var te = g.children;
|
|
612
|
+
if (te !== void 0)
|
|
613
|
+
if (I)
|
|
614
|
+
if (De(te)) {
|
|
615
|
+
for (var ce = 0; ce < te.length; ce++)
|
|
616
|
+
Je(te[ce], n);
|
|
617
|
+
Object.freeze && Object.freeze(te);
|
|
618
|
+
} else
|
|
619
|
+
v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
620
|
+
else
|
|
621
|
+
Je(te, n);
|
|
622
|
+
}
|
|
623
|
+
return n === r ? Lt(J) : Nt(J), J;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function Pt(n, g, b) {
|
|
627
|
+
return Ke(n, g, b, !0);
|
|
628
|
+
}
|
|
629
|
+
function At(n, g, b) {
|
|
630
|
+
return Ke(n, g, b, !1);
|
|
631
|
+
}
|
|
632
|
+
var zt = At, Ft = Pt;
|
|
633
|
+
ge.Fragment = r, ge.jsx = zt, ge.jsxs = Ft;
|
|
634
|
+
}()), ge;
|
|
635
|
+
}
|
|
636
|
+
process.env.NODE_ENV === "production" ? We.exports = er() : We.exports = tr();
|
|
637
|
+
var l = We.exports;
|
|
638
|
+
function Oe({
|
|
639
|
+
schedulerData: y,
|
|
640
|
+
eventItem: t,
|
|
641
|
+
title: e,
|
|
642
|
+
startTime: r,
|
|
643
|
+
endTime: s,
|
|
644
|
+
statusColor: o,
|
|
645
|
+
subtitleGetter: i,
|
|
646
|
+
viewEventClick: a,
|
|
647
|
+
viewEventText: d,
|
|
648
|
+
viewEvent2Click: c,
|
|
649
|
+
viewEvent2Text: h,
|
|
650
|
+
eventItemPopoverTemplateResolver: p
|
|
651
|
+
}) {
|
|
652
|
+
const { localeMoment: f, config: m } = y, E = f(r), C = f(s);
|
|
653
|
+
if (p != null)
|
|
654
|
+
return p(y, t, e, E, C, o);
|
|
655
|
+
let R = /* @__PURE__ */ l.jsx("div", {});
|
|
656
|
+
if (i !== void 0) {
|
|
657
|
+
let T = i(y, t);
|
|
658
|
+
T != null && (R = /* @__PURE__ */ l.jsxs(ue, { align: "middle", children: [
|
|
659
|
+
/* @__PURE__ */ l.jsx(ee, { span: 2, children: /* @__PURE__ */ l.jsx("div", {}) }),
|
|
660
|
+
/* @__PURE__ */ l.jsx(ee, { span: 22, className: "overflow-text", children: /* @__PURE__ */ l.jsx("span", { className: "header2-text", title: T, children: T }) })
|
|
661
|
+
] }));
|
|
662
|
+
}
|
|
663
|
+
let x = /* @__PURE__ */ l.jsx("div", {});
|
|
664
|
+
if (d !== void 0 && a !== void 0 && (t.clickable1 == null || t.clickable1)) {
|
|
665
|
+
let T = /* @__PURE__ */ l.jsx(ee, { span: 22, children: /* @__PURE__ */ l.jsx("span", { className: "header2-text", style: { color: "#108EE9", cursor: "pointer" }, onClick: () => a(y, t), children: d }) });
|
|
666
|
+
h !== void 0 && c !== void 0 && (t.clickable2 == null || t.clickable2) && (T = /* @__PURE__ */ l.jsxs(ee, { span: 22, children: [
|
|
667
|
+
/* @__PURE__ */ l.jsx("span", { className: "header2-text", style: { color: "#108EE9", cursor: "pointer" }, onClick: () => a(y, t), children: d }),
|
|
668
|
+
/* @__PURE__ */ l.jsx("span", { className: "header2-text", style: { color: "#108EE9", cursor: "pointer", marginLeft: "16px" }, onClick: () => c(y, t), children: h })
|
|
669
|
+
] })), x = /* @__PURE__ */ l.jsxs(ue, { align: "middle", children: [
|
|
670
|
+
/* @__PURE__ */ l.jsx(ee, { span: 2, children: /* @__PURE__ */ l.jsx("div", {}) }),
|
|
671
|
+
T
|
|
672
|
+
] });
|
|
673
|
+
} else if (h !== void 0 && c !== void 0 && (t.clickable2 == null || t.clickable2)) {
|
|
674
|
+
let T = /* @__PURE__ */ l.jsx(ee, { span: 22, children: /* @__PURE__ */ l.jsx("span", { className: "header2-text", style: { color: "#108EE9", cursor: "pointer" }, onClick: () => c(y, t), children: h }) });
|
|
675
|
+
x = /* @__PURE__ */ l.jsxs(ue, { align: "middle", children: [
|
|
676
|
+
/* @__PURE__ */ l.jsx(ee, { span: 2, children: /* @__PURE__ */ l.jsx("div", {}) }),
|
|
677
|
+
T
|
|
678
|
+
] });
|
|
679
|
+
}
|
|
680
|
+
let v = m.eventItemPopoverDateFormat;
|
|
681
|
+
return /* @__PURE__ */ l.jsxs("div", { style: { width: "300px" }, children: [
|
|
682
|
+
/* @__PURE__ */ l.jsxs(ue, { align: "middle", children: [
|
|
683
|
+
/* @__PURE__ */ l.jsx(ee, { span: 2, children: /* @__PURE__ */ l.jsx("div", { className: "status-dot", style: { backgroundColor: o } }) }),
|
|
684
|
+
/* @__PURE__ */ l.jsx(ee, { span: 22, className: "overflow-text", children: /* @__PURE__ */ l.jsx("span", { className: "header2-text", title: e, children: e }) })
|
|
685
|
+
] }),
|
|
686
|
+
R,
|
|
687
|
+
/* @__PURE__ */ l.jsxs(ue, { align: "middle", children: [
|
|
688
|
+
/* @__PURE__ */ l.jsx(ee, { span: 2, children: /* @__PURE__ */ l.jsx("div", {}) }),
|
|
689
|
+
/* @__PURE__ */ l.jsxs(ee, { span: 22, children: [
|
|
690
|
+
/* @__PURE__ */ l.jsx("span", { className: "header1-text", children: E.format("HH:mm") }),
|
|
691
|
+
/* @__PURE__ */ l.jsx("span", { className: "help-text", style: { marginLeft: "8px" }, children: E.format(v) }),
|
|
692
|
+
/* @__PURE__ */ l.jsx("span", { className: "header2-text", style: { marginLeft: "8px" }, children: "-" }),
|
|
693
|
+
/* @__PURE__ */ l.jsx("span", { className: "header1-text", style: { marginLeft: "8px" }, children: C.format("HH:mm") }),
|
|
694
|
+
/* @__PURE__ */ l.jsx("span", { className: "help-text", style: { marginLeft: "8px" }, children: C.format(v) })
|
|
695
|
+
] })
|
|
696
|
+
] }),
|
|
697
|
+
x
|
|
698
|
+
] });
|
|
699
|
+
}
|
|
700
|
+
Oe.propTypes = {
|
|
701
|
+
schedulerData: u.object.isRequired,
|
|
702
|
+
eventItem: u.object.isRequired,
|
|
703
|
+
title: u.string.isRequired,
|
|
704
|
+
startTime: u.string.isRequired,
|
|
705
|
+
endTime: u.string.isRequired,
|
|
706
|
+
statusColor: u.string.isRequired,
|
|
707
|
+
subtitleGetter: u.func,
|
|
708
|
+
viewEventClick: u.func,
|
|
709
|
+
viewEventText: u.string,
|
|
710
|
+
viewEvent2Click: u.func,
|
|
711
|
+
viewEvent2Text: u.string,
|
|
712
|
+
eventItemPopoverTemplateResolver: u.func
|
|
713
|
+
};
|
|
714
|
+
const H = "YYYY-MM-DD", L = "YYYY-MM-DD HH:mm:ss", D = { Day: 0, Week: 1, Month: 2, Quarter: 3, Year: 4, Custom: 5, Custom1: 6, Custom2: 7 }, X = { Day: 0, Hour: 1 }, ae = { Top: 0, TopRight: 1, TopLeft: 2, Bottom: 3, BottomRight: 4, BottomLeft: 5 }, ie = { EVENT: "event" }, re = "ontouchstart" in window;
|
|
715
|
+
class Ne extends _e {
|
|
716
|
+
constructor(e) {
|
|
717
|
+
super(e);
|
|
718
|
+
M(this, "initStartDrag", (e) => {
|
|
719
|
+
const { schedulerData: r, eventItem: s } = this.props;
|
|
720
|
+
let o = r._getEventSlotId(s), i = r.getSlotById(o);
|
|
721
|
+
if (i && i.groupOnly || r._isResizing())
|
|
722
|
+
return;
|
|
723
|
+
e.stopPropagation();
|
|
724
|
+
let a = 0;
|
|
725
|
+
if (re) {
|
|
726
|
+
if (e.changedTouches.length == 0)
|
|
727
|
+
return;
|
|
728
|
+
a = e.changedTouches[0].pageX;
|
|
729
|
+
} else {
|
|
730
|
+
if (e.buttons !== void 0 && e.buttons !== 1)
|
|
731
|
+
return;
|
|
732
|
+
a = e.clientX;
|
|
733
|
+
}
|
|
734
|
+
this.setState({
|
|
735
|
+
startX: a
|
|
736
|
+
}), r._startResizing(), re ? (this.startResizer.addEventListener("touchmove", this.doStartDrag, !1), this.startResizer.addEventListener("touchend", this.stopStartDrag, !1), this.startResizer.addEventListener("touchcancel", this.cancelStartDrag, !1)) : (document.documentElement.addEventListener("mousemove", this.doStartDrag, !1), document.documentElement.addEventListener("mouseup", this.stopStartDrag, !1)), document.onselectstart = function() {
|
|
737
|
+
return !1;
|
|
738
|
+
}, document.ondragstart = function() {
|
|
739
|
+
return !1;
|
|
740
|
+
};
|
|
741
|
+
});
|
|
742
|
+
M(this, "doStartDrag", (e) => {
|
|
743
|
+
e.stopPropagation();
|
|
744
|
+
let r = 0;
|
|
745
|
+
if (re) {
|
|
746
|
+
if (e.changedTouches.length == 0)
|
|
747
|
+
return;
|
|
748
|
+
r = e.changedTouches[0].pageX;
|
|
749
|
+
} else
|
|
750
|
+
r = e.clientX;
|
|
751
|
+
const { left: s, width: o, leftIndex: i, rightIndex: a, schedulerData: d } = this.props;
|
|
752
|
+
let c = d.getContentCellWidth(), h = i > 0 ? 5 : 6, p = c - h, f = a * c - h;
|
|
753
|
+
const { startX: m } = this.state;
|
|
754
|
+
let E = s + r - m, C = o + m - r;
|
|
755
|
+
C < p ? (C = p, E = (a - 1) * c + (a - 1 > 0 ? 2 : 3)) : C > f && (C = f, E = 3), this.setState({ left: E, width: C });
|
|
756
|
+
});
|
|
757
|
+
M(this, "stopStartDrag", (e) => {
|
|
758
|
+
e.stopPropagation(), re ? (this.startResizer.removeEventListener("touchmove", this.doStartDrag, !1), this.startResizer.removeEventListener("touchend", this.stopStartDrag, !1), this.startResizer.removeEventListener("touchcancel", this.cancelStartDrag, !1)) : (document.documentElement.removeEventListener("mousemove", this.doStartDrag, !1), document.documentElement.removeEventListener("mouseup", this.stopStartDrag, !1)), document.onselectstart = null, document.ondragstart = null;
|
|
759
|
+
const { width: r, left: s, top: o, leftIndex: i, rightIndex: a, schedulerData: d, eventItem: c, updateEventStart: h, conflictOccurred: p } = this.props;
|
|
760
|
+
if (d._stopResizing(), this.state.width === r)
|
|
761
|
+
return;
|
|
762
|
+
let f = 0;
|
|
763
|
+
if (re) {
|
|
764
|
+
if (e.changedTouches.length == 0) {
|
|
765
|
+
this.setState({
|
|
766
|
+
left: s,
|
|
767
|
+
top: o,
|
|
768
|
+
width: r
|
|
769
|
+
});
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
f = e.changedTouches[0].pageX;
|
|
773
|
+
} else
|
|
774
|
+
f = e.clientX;
|
|
775
|
+
const { cellUnit: m, events: E, config: C, localeMoment: R } = d;
|
|
776
|
+
let x = d.getContentCellWidth(), v = i > 0 ? 5 : 6, T = x - v, w = a * x - v;
|
|
777
|
+
const { startX: j } = this.state;
|
|
778
|
+
let k = r + j - f, O = f - j, P = O < 0 ? -1 : O === 0 ? 0 : 1, S = (P > 0 ? Math.floor(Math.abs(O) / x) : Math.ceil(Math.abs(O) / x)) * P;
|
|
779
|
+
k < T ? S = a - i - 1 : k > w && (S = -i);
|
|
780
|
+
let W = R(c.start).add(m === X.Hour ? S * C.minuteStep : S, m === X.Hour ? "minutes" : "days").format(L);
|
|
781
|
+
if (S !== 0 && m !== X.Hour && C.displayWeekend === !1)
|
|
782
|
+
if (S > 0) {
|
|
783
|
+
let G = 0, A = 0;
|
|
784
|
+
for (; ; ) {
|
|
785
|
+
A++;
|
|
786
|
+
let F = R(c.start).add(A, "days"), Y = F.weekday();
|
|
787
|
+
if (Y !== 0 && Y !== 6 && (G++, G === S)) {
|
|
788
|
+
W = F.format(L);
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
} else {
|
|
793
|
+
let G = 0, A = 0;
|
|
794
|
+
for (; ; ) {
|
|
795
|
+
A--;
|
|
796
|
+
let F = R(c.start).add(A, "days"), Y = F.weekday();
|
|
797
|
+
if (Y !== 0 && Y !== 6 && (G--, G === S)) {
|
|
798
|
+
W = F.format(L);
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
let q = !1, Q = d._getEventSlotId(c), V, K = d.getSlotById(Q);
|
|
804
|
+
if (K && (V = K.name), C.checkConflict) {
|
|
805
|
+
let G = R(W), A = R(c.end);
|
|
806
|
+
E.forEach((F) => {
|
|
807
|
+
if (d._getEventSlotId(F) === Q && F.id !== c.id) {
|
|
808
|
+
let Y = R(F.start), B = R(F.end);
|
|
809
|
+
(G >= Y && G < B || A > Y && A <= B || Y >= G && Y < A || B > G && B <= A) && (q = !0);
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
q ? (this.setState({
|
|
814
|
+
left: s,
|
|
815
|
+
top: o,
|
|
816
|
+
width: r
|
|
817
|
+
}), p != null ? p(d, "StartResize", c, ie.EVENT, Q, V, W, c.end) : console.log("Conflict occurred, set conflictOccurred func in Scheduler to handle it"), this.subscribeResizeEvent(this.props)) : h != null && h(d, c, W);
|
|
818
|
+
});
|
|
819
|
+
M(this, "cancelStartDrag", (e) => {
|
|
820
|
+
e.stopPropagation(), this.startResizer.removeEventListener("touchmove", this.doStartDrag, !1), this.startResizer.removeEventListener("touchend", this.stopStartDrag, !1), this.startResizer.removeEventListener("touchcancel", this.cancelStartDrag, !1), document.onselectstart = null, document.ondragstart = null;
|
|
821
|
+
const { schedulerData: r, left: s, top: o, width: i } = this.props;
|
|
822
|
+
r._stopResizing(), this.setState({
|
|
823
|
+
left: s,
|
|
824
|
+
top: o,
|
|
825
|
+
width: i
|
|
826
|
+
});
|
|
827
|
+
});
|
|
828
|
+
M(this, "initEndDrag", (e) => {
|
|
829
|
+
const { schedulerData: r, eventItem: s } = this.props;
|
|
830
|
+
let o = r._getEventSlotId(s), i = r.getSlotById(o);
|
|
831
|
+
if (i && i.groupOnly || r._isResizing())
|
|
832
|
+
return;
|
|
833
|
+
e.stopPropagation();
|
|
834
|
+
let a = 0;
|
|
835
|
+
if (re) {
|
|
836
|
+
if (e.changedTouches.length == 0)
|
|
837
|
+
return;
|
|
838
|
+
a = e.changedTouches[0].pageX;
|
|
839
|
+
} else {
|
|
840
|
+
if (e.buttons !== void 0 && e.buttons !== 1)
|
|
841
|
+
return;
|
|
842
|
+
a = e.clientX;
|
|
843
|
+
}
|
|
844
|
+
this.setState({
|
|
845
|
+
endX: a
|
|
846
|
+
}), r._startResizing(), re ? (this.endResizer.addEventListener("touchmove", this.doEndDrag, !1), this.endResizer.addEventListener("touchend", this.stopEndDrag, !1), this.endResizer.addEventListener("touchcancel", this.cancelEndDrag, !1)) : (document.documentElement.addEventListener("mousemove", this.doEndDrag, !1), document.documentElement.addEventListener("mouseup", this.stopEndDrag, !1)), document.onselectstart = function() {
|
|
847
|
+
return !1;
|
|
848
|
+
}, document.ondragstart = function() {
|
|
849
|
+
return !1;
|
|
850
|
+
};
|
|
851
|
+
});
|
|
852
|
+
M(this, "doEndDrag", (e) => {
|
|
853
|
+
e.stopPropagation();
|
|
854
|
+
let r = 0;
|
|
855
|
+
if (re) {
|
|
856
|
+
if (e.changedTouches.length == 0)
|
|
857
|
+
return;
|
|
858
|
+
r = e.changedTouches[0].pageX;
|
|
859
|
+
} else
|
|
860
|
+
r = e.clientX;
|
|
861
|
+
const { width: s, leftIndex: o, schedulerData: i } = this.props, { headers: a } = i;
|
|
862
|
+
let d = i.getContentCellWidth(), c = o > 0 ? 5 : 6, h = d - c, p = (a.length - o) * d - c;
|
|
863
|
+
const { endX: f } = this.state;
|
|
864
|
+
let m = s + r - f;
|
|
865
|
+
m < h ? m = h : m > p && (m = p), this.setState({ width: m });
|
|
866
|
+
});
|
|
867
|
+
M(this, "stopEndDrag", (e) => {
|
|
868
|
+
e.stopPropagation(), re ? (this.endResizer.removeEventListener("touchmove", this.doEndDrag, !1), this.endResizer.removeEventListener("touchend", this.stopEndDrag, !1), this.endResizer.removeEventListener("touchcancel", this.cancelEndDrag, !1)) : (document.documentElement.removeEventListener("mousemove", this.doEndDrag, !1), document.documentElement.removeEventListener("mouseup", this.stopEndDrag, !1)), document.onselectstart = null, document.ondragstart = null;
|
|
869
|
+
const { width: r, left: s, top: o, leftIndex: i, rightIndex: a, schedulerData: d, eventItem: c, updateEventEnd: h, conflictOccurred: p } = this.props;
|
|
870
|
+
if (d._stopResizing(), this.state.width === r)
|
|
871
|
+
return;
|
|
872
|
+
let f = 0;
|
|
873
|
+
if (re) {
|
|
874
|
+
if (e.changedTouches.length == 0) {
|
|
875
|
+
this.setState({
|
|
876
|
+
left: s,
|
|
877
|
+
top: o,
|
|
878
|
+
width: r
|
|
879
|
+
});
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
f = e.changedTouches[0].pageX;
|
|
883
|
+
} else
|
|
884
|
+
f = e.clientX;
|
|
885
|
+
const { headers: m, cellUnit: E, events: C, config: R, localeMoment: x } = d;
|
|
886
|
+
let v = d.getContentCellWidth(), T = i > 0 ? 5 : 6, w = v - T, j = (m.length - i) * v - T;
|
|
887
|
+
const { endX: k } = this.state;
|
|
888
|
+
let O = r + f - k, P = O - r, S = P < 0 ? -1 : P === 0 ? 0 : 1, W = (S < 0 ? Math.floor(Math.abs(P) / v) : Math.ceil(Math.abs(P) / v)) * S;
|
|
889
|
+
O < w ? W = i - a + 1 : O > j && (W = m.length - a);
|
|
890
|
+
let q = x(c.end).add(E === X.Hour ? W * R.minuteStep : W, E === X.Hour ? "minutes" : "days").format(L);
|
|
891
|
+
if (W !== 0 && E !== X.Hour && R.displayWeekend === !1)
|
|
892
|
+
if (W > 0) {
|
|
893
|
+
let A = 0, F = 0;
|
|
894
|
+
for (; ; ) {
|
|
895
|
+
F++;
|
|
896
|
+
let Y = x(c.end).add(F, "days"), B = Y.weekday();
|
|
897
|
+
if (B !== 0 && B !== 6 && (A++, A === W)) {
|
|
898
|
+
q = Y.format(L);
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
} else {
|
|
903
|
+
let A = 0, F = 0;
|
|
904
|
+
for (; ; ) {
|
|
905
|
+
F--;
|
|
906
|
+
let Y = x(c.end).add(F, "days"), B = Y.weekday();
|
|
907
|
+
if (B !== 0 && B !== 6 && (A--, A === W)) {
|
|
908
|
+
q = Y.format(L);
|
|
909
|
+
break;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
let Q = !1, V = d._getEventSlotId(c), K, G = d.getSlotById(V);
|
|
914
|
+
if (G && (K = G.name), R.checkConflict) {
|
|
915
|
+
let A = x(c.start), F = x(q);
|
|
916
|
+
C.forEach((Y) => {
|
|
917
|
+
if (d._getEventSlotId(Y) === V && Y.id !== c.id) {
|
|
918
|
+
let B = x(Y.start), ne = x(Y.end);
|
|
919
|
+
(A >= B && A < ne || F > B && F <= ne || B >= A && B < F || ne > A && ne <= F) && (Q = !0);
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
Q ? (this.setState({
|
|
924
|
+
left: s,
|
|
925
|
+
top: o,
|
|
926
|
+
width: r
|
|
927
|
+
}), p != null ? p(d, "EndResize", c, ie.EVENT, V, K, c.start, q) : console.log("Conflict occurred, set conflictOccurred func in Scheduler to handle it"), this.subscribeResizeEvent(this.props)) : h != null && h(d, c, q);
|
|
928
|
+
});
|
|
929
|
+
M(this, "cancelEndDrag", (e) => {
|
|
930
|
+
e.stopPropagation(), this.endResizer.removeEventListener("touchmove", this.doEndDrag, !1), this.endResizer.removeEventListener("touchend", this.stopEndDrag, !1), this.endResizer.removeEventListener("touchcancel", this.cancelEndDrag, !1), document.onselectstart = null, document.ondragstart = null;
|
|
931
|
+
const { schedulerData: r, left: s, top: o, width: i } = this.props;
|
|
932
|
+
r._stopResizing(), this.setState({
|
|
933
|
+
left: s,
|
|
934
|
+
top: o,
|
|
935
|
+
width: i
|
|
936
|
+
});
|
|
937
|
+
});
|
|
938
|
+
M(this, "startResizable", (e) => {
|
|
939
|
+
const { eventItem: r, isInPopover: s, schedulerData: o } = e, { config: i } = o;
|
|
940
|
+
return i.startResizable === !0 && s === !1 && (r.resizable == null || r.resizable !== !1) && (r.startResizable == null || r.startResizable !== !1);
|
|
941
|
+
});
|
|
942
|
+
M(this, "endResizable", (e) => {
|
|
943
|
+
const { eventItem: r, isInPopover: s, schedulerData: o } = e, { config: i } = o;
|
|
944
|
+
return i.endResizable === !0 && s === !1 && (r.resizable == null || r.resizable !== !1) && (r.endResizable == null || r.endResizable !== !1);
|
|
945
|
+
});
|
|
946
|
+
M(this, "subscribeResizeEvent", (e) => {
|
|
947
|
+
this.startResizer != null && (re || (this.startResizer.removeEventListener("mousedown", this.initStartDrag, !1), this.startResizable(e) && this.startResizer.addEventListener("mousedown", this.initStartDrag, !1))), this.endResizer != null && (re || (this.endResizer.removeEventListener("mousedown", this.initEndDrag, !1), this.endResizable(e) && this.endResizer.addEventListener("mousedown", this.initEndDrag, !1)));
|
|
948
|
+
});
|
|
949
|
+
const { left: r, top: s, width: o } = e;
|
|
950
|
+
this.state = {
|
|
951
|
+
left: r,
|
|
952
|
+
top: s,
|
|
953
|
+
width: o
|
|
954
|
+
}, this.startResizer = null, this.endResizer = null;
|
|
955
|
+
}
|
|
956
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
957
|
+
const { left: r, top: s, width: o } = e;
|
|
958
|
+
this.setState({
|
|
959
|
+
left: r,
|
|
960
|
+
top: s,
|
|
961
|
+
width: o
|
|
962
|
+
}), this.subscribeResizeEvent(e);
|
|
963
|
+
}
|
|
964
|
+
componentDidMount() {
|
|
965
|
+
this.subscribeResizeEvent(this.props);
|
|
966
|
+
}
|
|
967
|
+
render() {
|
|
968
|
+
const { eventItem: e, isStart: r, isEnd: s, isInPopover: o, eventItemClick: i, schedulerData: a, isDragging: d, connectDragSource: c, connectDragPreview: h, eventItemTemplateResolver: p } = this.props, { config: f, localeMoment: m } = a, { left: E, width: C, top: R } = this.state;
|
|
969
|
+
let x = r ? s ? "round-all" : "round-head" : s ? "round-tail" : "round-none", v = f.defaultEventBgColor;
|
|
970
|
+
e.bgColor && (v = e.bgColor);
|
|
971
|
+
let T = a.behaviors.getEventTextFunc(a, e), w = /* @__PURE__ */ l.jsx(Oe, { ...this.props, eventItem: e, title: e.title, startTime: e.start, endTime: e.end, statusColor: v }), j = m(e.start), k = o ? `${j.format("HH:mm")} ${T}` : T, O = /* @__PURE__ */ l.jsx("div", {});
|
|
972
|
+
this.startResizable(this.props) && (O = /* @__PURE__ */ l.jsx("div", { className: "event-resizer event-start-resizer", ref: (q) => this.startResizer = q }));
|
|
973
|
+
let P = /* @__PURE__ */ l.jsx("div", {});
|
|
974
|
+
this.endResizable(this.props) && (P = /* @__PURE__ */ l.jsx("div", { className: "event-resizer event-end-resizer", ref: (q) => this.endResizer = q }));
|
|
975
|
+
let S = /* @__PURE__ */ l.jsx("div", { className: x + " event-item", style: { height: f.eventItemHeight, backgroundColor: v }, children: /* @__PURE__ */ l.jsx("span", { style: { marginLeft: "10px", lineHeight: `${f.eventItemHeight}px` }, children: k }) }, e.id);
|
|
976
|
+
p != null && (S = p(a, e, v, r, s, "event-item", f.eventItemHeight, void 0));
|
|
977
|
+
let W = /* @__PURE__ */ l.jsxs(
|
|
978
|
+
"a",
|
|
979
|
+
{
|
|
980
|
+
className: "timeline-event",
|
|
981
|
+
style: { left: E, width: C, top: R },
|
|
982
|
+
onClick: () => {
|
|
983
|
+
i && i(a, e);
|
|
984
|
+
},
|
|
985
|
+
children: [
|
|
986
|
+
S,
|
|
987
|
+
O,
|
|
988
|
+
P
|
|
989
|
+
]
|
|
990
|
+
}
|
|
991
|
+
);
|
|
992
|
+
return d ? null : a._isResizing() || f.eventItemPopoverEnabled == !1 || e.showPopover == !1 ? /* @__PURE__ */ l.jsx("div", { children: h(c(W)) }) : /* @__PURE__ */ l.jsx(He, { placement: "bottomLeft", content: w, trigger: "hover", children: h(c(W)) });
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
M(Ne, "propTypes", {
|
|
996
|
+
schedulerData: u.object.isRequired,
|
|
997
|
+
eventItem: u.object.isRequired,
|
|
998
|
+
isStart: u.bool.isRequired,
|
|
999
|
+
isEnd: u.bool.isRequired,
|
|
1000
|
+
left: u.number.isRequired,
|
|
1001
|
+
width: u.number.isRequired,
|
|
1002
|
+
top: u.number.isRequired,
|
|
1003
|
+
isInPopover: u.bool.isRequired,
|
|
1004
|
+
leftIndex: u.number.isRequired,
|
|
1005
|
+
rightIndex: u.number.isRequired,
|
|
1006
|
+
isDragging: u.bool.isRequired,
|
|
1007
|
+
connectDragSource: u.func.isRequired,
|
|
1008
|
+
connectDragPreview: u.func.isRequired,
|
|
1009
|
+
updateEventStart: u.func,
|
|
1010
|
+
updateEventEnd: u.func,
|
|
1011
|
+
moveEvent: u.func,
|
|
1012
|
+
subtitleGetter: u.func,
|
|
1013
|
+
eventItemClick: u.func,
|
|
1014
|
+
viewEventClick: u.func,
|
|
1015
|
+
viewEventText: u.string,
|
|
1016
|
+
viewEvent2Click: u.func,
|
|
1017
|
+
viewEvent2Text: u.string,
|
|
1018
|
+
conflictOccurred: u.func,
|
|
1019
|
+
eventItemTemplateResolver: u.func
|
|
1020
|
+
});
|
|
1021
|
+
class ot {
|
|
1022
|
+
constructor(t, e, r = ie.EVENT) {
|
|
1023
|
+
M(this, "getDragSpec", () => ({
|
|
1024
|
+
beginDrag: (t, e, r) => this.resolveDragObjFunc(t),
|
|
1025
|
+
endDrag: (t, e, r) => {
|
|
1026
|
+
if (!e.didDrop())
|
|
1027
|
+
return;
|
|
1028
|
+
const { moveEvent: s, newEvent: o, schedulerData: i } = t, { events: a, config: d, viewType: c, localeMoment: h } = i, p = e.getItem(), f = e.getItemType(), m = e.getDropResult();
|
|
1029
|
+
let E = m.slotId, C = m.slotName, R = m.start, x = m.end, v = m.initialStart;
|
|
1030
|
+
m.initialEnd;
|
|
1031
|
+
let T = "New", w = f === ie.EVENT;
|
|
1032
|
+
if (w) {
|
|
1033
|
+
const k = p;
|
|
1034
|
+
if (d.relativeMove)
|
|
1035
|
+
R = h(k.start).add(h(R).diff(h(v)), "ms").format(L);
|
|
1036
|
+
else if (c !== D.Day) {
|
|
1037
|
+
let O = h(R);
|
|
1038
|
+
R = h(k.start).year(O.year()).month(O.month()).date(O.date()).format(L);
|
|
1039
|
+
}
|
|
1040
|
+
if (x = h(R).add(h(k.end).diff(h(k.start)), "ms").format(L), d.crossResourceMove === !1) {
|
|
1041
|
+
E = i._getEventSlotId(p), C = void 0;
|
|
1042
|
+
let O = i.getSlotById(E);
|
|
1043
|
+
O && (C = O.name);
|
|
1044
|
+
}
|
|
1045
|
+
T = "Move";
|
|
1046
|
+
}
|
|
1047
|
+
let j = !1;
|
|
1048
|
+
if (d.checkConflict) {
|
|
1049
|
+
let k = h(R), O = h(x);
|
|
1050
|
+
a.forEach((P) => {
|
|
1051
|
+
if (i._getEventSlotId(P) === E && (!w || P.id !== p.id)) {
|
|
1052
|
+
let S = h(P.start), W = h(P.end);
|
|
1053
|
+
(k >= S && k < W || O > S && O <= W || S >= k && S < O || W > k && W <= O) && (j = !0);
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
if (j) {
|
|
1058
|
+
const { conflictOccurred: k } = t;
|
|
1059
|
+
k != null ? k(i, T, p, f, E, C, R, x) : console.log("Conflict occurred, set conflictOccurred func in Scheduler to handle it");
|
|
1060
|
+
} else
|
|
1061
|
+
w ? s !== void 0 && s(i, p, E, C, R, x) : o !== void 0 && o(i, E, C, R, x, f, p);
|
|
1062
|
+
},
|
|
1063
|
+
canDrag: (t) => {
|
|
1064
|
+
const { schedulerData: e, resourceEvents: r } = t, s = this.resolveDragObjFunc(t);
|
|
1065
|
+
if (e._isResizing())
|
|
1066
|
+
return !1;
|
|
1067
|
+
const { config: o } = e;
|
|
1068
|
+
return o.movable && (r == null || !r.groupOnly) && (s.movable == null || s.movable !== !1);
|
|
1069
|
+
}
|
|
1070
|
+
}));
|
|
1071
|
+
M(this, "getDragCollect", (t, e) => ({
|
|
1072
|
+
connectDragSource: t.dragSource(),
|
|
1073
|
+
isDragging: e.isDragging(),
|
|
1074
|
+
connectDragPreview: t.dragPreview()
|
|
1075
|
+
}));
|
|
1076
|
+
M(this, "getDragSource", () => this.dragSource);
|
|
1077
|
+
this.resolveDragObjFunc = t, this.DecoratedComponent = e, this.dndType = r, this.dragSource = Jt(this.dndType, this.getDragSpec(), this.getDragCollect)(this.DecoratedComponent);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function pe(y) {
|
|
1081
|
+
let t = 0, e = 0, r = y;
|
|
1082
|
+
for (; r; )
|
|
1083
|
+
t += r.offsetLeft - r.scrollLeft, e += r.offsetTop - r.scrollTop, r = r.offsetParent;
|
|
1084
|
+
return { x: t, y: e };
|
|
1085
|
+
}
|
|
1086
|
+
class rr {
|
|
1087
|
+
constructor(t, e) {
|
|
1088
|
+
M(this, "getDropSpec", () => ({
|
|
1089
|
+
drop: (t, e, r) => {
|
|
1090
|
+
const { schedulerData: s, resourceEvents: o } = t, { cellUnit: i, localeMoment: a } = s, d = e.getItemType(), c = pe(r.eventContainer);
|
|
1091
|
+
let h = s.getContentCellWidth(), p = null, f = null;
|
|
1092
|
+
if (d === ie.EVENT) {
|
|
1093
|
+
const x = e.getInitialClientOffset();
|
|
1094
|
+
let v = Math.floor((x.x - c.x) / h);
|
|
1095
|
+
p = o.headerItems[v].start, f = o.headerItems[v].end, i !== X.Hour && (f = a(o.headerItems[v].start).hour(23).minute(59).second(59).format(L));
|
|
1096
|
+
}
|
|
1097
|
+
const m = e.getClientOffset();
|
|
1098
|
+
let E = Math.floor((m.x - c.x) / h), C = o.headerItems[E].start, R = o.headerItems[E].end;
|
|
1099
|
+
return i !== X.Hour && (R = a(o.headerItems[E].start).hour(23).minute(59).second(59).format(L)), {
|
|
1100
|
+
slotId: o.slotId,
|
|
1101
|
+
slotName: o.slotName,
|
|
1102
|
+
start: C,
|
|
1103
|
+
end: R,
|
|
1104
|
+
initialStart: p,
|
|
1105
|
+
initialEnd: f
|
|
1106
|
+
};
|
|
1107
|
+
},
|
|
1108
|
+
hover: (t, e, r) => {
|
|
1109
|
+
const { schedulerData: s, resourceEvents: o, movingEvent: i } = t, { cellUnit: a, config: d, viewType: c, localeMoment: h } = s, p = e.getItem(), f = e.getItemType(), m = pe(r.eventContainer);
|
|
1110
|
+
let E = s.getContentCellWidth(), C = null;
|
|
1111
|
+
if (f === ie.EVENT) {
|
|
1112
|
+
const P = e.getInitialClientOffset();
|
|
1113
|
+
let S = Math.floor((P.x - m.x) / E);
|
|
1114
|
+
C = o.headerItems[S].start, o.headerItems[S].end, a !== X.Hour && h(o.headerItems[S].start).hour(23).minute(59).second(59).format(L);
|
|
1115
|
+
}
|
|
1116
|
+
const R = e.getClientOffset();
|
|
1117
|
+
let x = Math.floor((R.x - m.x) / E);
|
|
1118
|
+
if (!o.headerItems[x])
|
|
1119
|
+
return;
|
|
1120
|
+
let v = o.headerItems[x].start, T = o.headerItems[x].end;
|
|
1121
|
+
a !== X.Hour && (T = h(o.headerItems[x].start).hour(23).minute(59).second(59).format(L));
|
|
1122
|
+
let w = o.slotId, j = o.slotName, k = "New";
|
|
1123
|
+
if (f === ie.EVENT) {
|
|
1124
|
+
const P = p;
|
|
1125
|
+
if (d.relativeMove)
|
|
1126
|
+
v = h(P.start).add(h(v).diff(h(C)), "ms").format(L);
|
|
1127
|
+
else if (c !== D.Day) {
|
|
1128
|
+
let S = h(v);
|
|
1129
|
+
v = h(P.start).year(S.year()).month(S.month()).date(S.date()).format(L);
|
|
1130
|
+
}
|
|
1131
|
+
if (T = h(v).add(h(P.end).diff(h(P.start)), "ms").format(L), d.crossResourceMove === !1) {
|
|
1132
|
+
w = s._getEventSlotId(p), j = void 0;
|
|
1133
|
+
let S = s.getSlotById(w);
|
|
1134
|
+
S && (j = S.name);
|
|
1135
|
+
}
|
|
1136
|
+
k = "Move";
|
|
1137
|
+
}
|
|
1138
|
+
i && i(s, w, j, v, T, k, f, p);
|
|
1139
|
+
},
|
|
1140
|
+
canDrop: (t, e) => {
|
|
1141
|
+
const { schedulerData: r, resourceEvents: s } = t, o = e.getItem();
|
|
1142
|
+
if (r._isResizing())
|
|
1143
|
+
return !1;
|
|
1144
|
+
const { config: i } = r;
|
|
1145
|
+
return i.movable && !s.groupOnly && (o.movable == null || o.movable !== !1);
|
|
1146
|
+
}
|
|
1147
|
+
}));
|
|
1148
|
+
M(this, "getDropCollect", (t, e) => ({
|
|
1149
|
+
connectDropTarget: t.dropTarget(),
|
|
1150
|
+
isOver: e.isOver()
|
|
1151
|
+
}));
|
|
1152
|
+
M(this, "getDropTarget", () => Kt([...this.sourceMap.keys()], this.getDropSpec(), this.getDropCollect)(this.DecoratedComponent));
|
|
1153
|
+
M(this, "getDndSource", (t = ie.EVENT) => this.sourceMap.get(t));
|
|
1154
|
+
this.sourceMap = /* @__PURE__ */ new Map(), t.forEach((r) => {
|
|
1155
|
+
this.sourceMap.set(r.dndType, r);
|
|
1156
|
+
}), this.DecoratedComponent = e;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
function at({ schedulerData: y, contentScrollbarHeight: t, slotClickedFunc: e, slotItemTemplateResolver: r, toggleExpandFunc: s }) {
|
|
1160
|
+
const { renderData: o } = y, i = y.getResourceTableWidth() - 2, a = t, d = o.filter((m) => m.render), c = (m) => {
|
|
1161
|
+
s && s(y, m.slotId);
|
|
1162
|
+
}, h = (m) => {
|
|
1163
|
+
e && e(y, m);
|
|
1164
|
+
}, p = (m) => {
|
|
1165
|
+
const E = Array.from({ length: m.indent }, (T, w) => /* @__PURE__ */ l.jsx("span", { className: "expander-space" }, `es${w}`)), C = m.hasChildren ? m.expanded ? /* @__PURE__ */ l.jsx(Bt, { onClick: () => c(m) }, `es${m.indent}`) : /* @__PURE__ */ l.jsx(Vt, { onClick: () => c(m) }, `es${m.indent}`) : /* @__PURE__ */ l.jsx("span", { className: "expander-space" }, `es${m.indent}`);
|
|
1166
|
+
E.push(C);
|
|
1167
|
+
const R = e ? /* @__PURE__ */ l.jsx("a", { className: "slot-text", onClick: () => h(m), children: m.slotName }) : /* @__PURE__ */ l.jsx("span", { className: "slot-text", children: m.slotName });
|
|
1168
|
+
let x = /* @__PURE__ */ l.jsx("div", { title: m.slotName, className: "overflow-text header2-text", style: { textAlign: "left" }, children: /* @__PURE__ */ l.jsxs("span", { className: "slot-cell", children: [
|
|
1169
|
+
E,
|
|
1170
|
+
R
|
|
1171
|
+
] }) });
|
|
1172
|
+
if (r) {
|
|
1173
|
+
const T = r(y, m, e, i, "overflow-text header2-text");
|
|
1174
|
+
T && (x = T);
|
|
1175
|
+
}
|
|
1176
|
+
const v = {
|
|
1177
|
+
height: m.rowHeight,
|
|
1178
|
+
backgroundColor: m.groupOnly ? y.config.groupOnlySlotColor : void 0
|
|
1179
|
+
};
|
|
1180
|
+
return /* @__PURE__ */ l.jsx("tr", { children: /* @__PURE__ */ l.jsx("td", { "data-resource-id": m.slotId, style: v, children: x }) }, m.slotId);
|
|
1181
|
+
}, f = d.map(p);
|
|
1182
|
+
return /* @__PURE__ */ l.jsx("div", { style: { paddingBottom: a }, children: /* @__PURE__ */ l.jsx("table", { className: "resource-table", children: /* @__PURE__ */ l.jsx("tbody", { children: f }) }) });
|
|
1183
|
+
}
|
|
1184
|
+
at.propTypes = {
|
|
1185
|
+
schedulerData: u.object.isRequired,
|
|
1186
|
+
contentScrollbarHeight: u.number.isRequired,
|
|
1187
|
+
slotClickedFunc: u.func,
|
|
1188
|
+
slotItemTemplateResolver: u.func,
|
|
1189
|
+
toggleExpandFunc: u.func
|
|
1190
|
+
};
|
|
1191
|
+
function lt({ schedulerData: y, nonAgendaCellHeaderTemplateResolver: t }) {
|
|
1192
|
+
const { headers: e, cellUnit: r, config: s, localeMoment: o } = y, i = y.getTableHeaderHeight(), a = y.getContentCellWidth(), d = y.getMinuteStepsInHour(), c = (f, m, E) => {
|
|
1193
|
+
const C = o(f.time), R = !!f.nonWorkingTime;
|
|
1194
|
+
let x = R ? { width: a * d, color: s.nonWorkingTimeHeadColor, backgroundColor: s.nonWorkingTimeHeadBgColor } : { width: a * d };
|
|
1195
|
+
E || (x.width = a), m === e.length - (E ? d : 1) && (x = R ? { color: s.nonWorkingTimeHeadColor, backgroundColor: s.nonWorkingTimeHeadBgColor } : {});
|
|
1196
|
+
const v = (E ? s.nonAgendaDayCellHeaderFormat : s.nonAgendaOtherCellHeaderFormat).split("|").map((w) => C.format(w));
|
|
1197
|
+
if (typeof t == "function")
|
|
1198
|
+
return t(y, f, v, x);
|
|
1199
|
+
const T = v.map((w, j) => /* @__PURE__ */ l.jsx("div", { children: w }, j));
|
|
1200
|
+
return /* @__PURE__ */ l.jsx("th", { className: "header3-text", style: x, children: /* @__PURE__ */ l.jsx("div", { children: T }) }, f.time);
|
|
1201
|
+
}, p = (() => e.map((f, m) => {
|
|
1202
|
+
if (r === X.Hour && m % d !== 0)
|
|
1203
|
+
return null;
|
|
1204
|
+
const E = r === X.Hour;
|
|
1205
|
+
return c(f, m, E);
|
|
1206
|
+
}))();
|
|
1207
|
+
return /* @__PURE__ */ l.jsx("thead", { children: /* @__PURE__ */ l.jsx("tr", { style: { height: i }, children: p }) });
|
|
1208
|
+
}
|
|
1209
|
+
lt.propTypes = {
|
|
1210
|
+
schedulerData: u.object.isRequired,
|
|
1211
|
+
nonAgendaCellHeaderTemplateResolver: u.func
|
|
1212
|
+
};
|
|
1213
|
+
function dt({ schedulerData: y }) {
|
|
1214
|
+
const { renderData: t, headers: e, config: r, behaviors: s } = y;
|
|
1215
|
+
let o = y.getContentCellWidth();
|
|
1216
|
+
const i = t.filter((a) => a.render).map(({ slotId: a, groupOnly: d, rowHeight: c }) => {
|
|
1217
|
+
let h = e.map((p, f) => {
|
|
1218
|
+
const m = `${a}_${p.time}`, E = f === e.length - 1 ? {} : { width: o };
|
|
1219
|
+
if (p.nonWorkingTime && (E.backgroundColor = r.nonWorkingTimeBodyBgColor), d && (E.backgroundColor = r.groupOnlySlotColor), s.getNonAgendaViewBodyCellBgColorFunc) {
|
|
1220
|
+
let C = s.getNonAgendaViewBodyCellBgColorFunc(y, a, p);
|
|
1221
|
+
C && (E.backgroundColor = C);
|
|
1222
|
+
}
|
|
1223
|
+
return /* @__PURE__ */ l.jsx("td", { style: E, children: /* @__PURE__ */ l.jsx("div", {}) }, m);
|
|
1224
|
+
});
|
|
1225
|
+
return /* @__PURE__ */ l.jsx("tr", { style: { height: c }, children: h }, a);
|
|
1226
|
+
});
|
|
1227
|
+
return /* @__PURE__ */ l.jsx("tbody", { children: i });
|
|
1228
|
+
}
|
|
1229
|
+
dt.propTypes = {
|
|
1230
|
+
schedulerData: u.object.isRequired
|
|
1231
|
+
};
|
|
1232
|
+
function ct({ number: y, left: t, width: e, top: r, clickAction: s, headerItem: o, schedulerData: i }) {
|
|
1233
|
+
const { config: a } = i;
|
|
1234
|
+
let d = "+" + y + "more";
|
|
1235
|
+
return /* @__PURE__ */ l.jsx("a", { className: "timeline-event", style: { left: t, width: e, top: r }, onClick: () => s(o), children: /* @__PURE__ */ l.jsx("div", { style: { height: a.eventItemHeight, color: "#999", textAlign: "center" }, children: d }) });
|
|
1236
|
+
}
|
|
1237
|
+
ct.propTypes = {
|
|
1238
|
+
schedulerData: u.object.isRequired,
|
|
1239
|
+
number: u.number.isRequired,
|
|
1240
|
+
left: u.number.isRequired,
|
|
1241
|
+
width: u.number.isRequired,
|
|
1242
|
+
top: u.number.isRequired,
|
|
1243
|
+
clickAction: u.func.isRequired,
|
|
1244
|
+
headerItem: u.object.isRequired
|
|
1245
|
+
};
|
|
1246
|
+
function ut({ summary: y, left: t, width: e, top: r, schedulerData: s }) {
|
|
1247
|
+
const { config: o } = s, i = y.color || o.summaryColor;
|
|
1248
|
+
let a = "center";
|
|
1249
|
+
o.summaryPos === ae.TopRight || o.summaryPos === ae.BottomRight ? a = "right" : (o.summaryPos === ae.TopLeft || o.summaryPos === ae.BottomLeft) && (a = "left");
|
|
1250
|
+
const d = {
|
|
1251
|
+
height: o.eventItemHeight,
|
|
1252
|
+
color: i,
|
|
1253
|
+
textAlign: a,
|
|
1254
|
+
margin: "0 6px",
|
|
1255
|
+
fontSize: y.fontSize
|
|
1256
|
+
};
|
|
1257
|
+
return /* @__PURE__ */ l.jsx("a", { className: "timeline-event header2-text", style: { left: t, width: e, top: r, cursor: "default" }, children: /* @__PURE__ */ l.jsx("div", { style: d, children: y.text }) });
|
|
1258
|
+
}
|
|
1259
|
+
ut.propTypes = {
|
|
1260
|
+
schedulerData: u.object.isRequired,
|
|
1261
|
+
summary: u.object.isRequired,
|
|
1262
|
+
left: u.number.isRequired,
|
|
1263
|
+
width: u.number.isRequired,
|
|
1264
|
+
top: u.number.isRequired
|
|
1265
|
+
};
|
|
1266
|
+
function ht({ left: y, width: t, schedulerData: e }) {
|
|
1267
|
+
const { config: r } = e, s = {
|
|
1268
|
+
left: y,
|
|
1269
|
+
width: t,
|
|
1270
|
+
top: 0,
|
|
1271
|
+
bottom: 0,
|
|
1272
|
+
backgroundColor: r.selectedAreaColor
|
|
1273
|
+
};
|
|
1274
|
+
return /* @__PURE__ */ l.jsx("div", { className: "selected-area", style: s });
|
|
1275
|
+
}
|
|
1276
|
+
ht.propTypes = {
|
|
1277
|
+
schedulerData: u.object.isRequired,
|
|
1278
|
+
left: u.number.isRequired,
|
|
1279
|
+
width: u.number.isRequired
|
|
1280
|
+
};
|
|
1281
|
+
const le = "ontouchstart" in window;
|
|
1282
|
+
class ft extends _e {
|
|
1283
|
+
constructor(e) {
|
|
1284
|
+
super(e);
|
|
1285
|
+
M(this, "initDrag", (e) => {
|
|
1286
|
+
const { isSelecting: r } = this.state;
|
|
1287
|
+
if (r || (e.srcElement || e.target) !== this.eventContainer)
|
|
1288
|
+
return;
|
|
1289
|
+
e.stopPropagation();
|
|
1290
|
+
const { resourceEvents: s } = this.props;
|
|
1291
|
+
if (s.groupOnly)
|
|
1292
|
+
return;
|
|
1293
|
+
let o = 0;
|
|
1294
|
+
if (le) {
|
|
1295
|
+
if (e.changedTouches.length == 0)
|
|
1296
|
+
return;
|
|
1297
|
+
o = e.changedTouches[0].pageX;
|
|
1298
|
+
} else {
|
|
1299
|
+
if (e.buttons !== void 0 && e.buttons !== 1)
|
|
1300
|
+
return;
|
|
1301
|
+
o = e.clientX;
|
|
1302
|
+
}
|
|
1303
|
+
const { schedulerData: i } = this.props;
|
|
1304
|
+
let a = i.getContentCellWidth(), d = pe(this.eventContainer), c = o - d.x, h = Math.floor(c / a), p = h * a, f = Math.ceil(c / a), m = (f - h) * a;
|
|
1305
|
+
this.setState({
|
|
1306
|
+
startX: c,
|
|
1307
|
+
left: p,
|
|
1308
|
+
leftIndex: h,
|
|
1309
|
+
width: m,
|
|
1310
|
+
rightIndex: f,
|
|
1311
|
+
isSelecting: !0
|
|
1312
|
+
}), le ? (document.documentElement.addEventListener("touchmove", this.doDrag, !1), document.documentElement.addEventListener("touchend", this.stopDrag, !1), document.documentElement.addEventListener("touchcancel", this.cancelDrag, !1)) : (document.documentElement.addEventListener("mousemove", this.doDrag, !1), document.documentElement.addEventListener("mouseup", this.stopDrag, !1)), document.onselectstart = function() {
|
|
1313
|
+
return !1;
|
|
1314
|
+
}, document.ondragstart = function() {
|
|
1315
|
+
return !1;
|
|
1316
|
+
};
|
|
1317
|
+
});
|
|
1318
|
+
M(this, "doDrag", (e) => {
|
|
1319
|
+
e.stopPropagation();
|
|
1320
|
+
let r = 0;
|
|
1321
|
+
if (le) {
|
|
1322
|
+
if (e.changedTouches.length == 0)
|
|
1323
|
+
return;
|
|
1324
|
+
r = e.changedTouches[0].pageX;
|
|
1325
|
+
} else
|
|
1326
|
+
r = e.clientX;
|
|
1327
|
+
const { startX: s } = this.state, { schedulerData: o } = this.props, { headers: i } = o;
|
|
1328
|
+
let a = o.getContentCellWidth(), d = pe(this.eventContainer), c = r - d.x, h = Math.floor(Math.min(s, c) / a);
|
|
1329
|
+
h = h < 0 ? 0 : h;
|
|
1330
|
+
let p = h * a, f = Math.ceil(Math.max(s, c) / a);
|
|
1331
|
+
f = f > i.length ? i.length : f;
|
|
1332
|
+
let m = (f - h) * a;
|
|
1333
|
+
this.setState({
|
|
1334
|
+
leftIndex: h,
|
|
1335
|
+
left: p,
|
|
1336
|
+
rightIndex: f,
|
|
1337
|
+
width: m,
|
|
1338
|
+
isSelecting: !0
|
|
1339
|
+
});
|
|
1340
|
+
});
|
|
1341
|
+
M(this, "stopDrag", (e) => {
|
|
1342
|
+
e.stopPropagation();
|
|
1343
|
+
const { schedulerData: r, newEvent: s, resourceEvents: o } = this.props, { headers: i, events: a, config: d, cellUnit: c, localeMoment: h } = r, { leftIndex: p, rightIndex: f } = this.state;
|
|
1344
|
+
le ? (document.documentElement.removeEventListener("touchmove", this.doDrag, !1), document.documentElement.removeEventListener("touchend", this.stopDrag, !1), document.documentElement.removeEventListener("touchcancel", this.cancelDrag, !1)) : (document.documentElement.removeEventListener("mousemove", this.doDrag, !1), document.documentElement.removeEventListener("mouseup", this.stopDrag, !1)), document.onselectstart = null, document.ondragstart = null;
|
|
1345
|
+
let m = i[p].time, E = o.headerItems[f - 1].end;
|
|
1346
|
+
c !== X.Hour && (E = h(o.headerItems[f - 1].start).hour(23).minute(59).second(59).format(L));
|
|
1347
|
+
let C = o.slotId, R = o.slotName;
|
|
1348
|
+
this.setState({
|
|
1349
|
+
startX: 0,
|
|
1350
|
+
leftIndex: 0,
|
|
1351
|
+
left: 0,
|
|
1352
|
+
rightIndex: 0,
|
|
1353
|
+
width: 0,
|
|
1354
|
+
isSelecting: !1
|
|
1355
|
+
});
|
|
1356
|
+
let x = !1;
|
|
1357
|
+
if (d.checkConflict) {
|
|
1358
|
+
let v = h(m), T = h(E);
|
|
1359
|
+
a.forEach((w) => {
|
|
1360
|
+
if (r._getEventSlotId(w) === C) {
|
|
1361
|
+
let j = h(w.start), k = h(w.end);
|
|
1362
|
+
(v >= j && v < k || T > j && T <= k || j >= v && j < T || k > v && k <= T) && (x = !0);
|
|
1363
|
+
}
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
if (x) {
|
|
1367
|
+
const { conflictOccurred: v } = this.props;
|
|
1368
|
+
v != null ? v(
|
|
1369
|
+
r,
|
|
1370
|
+
"New",
|
|
1371
|
+
{
|
|
1372
|
+
id: void 0,
|
|
1373
|
+
start: m,
|
|
1374
|
+
end: E,
|
|
1375
|
+
slotId: C,
|
|
1376
|
+
slotName: R,
|
|
1377
|
+
title: void 0
|
|
1378
|
+
},
|
|
1379
|
+
ie.EVENT,
|
|
1380
|
+
C,
|
|
1381
|
+
R,
|
|
1382
|
+
m,
|
|
1383
|
+
E
|
|
1384
|
+
) : console.log("Conflict occurred, set conflictOccurred func in Scheduler to handle it");
|
|
1385
|
+
} else
|
|
1386
|
+
s != null && s(r, C, R, m, E);
|
|
1387
|
+
});
|
|
1388
|
+
M(this, "cancelDrag", (e) => {
|
|
1389
|
+
e.stopPropagation();
|
|
1390
|
+
const { isSelecting: r } = this.state;
|
|
1391
|
+
r && (document.documentElement.removeEventListener("touchmove", this.doDrag, !1), document.documentElement.removeEventListener("touchend", this.stopDrag, !1), document.documentElement.removeEventListener("touchcancel", this.cancelDrag, !1), document.onselectstart = null, document.ondragstart = null, this.setState({
|
|
1392
|
+
startX: 0,
|
|
1393
|
+
leftIndex: 0,
|
|
1394
|
+
left: 0,
|
|
1395
|
+
rightIndex: 0,
|
|
1396
|
+
width: 0,
|
|
1397
|
+
isSelecting: !1
|
|
1398
|
+
}));
|
|
1399
|
+
});
|
|
1400
|
+
M(this, "onAddMoreClick", (e) => {
|
|
1401
|
+
const { onSetAddMoreState: r, resourceEvents: s, schedulerData: o } = this.props;
|
|
1402
|
+
if (r) {
|
|
1403
|
+
const { config: i } = o;
|
|
1404
|
+
let a = o.getContentCellWidth(), d = s.headerItems.indexOf(e);
|
|
1405
|
+
if (d !== -1) {
|
|
1406
|
+
let c = d * (a - 1), h = pe(this.eventContainer);
|
|
1407
|
+
c = c + h.x;
|
|
1408
|
+
let p = h.y, f = (e.count + 1) * i.eventItemLineHeight + 20;
|
|
1409
|
+
r({
|
|
1410
|
+
headerItem: e,
|
|
1411
|
+
left: c,
|
|
1412
|
+
top: p,
|
|
1413
|
+
height: f
|
|
1414
|
+
});
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1418
|
+
M(this, "eventContainerRef", (e) => {
|
|
1419
|
+
this.eventContainer = e;
|
|
1420
|
+
});
|
|
1421
|
+
this.state = {
|
|
1422
|
+
isSelecting: !1,
|
|
1423
|
+
left: 0,
|
|
1424
|
+
width: 0
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
componentDidMount() {
|
|
1428
|
+
const { schedulerData: e } = this.props, { config: r } = e;
|
|
1429
|
+
r.creatable === !0 && (le || this.eventContainer.addEventListener("mousedown", this.initDrag, !1));
|
|
1430
|
+
}
|
|
1431
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
1432
|
+
le || this.eventContainer.removeEventListener("mousedown", this.initDrag, !1), e.schedulerData.config.creatable && (le || this.eventContainer.addEventListener("mousedown", this.initDrag, !1));
|
|
1433
|
+
}
|
|
1434
|
+
render() {
|
|
1435
|
+
const { resourceEvents: e, schedulerData: r, connectDropTarget: s, dndSource: o } = this.props, { cellUnit: i, startDate: a, endDate: d, config: c, localeMoment: h } = r, { isSelecting: p, left: f, width: m } = this.state;
|
|
1436
|
+
let E = r.getContentCellWidth(), C = r.getCellMaxEvents(), R = r.getContentTableWidth(), x = o.getDragSource(), v = p ? /* @__PURE__ */ l.jsx(ht, { ...this.props, left: f, width: m }) : /* @__PURE__ */ l.jsx("div", {}), T = [];
|
|
1437
|
+
return e.headerItems.forEach((w, j) => {
|
|
1438
|
+
if (w.count > 0 || w.summary != null) {
|
|
1439
|
+
let k = c.summaryPos === ae.TopRight || c.summaryPos === ae.Top || c.summaryPos === ae.TopLeft, O = e.hasSummary && k ? 1 + c.eventItemLineHeight : 1, P = w.addMore === 0 ? C : w.addMoreIndex;
|
|
1440
|
+
if (w.events.forEach((S, W) => {
|
|
1441
|
+
if (W < P && S !== void 0 && S.render) {
|
|
1442
|
+
let q = h(a), Q = h(d).add(1, "days");
|
|
1443
|
+
i === X.Hour && (q = h(a).add(c.dayStartFrom, "hours"), Q = h(d).add(c.dayStopTo + 1, "hours"));
|
|
1444
|
+
let V = h(S.eventItem.start), K = h(S.eventItem.end), G = V >= q, A = K <= Q, F = j * E + (j > 0 ? 2 : 3), Y = S.span * E - (j > 0 ? 5 : 6) > 0 ? S.span * E - (j > 0 ? 5 : 6) : 0, B = O + W * c.eventItemLineHeight, ne = /* @__PURE__ */ he(
|
|
1445
|
+
x,
|
|
1446
|
+
{
|
|
1447
|
+
...this.props,
|
|
1448
|
+
key: S.eventItem.id,
|
|
1449
|
+
eventItem: S.eventItem,
|
|
1450
|
+
isStart: G,
|
|
1451
|
+
isEnd: A,
|
|
1452
|
+
isInPopover: !1,
|
|
1453
|
+
left: F,
|
|
1454
|
+
width: Y,
|
|
1455
|
+
top: B,
|
|
1456
|
+
leftIndex: j,
|
|
1457
|
+
rightIndex: j + S.span
|
|
1458
|
+
}
|
|
1459
|
+
);
|
|
1460
|
+
T.push(ne);
|
|
1461
|
+
}
|
|
1462
|
+
}), w.addMore > 0) {
|
|
1463
|
+
let S = j * E + (j > 0 ? 2 : 3), W = E - (j > 0 ? 5 : 6), q = O + w.addMoreIndex * c.eventItemLineHeight, Q = /* @__PURE__ */ he(ct, { ...this.props, key: w.time, headerItem: w, number: w.addMore, left: S, width: W, top: q, clickAction: this.onAddMoreClick });
|
|
1464
|
+
T.push(Q);
|
|
1465
|
+
}
|
|
1466
|
+
if (w.summary != null) {
|
|
1467
|
+
let S = k ? 1 : e.rowHeight - c.eventItemLineHeight + 1, W = j * E + (j > 0 ? 2 : 3), q = E - (j > 0 ? 5 : 6), Q = `${e.slotId}_${w.time}`, V = /* @__PURE__ */ l.jsx(ut, { schedulerData: r, summary: w.summary, left: W, width: q, top: S }, Q);
|
|
1468
|
+
T.push(V);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}), /* @__PURE__ */ l.jsx("tr", { children: /* @__PURE__ */ l.jsx("td", { style: { width: R }, children: s(
|
|
1472
|
+
/* @__PURE__ */ l.jsxs("div", { ref: this.eventContainerRef, className: "event-container", style: { height: e.rowHeight }, children: [
|
|
1473
|
+
v,
|
|
1474
|
+
T
|
|
1475
|
+
] })
|
|
1476
|
+
) }) });
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
M(ft, "propTypes", {
|
|
1480
|
+
resourceEvents: u.object.isRequired,
|
|
1481
|
+
schedulerData: u.object.isRequired,
|
|
1482
|
+
dndSource: u.object.isRequired,
|
|
1483
|
+
onSetAddMoreState: u.func,
|
|
1484
|
+
updateEventStart: u.func,
|
|
1485
|
+
updateEventEnd: u.func,
|
|
1486
|
+
moveEvent: u.func,
|
|
1487
|
+
movingEvent: u.func,
|
|
1488
|
+
conflictOccurred: u.func,
|
|
1489
|
+
subtitleGetter: u.func,
|
|
1490
|
+
eventItemClick: u.func,
|
|
1491
|
+
viewEventClick: u.func,
|
|
1492
|
+
viewEventText: u.string,
|
|
1493
|
+
viewEvent2Click: u.func,
|
|
1494
|
+
viewEvent2Text: u.string,
|
|
1495
|
+
newEvent: u.func,
|
|
1496
|
+
eventItemTemplateResolver: u.func
|
|
1497
|
+
});
|
|
1498
|
+
function mt(y) {
|
|
1499
|
+
const { eventItem: t, isStart: e, isEnd: r, eventItemClick: s, schedulerData: o, eventItemTemplateResolver: i } = y, { config: a, behaviors: d } = o, c = e ? r ? "round-all" : "round-head" : r ? "round-tail" : "round-none", h = t.bgColor || a.defaultEventBgColor, p = d.getEventTextFunc(o, t);
|
|
1500
|
+
let f = /* @__PURE__ */ l.jsx("div", { className: `${c} event-item`, style: { height: a.eventItemHeight, maxWidth: a.agendaMaxEventWidth, backgroundColor: h }, children: /* @__PURE__ */ l.jsx("span", { style: { marginLeft: "10px", lineHeight: `${a.eventItemHeight}px` }, children: p }) }, t.id);
|
|
1501
|
+
i && (f = i(o, t, h, e, r, "event-item", a.eventItemHeight, a.agendaMaxEventWidth));
|
|
1502
|
+
const m = () => {
|
|
1503
|
+
s && s(o, t);
|
|
1504
|
+
}, E = /* @__PURE__ */ l.jsx("a", { className: "day-event", onClick: m, children: f });
|
|
1505
|
+
let C = /* @__PURE__ */ l.jsx(Oe, { ...y, title: t.title, startTime: t.start, endTime: t.end, statusColor: h });
|
|
1506
|
+
return a.eventItemPopoverEnabled ? /* @__PURE__ */ l.jsx(He, { placement: "bottomLeft", content: C, trigger: "hover", children: E }) : /* @__PURE__ */ l.jsx("span", { children: E });
|
|
1507
|
+
}
|
|
1508
|
+
mt.propTypes = {
|
|
1509
|
+
schedulerData: u.object.isRequired,
|
|
1510
|
+
eventItem: u.object.isRequired,
|
|
1511
|
+
isStart: u.bool.isRequired,
|
|
1512
|
+
isEnd: u.bool.isRequired,
|
|
1513
|
+
subtitleGetter: u.func,
|
|
1514
|
+
eventItemClick: u.func,
|
|
1515
|
+
viewEventClick: u.func,
|
|
1516
|
+
viewEventText: u.string,
|
|
1517
|
+
viewEvent2Click: u.func,
|
|
1518
|
+
viewEvent2Text: u.string,
|
|
1519
|
+
eventItemTemplateResolver: u.func
|
|
1520
|
+
};
|
|
1521
|
+
function gt(y) {
|
|
1522
|
+
const { schedulerData: t, resourceEvents: e, slotClickedFunc: r, slotItemTemplateResolver: s } = y, { startDate: o, endDate: i, config: a, localeMoment: d } = t, { slotId: c, slotName: h, headerItems: p } = e;
|
|
1523
|
+
let m = t.getResourceTableWidth() - 2;
|
|
1524
|
+
const E = d(o).format(H), C = d(i).add(1, "days").format(H);
|
|
1525
|
+
let R = [];
|
|
1526
|
+
p.forEach(({ start: T, end: w, events: j }) => {
|
|
1527
|
+
E === d(T).format(H) && C === d(w).format(H) && j.forEach(({ eventItem: k }) => {
|
|
1528
|
+
const { start: O, end: P, id: S } = k, W = d(o), q = d(i).add(1, "days"), Q = d(O) >= W, V = d(P) < q, K = /* @__PURE__ */ he(mt, { ...y, key: S, eventItem: k, isStart: Q, isEnd: V });
|
|
1529
|
+
j.push(K);
|
|
1530
|
+
});
|
|
1531
|
+
});
|
|
1532
|
+
const x = r && /* @__PURE__ */ l.jsx("a", { onClick: () => r(t, e), children: h });
|
|
1533
|
+
let v = /* @__PURE__ */ l.jsx("div", { style: { width: m }, title: h, className: "overflow-text header2-text", children: x || /* @__PURE__ */ l.jsx("span", { children: h }) });
|
|
1534
|
+
if (s) {
|
|
1535
|
+
const T = s(t, e, r, m, "overflow-text header2-text");
|
|
1536
|
+
T && (v = T);
|
|
1537
|
+
}
|
|
1538
|
+
return /* @__PURE__ */ l.jsxs("tr", { style: { minHeight: a.eventItemLineHeight + 2 }, children: [
|
|
1539
|
+
/* @__PURE__ */ l.jsx("td", { "data-resource-id": c, children: v }),
|
|
1540
|
+
/* @__PURE__ */ l.jsx("td", { children: /* @__PURE__ */ l.jsx("div", { className: "day-event-container", children: R }) })
|
|
1541
|
+
] });
|
|
1542
|
+
}
|
|
1543
|
+
gt.propTypes = {
|
|
1544
|
+
schedulerData: u.object.isRequired,
|
|
1545
|
+
resourceEvents: u.object.isRequired,
|
|
1546
|
+
subtitleGetter: u.func,
|
|
1547
|
+
eventItemClick: u.func,
|
|
1548
|
+
viewEventClick: u.func,
|
|
1549
|
+
viewEventText: u.string,
|
|
1550
|
+
viewEvent2Click: u.func,
|
|
1551
|
+
viewEvent2Text: u.string,
|
|
1552
|
+
slotClickedFunc: u.func,
|
|
1553
|
+
slotItemTemplateResolver: u.func
|
|
1554
|
+
};
|
|
1555
|
+
function pt(y) {
|
|
1556
|
+
const { schedulerData: t } = y, { config: e, renderData: r, getResourceTableWidth: s, getTableHeaderHeight: o, isEventPerspective: i } = t, a = s(), d = o(), c = r.map((f) => /* @__PURE__ */ he(gt, { ...y, resourceEvents: f, key: f.slotId })), h = i ? e.taskName : e.resourceName, p = e.agendaViewHeader;
|
|
1557
|
+
return /* @__PURE__ */ l.jsx("tr", { children: /* @__PURE__ */ l.jsx("td", { children: /* @__PURE__ */ l.jsxs("table", { className: "scheduler-table", children: [
|
|
1558
|
+
/* @__PURE__ */ l.jsx("thead", { children: /* @__PURE__ */ l.jsxs("tr", { style: { height: d }, children: [
|
|
1559
|
+
/* @__PURE__ */ l.jsx("th", { style: { width: a }, className: "header3-text", children: h }),
|
|
1560
|
+
/* @__PURE__ */ l.jsx("th", { className: "header3-text", children: p })
|
|
1561
|
+
] }) }),
|
|
1562
|
+
/* @__PURE__ */ l.jsx("tbody", { children: c })
|
|
1563
|
+
] }) }) });
|
|
1564
|
+
}
|
|
1565
|
+
pt.propTypes = {
|
|
1566
|
+
schedulerData: oe.object.isRequired,
|
|
1567
|
+
subtitleGetter: oe.func,
|
|
1568
|
+
eventItemClick: oe.func,
|
|
1569
|
+
viewEventClick: oe.func,
|
|
1570
|
+
viewEventText: oe.string,
|
|
1571
|
+
viewEvent2Click: oe.func,
|
|
1572
|
+
viewEvent2Text: oe.string,
|
|
1573
|
+
slotClickedFunc: oe.func
|
|
1574
|
+
};
|
|
1575
|
+
function nr(y) {
|
|
1576
|
+
const [t] = $t(new ot((w) => w.eventItem, Ne)), { headerItem: e, left: r, top: s, height: o, closeAction: i, schedulerData: a } = y, { config: d, localeMoment: c } = a, { time: h, start: p, end: f, events: m } = e;
|
|
1577
|
+
let E = c(h).format(d.addMorePopoverHeaderFormat), C = c(p), R = c(f), x = 0, v = t.getDragSource();
|
|
1578
|
+
const T = m.map((w) => {
|
|
1579
|
+
if (w !== void 0) {
|
|
1580
|
+
x++;
|
|
1581
|
+
let j = c(w.eventItem.start), k = c(w.eventItem.end), O = j >= C, P = k < R, S = 10, W = 138, q = 12 + x * d.eventItemLineHeight;
|
|
1582
|
+
return /* @__PURE__ */ he(
|
|
1583
|
+
v,
|
|
1584
|
+
{
|
|
1585
|
+
...y,
|
|
1586
|
+
key: w.eventItem.id,
|
|
1587
|
+
eventItem: w.eventItem,
|
|
1588
|
+
leftIndex: 0,
|
|
1589
|
+
isInPopover: !0,
|
|
1590
|
+
isStart: O,
|
|
1591
|
+
isEnd: P,
|
|
1592
|
+
rightIndex: 1,
|
|
1593
|
+
left: S,
|
|
1594
|
+
width: W,
|
|
1595
|
+
top: q
|
|
1596
|
+
}
|
|
1597
|
+
);
|
|
1598
|
+
}
|
|
1599
|
+
return null;
|
|
1600
|
+
});
|
|
1601
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "add-more-popover-overlay", style: { left: r, top: s, height: o, width: "170px" }, children: [
|
|
1602
|
+
/* @__PURE__ */ l.jsxs(ue, { justify: "space-between", align: "middle", children: [
|
|
1603
|
+
/* @__PURE__ */ l.jsx(ee, { span: "22", children: /* @__PURE__ */ l.jsx("span", { className: "base-text", children: E }) }),
|
|
1604
|
+
/* @__PURE__ */ l.jsx(ee, { span: "2", children: /* @__PURE__ */ l.jsx("span", { onClick: () => i(void 0), children: /* @__PURE__ */ l.jsx(Gt, {}) }) })
|
|
1605
|
+
] }),
|
|
1606
|
+
T
|
|
1607
|
+
] });
|
|
1608
|
+
}
|
|
1609
|
+
nr.propTypes = {
|
|
1610
|
+
schedulerData: u.object.isRequired,
|
|
1611
|
+
headerItem: u.object.isRequired,
|
|
1612
|
+
left: u.number.isRequired,
|
|
1613
|
+
top: u.number.isRequired,
|
|
1614
|
+
height: u.number.isRequired,
|
|
1615
|
+
closeAction: u.func.isRequired,
|
|
1616
|
+
subtitleGetter: u.func,
|
|
1617
|
+
moveEvent: u.func,
|
|
1618
|
+
eventItemClick: u.func,
|
|
1619
|
+
viewEventClick: u.func,
|
|
1620
|
+
viewEventText: u.string,
|
|
1621
|
+
viewEvent2Click: u.func,
|
|
1622
|
+
viewEvent2Text: u.string,
|
|
1623
|
+
eventItemTemplateResolver: u.func
|
|
1624
|
+
};
|
|
1625
|
+
const rt = {
|
|
1626
|
+
schedulerWidth: "100%",
|
|
1627
|
+
besidesWidth: 20,
|
|
1628
|
+
schedulerMaxHeight: 0,
|
|
1629
|
+
tableHeaderHeight: 40,
|
|
1630
|
+
agendaResourceTableWidth: 160,
|
|
1631
|
+
agendaMaxEventWidth: 100,
|
|
1632
|
+
dayResourceTableWidth: 160,
|
|
1633
|
+
weekResourceTableWidth: "16%",
|
|
1634
|
+
monthResourceTableWidth: 160,
|
|
1635
|
+
quarterResourceTableWidth: 160,
|
|
1636
|
+
yearResourceTableWidth: 160,
|
|
1637
|
+
customResourceTableWidth: 160,
|
|
1638
|
+
dayCellWidth: 30,
|
|
1639
|
+
weekCellWidth: "12%",
|
|
1640
|
+
monthCellWidth: 80,
|
|
1641
|
+
quarterCellWidth: 80,
|
|
1642
|
+
yearCellWidth: 80,
|
|
1643
|
+
customCellWidth: 80,
|
|
1644
|
+
dayMaxEvents: 99,
|
|
1645
|
+
weekMaxEvents: 99,
|
|
1646
|
+
monthMaxEvents: 99,
|
|
1647
|
+
quarterMaxEvents: 99,
|
|
1648
|
+
yearMaxEvents: 99,
|
|
1649
|
+
customMaxEvents: 99,
|
|
1650
|
+
eventItemHeight: 22,
|
|
1651
|
+
eventItemLineHeight: 24,
|
|
1652
|
+
nonAgendaSlotMinHeight: 0,
|
|
1653
|
+
dayStartFrom: 0,
|
|
1654
|
+
dayStopTo: 23,
|
|
1655
|
+
defaultEventBgColor: "#80C5F6",
|
|
1656
|
+
selectedAreaColor: "#7EC2F3",
|
|
1657
|
+
nonWorkingTimeHeadColor: "#999999",
|
|
1658
|
+
nonWorkingTimeHeadBgColor: "#fff0f6",
|
|
1659
|
+
nonWorkingTimeBodyBgColor: "#fff0f6",
|
|
1660
|
+
summaryColor: "#666",
|
|
1661
|
+
summaryPos: ae.TopRight,
|
|
1662
|
+
groupOnlySlotColor: "#F8F8F8",
|
|
1663
|
+
startResizable: !0,
|
|
1664
|
+
endResizable: !0,
|
|
1665
|
+
movable: !0,
|
|
1666
|
+
creatable: !0,
|
|
1667
|
+
crossResourceMove: !0,
|
|
1668
|
+
checkConflict: !1,
|
|
1669
|
+
scrollToSpecialMomentEnabled: !0,
|
|
1670
|
+
eventItemPopoverEnabled: !0,
|
|
1671
|
+
calendarPopoverEnabled: !0,
|
|
1672
|
+
recurringEventsEnabled: !0,
|
|
1673
|
+
headerEnabled: !0,
|
|
1674
|
+
displayWeekend: !0,
|
|
1675
|
+
relativeMove: !0,
|
|
1676
|
+
defaultExpanded: !0,
|
|
1677
|
+
resourceName: "Resource Name",
|
|
1678
|
+
taskName: "Task Name",
|
|
1679
|
+
agendaViewHeader: "Agenda",
|
|
1680
|
+
addMorePopoverHeaderFormat: "MMM D, YYYY dddd",
|
|
1681
|
+
eventItemPopoverDateFormat: "MMM D",
|
|
1682
|
+
nonAgendaDayCellHeaderFormat: "ha",
|
|
1683
|
+
nonAgendaOtherCellHeaderFormat: "ddd M/D",
|
|
1684
|
+
minuteStep: 30,
|
|
1685
|
+
views: [
|
|
1686
|
+
{ viewName: "Day", viewType: D.Day, showAgenda: !1, isEventPerspective: !1 },
|
|
1687
|
+
{ viewName: "Week", viewType: D.Week, showAgenda: !1, isEventPerspective: !1 },
|
|
1688
|
+
{ viewName: "Month", viewType: D.Month, showAgenda: !1, isEventPerspective: !1 },
|
|
1689
|
+
{ viewName: "Quarter", viewType: D.Quarter, showAgenda: !1, isEventPerspective: !1 },
|
|
1690
|
+
{ viewName: "Year", viewType: D.Year, showAgenda: !1, isEventPerspective: !1 }
|
|
1691
|
+
]
|
|
1692
|
+
}, sr = (y, t, e, r) => {
|
|
1693
|
+
const s = y.localeMoment(e), o = y.localeMoment(r);
|
|
1694
|
+
let i;
|
|
1695
|
+
switch (t) {
|
|
1696
|
+
case D.Week:
|
|
1697
|
+
case D.Custom:
|
|
1698
|
+
case D.Custom1:
|
|
1699
|
+
case D.Custom2:
|
|
1700
|
+
s !== o && (i = `${s.format("MMM D")}-${o.format("D, YYYY")}`, s.month() !== o.month() && (i = `${s.format("MMM D")}-${o.format("MMM D, YYYY")}`), s.year() !== o.year() && (i = `${s.format("MMM D, YYYY")}-${o.format("MMM D, YYYY")}`));
|
|
1701
|
+
break;
|
|
1702
|
+
case D.Month:
|
|
1703
|
+
i = s.format("MMMM YYYY");
|
|
1704
|
+
break;
|
|
1705
|
+
case D.Quarter:
|
|
1706
|
+
i = `${s.format("MMM D")}-${o.format("MMM D, YYYY")}`;
|
|
1707
|
+
break;
|
|
1708
|
+
case D.Year:
|
|
1709
|
+
i = s.format("YYYY");
|
|
1710
|
+
break;
|
|
1711
|
+
default:
|
|
1712
|
+
i = s.format("MMM D, YYYY");
|
|
1713
|
+
}
|
|
1714
|
+
return i;
|
|
1715
|
+
}, ir = (y, t) => {
|
|
1716
|
+
if (!y.isEventPerspective)
|
|
1717
|
+
return t.title;
|
|
1718
|
+
const e = y.resources.find((r) => r.id === t.resourceId);
|
|
1719
|
+
return e ? e.name : t.title;
|
|
1720
|
+
}, or = (y, t, e) => y.localeMoment(), ar = (y, t) => {
|
|
1721
|
+
const { localeMoment: e, cellUnit: r } = y;
|
|
1722
|
+
if (r === X.Hour) {
|
|
1723
|
+
const o = e(t).hour();
|
|
1724
|
+
return o < 9 || o > 18;
|
|
1725
|
+
}
|
|
1726
|
+
const s = e(t).weekday();
|
|
1727
|
+
return s === 0 || s === 6;
|
|
1728
|
+
}, nt = {
|
|
1729
|
+
getSummaryFunc: void 0,
|
|
1730
|
+
getCustomDateFunc: void 0,
|
|
1731
|
+
getNonAgendaViewBodyCellBgColorFunc: void 0,
|
|
1732
|
+
getScrollSpecialMomentFunc: or,
|
|
1733
|
+
getDateLabelFunc: sr,
|
|
1734
|
+
getEventTextFunc: ir,
|
|
1735
|
+
isNonWorkingTimeFunc: ar
|
|
1736
|
+
// getNonAgendaViewBodyCellBgColorFunc: getNonAgendaViewBodyCellBgColor,
|
|
1737
|
+
//getCustomDateFunc: getCustomDate,
|
|
1738
|
+
//getSummaryFunc: getSummary,
|
|
1739
|
+
};
|
|
1740
|
+
class br {
|
|
1741
|
+
constructor(t = je().format(H), e = D.Week, r = !1, s = !1, o = void 0, i = void 0, a = void 0) {
|
|
1742
|
+
this.resources = [], this.events = [], this.eventGroups = [], this.eventGroupsAutoGenerated = !0, this.viewType = e, this.cellUnit = e === D.Day ? X.Hour : X.Day, this.showAgenda = r, this.isEventPerspective = s, this.resizing = !1, this.scrollToSpecialMoment = !1, this.documentWidth = 0, this.localeMoment = je, a && (this.localeMoment = a), this.config = o == null ? rt : { ...rt, ...o }, this._validateMinuteStep(this.config.minuteStep), this.behaviors = i == null ? nt : { ...nt, ...i }, this._resolveDate(0, t), this._createHeaders(), this._createRenderData();
|
|
1743
|
+
}
|
|
1744
|
+
setLocaleMoment(t) {
|
|
1745
|
+
t && (this.localeMoment = t, this._createHeaders(), this._createRenderData());
|
|
1746
|
+
}
|
|
1747
|
+
setResources(t) {
|
|
1748
|
+
this._validateResource(t), this.resources = Array.from(new Set(t)), this._createRenderData(), this.setScrollToSpecialMoment(!0);
|
|
1749
|
+
}
|
|
1750
|
+
setEventGroupsAutoGenerated(t) {
|
|
1751
|
+
this.eventGroupsAutoGenerated = t;
|
|
1752
|
+
}
|
|
1753
|
+
//optional
|
|
1754
|
+
setEventGroups(t) {
|
|
1755
|
+
this._validateEventGroups(t), this.eventGroups = Array.from(new Set(t)), this.eventGroupsAutoGenerated = !1, this._createRenderData(), this.setScrollToSpecialMoment(!0);
|
|
1756
|
+
}
|
|
1757
|
+
setMinuteStep(t) {
|
|
1758
|
+
this.config.minuteStep !== t && (this._validateMinuteStep(t), this.config.minuteStep = t, this._createHeaders(), this._createRenderData());
|
|
1759
|
+
}
|
|
1760
|
+
setBesidesWidth(t) {
|
|
1761
|
+
t >= 0 && (this.config.besidesWidth = t);
|
|
1762
|
+
}
|
|
1763
|
+
getMinuteStepsInHour() {
|
|
1764
|
+
return 60 / this.config.minuteStep;
|
|
1765
|
+
}
|
|
1766
|
+
addResource(t) {
|
|
1767
|
+
this.resources.filter((r) => r.id === t.id).length === 0 && (this.resources.push(t), this._createRenderData());
|
|
1768
|
+
}
|
|
1769
|
+
addEventGroup(t) {
|
|
1770
|
+
this.eventGroups.filter((r) => r.id === t.id).length === 0 && (this.eventGroups.push(t), this._createRenderData());
|
|
1771
|
+
}
|
|
1772
|
+
removeEventGroupById(t) {
|
|
1773
|
+
let e = -1;
|
|
1774
|
+
this.eventGroups.forEach((r, s) => {
|
|
1775
|
+
r.id === t && (e = s);
|
|
1776
|
+
}), e !== -1 && this.eventGroups.splice(e, 1);
|
|
1777
|
+
}
|
|
1778
|
+
containsEventGroupId(t) {
|
|
1779
|
+
let e = -1;
|
|
1780
|
+
return this.eventGroups.forEach((r, s) => {
|
|
1781
|
+
r.id === t && (e = s);
|
|
1782
|
+
}), e !== -1;
|
|
1783
|
+
}
|
|
1784
|
+
setEvents(t) {
|
|
1785
|
+
this._validateEvents(t), this.events = Array.from(t), this.eventGroupsAutoGenerated && this._generateEventGroups(), this.config.recurringEventsEnabled && this._handleRecurringEvents(), this._createRenderData();
|
|
1786
|
+
}
|
|
1787
|
+
setScrollToSpecialMoment(t) {
|
|
1788
|
+
this.config.scrollToSpecialMomentEnabled && (this.scrollToSpecialMoment = t);
|
|
1789
|
+
}
|
|
1790
|
+
prev() {
|
|
1791
|
+
this._resolveDate(-1), this.events = [], this._createHeaders(), this._createRenderData();
|
|
1792
|
+
}
|
|
1793
|
+
next() {
|
|
1794
|
+
this._resolveDate(1), this.events = [], this._createHeaders(), this._createRenderData();
|
|
1795
|
+
}
|
|
1796
|
+
setDate(t = je().format(H)) {
|
|
1797
|
+
this._resolveDate(0, t), this.events = [], this._createHeaders(), this._createRenderData();
|
|
1798
|
+
}
|
|
1799
|
+
setViewType(t = D.Week, e = !1, r = !1) {
|
|
1800
|
+
if (this.showAgenda = e, this.isEventPerspective = r, this.cellUnit = X.Day, this.viewType !== t) {
|
|
1801
|
+
let s = this.startDate;
|
|
1802
|
+
if (t === D.Custom || t === D.Custom1 || t === D.Custom2)
|
|
1803
|
+
this.viewType = t, this._resolveDate(0, s);
|
|
1804
|
+
else {
|
|
1805
|
+
if (this.viewType < t)
|
|
1806
|
+
t === D.Week ? (this.startDate = this.localeMoment(s).startOf("week").format(H), this.endDate = this.localeMoment(this.startDate).endOf("week").format(H)) : t === D.Month ? (this.startDate = this.localeMoment(s).startOf("month").format(H), this.endDate = this.localeMoment(this.startDate).endOf("month").format(H)) : t === D.Quarter ? (this.startDate = this.localeMoment(s).startOf("quarter").format(H), this.endDate = this.localeMoment(this.startDate).endOf("quarter").format(H)) : t === D.Year && (this.startDate = this.localeMoment(s).startOf("year").format(H), this.endDate = this.localeMoment(this.startDate).endOf("year").format(H));
|
|
1807
|
+
else {
|
|
1808
|
+
let o = this.localeMoment(this.startDate), i = this.localeMoment(this.endDate).add(1, "days");
|
|
1809
|
+
if (this.selectDate !== void 0) {
|
|
1810
|
+
let d = this.localeMoment(this.selectDate);
|
|
1811
|
+
d >= o && d < i && (s = this.selectDate);
|
|
1812
|
+
}
|
|
1813
|
+
let a = this.localeMoment();
|
|
1814
|
+
a >= o && a < i && (s = a.format(H)), t === D.Day ? (this.startDate = s, this.endDate = this.startDate, this.cellUnit = X.Hour) : t === D.Week ? (this.startDate = this.localeMoment(s).startOf("week").format(H), this.endDate = this.localeMoment(this.startDate).endOf("week").format(H)) : t === D.Month ? (this.startDate = this.localeMoment(s).startOf("month").format(H), this.endDate = this.localeMoment(this.startDate).endOf("month").format(H)) : t === D.Quarter && (this.startDate = this.localeMoment(s).startOf("quarter").format(H), this.endDate = this.localeMoment(this.startDate).endOf("quarter").format(H));
|
|
1815
|
+
}
|
|
1816
|
+
this.viewType = t;
|
|
1817
|
+
}
|
|
1818
|
+
this.events = [], this._createHeaders(), this._createRenderData(), this.setScrollToSpecialMoment(!0);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
setSchedulerMaxHeight(t) {
|
|
1822
|
+
this.config.schedulerMaxHeight = t;
|
|
1823
|
+
}
|
|
1824
|
+
isSchedulerResponsive() {
|
|
1825
|
+
return !!this.config.schedulerWidth.endsWith && this.config.schedulerWidth.endsWith("%");
|
|
1826
|
+
}
|
|
1827
|
+
toggleExpandStatus(t) {
|
|
1828
|
+
let e = !1, r = -1, s = !1, o = /* @__PURE__ */ new Map();
|
|
1829
|
+
this.renderData.forEach((i) => {
|
|
1830
|
+
if (e === !1)
|
|
1831
|
+
i.slotId === t && i.hasChildren && (e = !0, s = !i.expanded, i.expanded = s, r = i.indent, o.set(i.indent, {
|
|
1832
|
+
expanded: i.expanded,
|
|
1833
|
+
render: i.render
|
|
1834
|
+
}));
|
|
1835
|
+
else if (i.indent > r) {
|
|
1836
|
+
let a = o.get(i.indent - 1);
|
|
1837
|
+
i.render = a.expanded && a.render, i.hasChildren && o.set(i.indent, {
|
|
1838
|
+
expanded: i.expanded,
|
|
1839
|
+
render: i.render
|
|
1840
|
+
});
|
|
1841
|
+
} else
|
|
1842
|
+
e = !1;
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
isResourceViewResponsive() {
|
|
1846
|
+
let t = this.getResourceTableConfigWidth();
|
|
1847
|
+
return !!t.endsWith && t.endsWith("%");
|
|
1848
|
+
}
|
|
1849
|
+
isContentViewResponsive() {
|
|
1850
|
+
let t = this.getContentCellConfigWidth();
|
|
1851
|
+
return !!t.endsWith && t.endsWith("%");
|
|
1852
|
+
}
|
|
1853
|
+
getSchedulerWidth() {
|
|
1854
|
+
let t = this.documentWidth - this.config.besidesWidth > 0 ? this.documentWidth - this.config.besidesWidth : 0;
|
|
1855
|
+
return this.isSchedulerResponsive() ? parseInt(t * Number(this.config.schedulerWidth.slice(0, -1)) / 100) : this.config.schedulerWidth;
|
|
1856
|
+
}
|
|
1857
|
+
getResourceTableWidth() {
|
|
1858
|
+
let t = this.getResourceTableConfigWidth(), e = this.getSchedulerWidth(), r = this.isResourceViewResponsive() ? parseInt(e * Number(t.slice(0, -1)) / 100) : t;
|
|
1859
|
+
return this.isSchedulerResponsive() && this.getContentTableWidth() + r < e && (r = e - this.getContentTableWidth()), r;
|
|
1860
|
+
}
|
|
1861
|
+
getContentCellWidth() {
|
|
1862
|
+
let t = this.getContentCellConfigWidth(), e = this.getSchedulerWidth();
|
|
1863
|
+
return this.isContentViewResponsive() ? parseInt(e * Number(t.slice(0, -1)) / 100) : t;
|
|
1864
|
+
}
|
|
1865
|
+
getContentTableWidth() {
|
|
1866
|
+
return this.headers.length * this.getContentCellWidth();
|
|
1867
|
+
}
|
|
1868
|
+
getScrollToSpecialMoment() {
|
|
1869
|
+
return this.config.scrollToSpecialMomentEnabled ? this.scrollToSpecialMoment : !1;
|
|
1870
|
+
}
|
|
1871
|
+
getSlots() {
|
|
1872
|
+
return this.isEventPerspective ? this.eventGroups : this.resources;
|
|
1873
|
+
}
|
|
1874
|
+
getSlotById(t) {
|
|
1875
|
+
let e = this.getSlots(), r;
|
|
1876
|
+
return e.forEach((s) => {
|
|
1877
|
+
s.id === t && (r = s);
|
|
1878
|
+
}), r;
|
|
1879
|
+
}
|
|
1880
|
+
getResourceById(t) {
|
|
1881
|
+
let e;
|
|
1882
|
+
return this.resources.forEach((r) => {
|
|
1883
|
+
r.id === t && (e = r);
|
|
1884
|
+
}), e;
|
|
1885
|
+
}
|
|
1886
|
+
getTableHeaderHeight() {
|
|
1887
|
+
return this.config.tableHeaderHeight;
|
|
1888
|
+
}
|
|
1889
|
+
getSchedulerContentDesiredHeight() {
|
|
1890
|
+
let t = 0;
|
|
1891
|
+
return this.renderData.forEach((e) => {
|
|
1892
|
+
e.render && (t += e.rowHeight);
|
|
1893
|
+
}), t;
|
|
1894
|
+
}
|
|
1895
|
+
getCellMaxEvents() {
|
|
1896
|
+
return this.viewType === D.Week ? this.config.weekMaxEvents : this.viewType === D.Day ? this.config.dayMaxEvents : this.viewType === D.Month ? this.config.monthMaxEvents : this.viewType === D.Year ? this.config.yearMaxEvents : this.viewType === D.Quarter ? this.config.quarterMaxEvents : this.config.customMaxEvents;
|
|
1897
|
+
}
|
|
1898
|
+
getDateLabel() {
|
|
1899
|
+
let t = this.localeMoment(this.startDate), e = this.localeMoment(this.endDate), r = t.format("LL");
|
|
1900
|
+
return t != e && (r = `${t.format("LL")}-${e.format("LL")}`), this.behaviors.getDateLabelFunc && (r = this.behaviors.getDateLabelFunc(this, this.viewType, this.startDate, this.endDate)), r;
|
|
1901
|
+
}
|
|
1902
|
+
addEvent(t) {
|
|
1903
|
+
this._attachEvent(t), this.eventGroupsAutoGenerated && this._generateEventGroups(), this._createRenderData();
|
|
1904
|
+
}
|
|
1905
|
+
updateEventStart(t, e) {
|
|
1906
|
+
this._detachEvent(t), t.start = e, this._attachEvent(t), this._createRenderData();
|
|
1907
|
+
}
|
|
1908
|
+
updateEventEnd(t, e) {
|
|
1909
|
+
t.end = e, this._createRenderData();
|
|
1910
|
+
}
|
|
1911
|
+
moveEvent(t, e, r, s, o) {
|
|
1912
|
+
this._detachEvent(t), this.isEventPerspective ? (t.groupId = e, t.groupName = r) : t.resourceId = e, t.end = o, t.start = s, this._attachEvent(t), this._createRenderData();
|
|
1913
|
+
}
|
|
1914
|
+
isEventInTimeWindow(t, e, r, s) {
|
|
1915
|
+
return t < s && e > r;
|
|
1916
|
+
}
|
|
1917
|
+
removeEvent(t) {
|
|
1918
|
+
let e = this.events.indexOf(t);
|
|
1919
|
+
e !== -1 && (this.events.splice(e, 1), this._createRenderData());
|
|
1920
|
+
}
|
|
1921
|
+
removeEventById(t) {
|
|
1922
|
+
let e = -1;
|
|
1923
|
+
this.events.forEach((r, s) => {
|
|
1924
|
+
r.id === t && (e = s);
|
|
1925
|
+
}), e !== -1 && (this.events.splice(e, 1), this._createRenderData());
|
|
1926
|
+
}
|
|
1927
|
+
getResourceTableConfigWidth() {
|
|
1928
|
+
return this.showAgenda ? this.config.agendaResourceTableWidth : this.viewType === D.Week ? this.config.weekResourceTableWidth : this.viewType === D.Day ? this.config.dayResourceTableWidth : this.viewType === D.Month ? this.config.monthResourceTableWidth : this.viewType === D.Year ? this.config.yearResourceTableWidth : this.viewType === D.Quarter ? this.config.quarterResourceTableWidth : this.config.customResourceTableWidth;
|
|
1929
|
+
}
|
|
1930
|
+
getContentCellConfigWidth() {
|
|
1931
|
+
return this.viewType === D.Week ? this.config.weekCellWidth : this.viewType === D.Day ? this.config.dayCellWidth : this.viewType === D.Month ? this.config.monthCellWidth : this.viewType === D.Year ? this.config.yearCellWidth : this.viewType === D.Quarter ? this.config.quarterCellWidth : this.config.customCellWidth;
|
|
1932
|
+
}
|
|
1933
|
+
_setDocumentWidth(t) {
|
|
1934
|
+
t >= 0 && (this.documentWidth = t);
|
|
1935
|
+
}
|
|
1936
|
+
_detachEvent(t) {
|
|
1937
|
+
let e = this.events.indexOf(t);
|
|
1938
|
+
e !== -1 && this.events.splice(e, 1);
|
|
1939
|
+
}
|
|
1940
|
+
_attachEvent(t) {
|
|
1941
|
+
let e = 0, r = this.localeMoment(t.start);
|
|
1942
|
+
this.events.forEach((s, o) => {
|
|
1943
|
+
let i = this.localeMoment(s.start);
|
|
1944
|
+
r >= i && (e = o + 1);
|
|
1945
|
+
}), this.events.splice(e, 0, t);
|
|
1946
|
+
}
|
|
1947
|
+
_handleRecurringEvents() {
|
|
1948
|
+
let t = this.events.filter((e) => !!e.rrule);
|
|
1949
|
+
t.forEach((e) => {
|
|
1950
|
+
this._detachEvent(e);
|
|
1951
|
+
}), t.forEach((e) => {
|
|
1952
|
+
let r = this.localeMoment(this.startDate), s = this.localeMoment(this.endDate).add(1, "days"), o = this.localeMoment(e.start), i = this.localeMoment(e.end), a = ke(e.rrule), d, c = a.origOptions.until || s.toDate();
|
|
1953
|
+
if (a.origOptions.dtstart && (d = this.localeMoment(a.origOptions.dtstart)), s < c && (a.origOptions.until = s.toDate()), a = ke(a.toString()), e.exdates || e.exrule) {
|
|
1954
|
+
const f = new Zt();
|
|
1955
|
+
f.rrule(a), e.exrule && f.exrule(ke(e.exrule)), e.exdates && e.exdates.forEach((m) => {
|
|
1956
|
+
f.exdate(this.localeMoment(m).toDate());
|
|
1957
|
+
}), a = f;
|
|
1958
|
+
}
|
|
1959
|
+
a.all().map((f, m) => ({
|
|
1960
|
+
...e,
|
|
1961
|
+
recurringEventId: e.id,
|
|
1962
|
+
recurringEventStart: e.start,
|
|
1963
|
+
recurringEventEnd: e.end,
|
|
1964
|
+
id: `${e.id}-${m}`,
|
|
1965
|
+
start: a.origOptions.tzid ? this.localeMoment.utc(f).utcOffset(this.localeMoment().utcOffset(), !0).format(L) : this.localeMoment(f).format(L),
|
|
1966
|
+
end: a.origOptions.tzid ? this.localeMoment.utc(f).utcOffset(this.localeMoment().utcOffset(), !0).add(i.diff(o), "ms").add(this.localeMoment(c).utcOffset() - this.localeMoment(e.start).utcOffset(), "m").format(L) : this.localeMoment(f).add(i.diff(o), "ms").format(L)
|
|
1967
|
+
})).forEach((f) => {
|
|
1968
|
+
let m = this.localeMoment(f.start), E = this.localeMoment(f.end);
|
|
1969
|
+
this.isEventInTimeWindow(m, E, r, s) && (!d || m >= d) && this._attachEvent(f);
|
|
1970
|
+
});
|
|
1971
|
+
});
|
|
1972
|
+
}
|
|
1973
|
+
_resolveDate(t, e = void 0) {
|
|
1974
|
+
if (e != null && (this.selectDate = this.localeMoment(e).format(H)), this.viewType === D.Week)
|
|
1975
|
+
this.startDate = e != null ? this.localeMoment(e).startOf("week").format(H) : this.localeMoment(this.startDate).add(t, "weeks").format(H), this.endDate = this.localeMoment(this.startDate).endOf("week").format(H);
|
|
1976
|
+
else if (this.viewType === D.Day)
|
|
1977
|
+
this.startDate = e != null ? this.selectDate : this.localeMoment(this.startDate).add(t, "days").format(H), this.endDate = this.startDate;
|
|
1978
|
+
else if (this.viewType === D.Month)
|
|
1979
|
+
this.startDate = e != null ? this.localeMoment(e).startOf("month").format(H) : this.localeMoment(this.startDate).add(t, "months").format(H), this.endDate = this.localeMoment(this.startDate).endOf("month").format(H);
|
|
1980
|
+
else if (this.viewType === D.Quarter)
|
|
1981
|
+
this.startDate = e != null ? this.localeMoment(e).startOf("quarter").format(H) : this.localeMoment(this.startDate).add(t, "quarters").format(H), this.endDate = this.localeMoment(this.startDate).endOf("quarter").format(H);
|
|
1982
|
+
else if (this.viewType === D.Year)
|
|
1983
|
+
this.startDate = e != null ? this.localeMoment(e).startOf("year").format(H) : this.localeMoment(this.startDate).add(t, "years").format(H), this.endDate = this.localeMoment(this.startDate).endOf("year").format(H);
|
|
1984
|
+
else if (this.viewType === D.Custom || this.viewType === D.Custom1 || this.viewType === D.Custom2)
|
|
1985
|
+
if (this.behaviors.getCustomDateFunc != null) {
|
|
1986
|
+
let r = this.behaviors.getCustomDateFunc(this, t, e);
|
|
1987
|
+
this.startDate = r.startDate, this.endDate = r.endDate, r.cellUnit && (this.cellUnit = r.cellUnit);
|
|
1988
|
+
} else
|
|
1989
|
+
throw new Error("This is custom view type, set behaviors.getCustomDateFunc func to resolve the time window(startDate and endDate) yourself");
|
|
1990
|
+
}
|
|
1991
|
+
_createHeaders() {
|
|
1992
|
+
let t = [], e = this.localeMoment(this.startDate), r = this.localeMoment(this.endDate), s = e;
|
|
1993
|
+
if (this.showAgenda)
|
|
1994
|
+
t.push({ time: s.format(L), nonWorkingTime: !1 });
|
|
1995
|
+
else if (this.cellUnit === X.Hour)
|
|
1996
|
+
for (e = e.add(this.config.dayStartFrom, "hours"), r = r.add(this.config.dayStopTo, "hours"), s = e; s >= e && s <= r; ) {
|
|
1997
|
+
let o = this.getMinuteStepsInHour();
|
|
1998
|
+
for (let i = 0; i < o; i++) {
|
|
1999
|
+
let a = s.hour();
|
|
2000
|
+
if (a >= this.config.dayStartFrom && a <= this.config.dayStopTo) {
|
|
2001
|
+
let d = s.format(L), c = this.behaviors.isNonWorkingTimeFunc(this, d);
|
|
2002
|
+
t.push({ time: d, nonWorkingTime: c });
|
|
2003
|
+
}
|
|
2004
|
+
s = s.add(this.config.minuteStep, "minutes");
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
else
|
|
2008
|
+
for (; s >= e && s <= r; ) {
|
|
2009
|
+
let o = s.format(L), i = s.weekday();
|
|
2010
|
+
if (this.config.displayWeekend || i !== 0 && i !== 6) {
|
|
2011
|
+
let a = this.behaviors.isNonWorkingTimeFunc(this, o);
|
|
2012
|
+
t.push({ time: o, nonWorkingTime: a });
|
|
2013
|
+
}
|
|
2014
|
+
s = s.add(1, "days");
|
|
2015
|
+
}
|
|
2016
|
+
this.headers = t;
|
|
2017
|
+
}
|
|
2018
|
+
_createInitHeaderEvents(t) {
|
|
2019
|
+
let e = this.localeMoment(t.time), r = e.format(L), s = this.showAgenda ? this.viewType === D.Week ? e.add(1, "weeks").format(L) : this.viewType === D.Day ? e.add(1, "days").format(L) : this.viewType === D.Month ? e.add(1, "months").format(L) : this.viewType === D.Year ? e.add(1, "years").format(L) : this.viewType === D.Quarter ? e.add(1, "quarters").format(L) : this.localeMoment(this.endDate).add(1, "days").format(L) : this.cellUnit === X.Hour ? e.add(this.config.minuteStep, "minutes").format(L) : e.add(1, "days").format(L);
|
|
2020
|
+
return {
|
|
2021
|
+
time: t.time,
|
|
2022
|
+
nonWorkingTime: t.nonWorkingTime,
|
|
2023
|
+
start: r,
|
|
2024
|
+
end: s,
|
|
2025
|
+
count: 0,
|
|
2026
|
+
addMore: 0,
|
|
2027
|
+
addMoreIndex: 0,
|
|
2028
|
+
events: [, , ,]
|
|
2029
|
+
};
|
|
2030
|
+
}
|
|
2031
|
+
_createHeaderEvent(t, e, r) {
|
|
2032
|
+
return {
|
|
2033
|
+
render: t,
|
|
2034
|
+
span: e,
|
|
2035
|
+
eventItem: r
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
_getEventSlotId(t) {
|
|
2039
|
+
return this.isEventPerspective ? this._getEventGroupId(t) : t.resourceId;
|
|
2040
|
+
}
|
|
2041
|
+
_getEventGroupId(t) {
|
|
2042
|
+
return t.groupId ? t.groupId.toString() : t.id.toString();
|
|
2043
|
+
}
|
|
2044
|
+
_getEventGroupName(t) {
|
|
2045
|
+
return t.groupName ? t.groupName : t.title;
|
|
2046
|
+
}
|
|
2047
|
+
_generateEventGroups() {
|
|
2048
|
+
let t = [], e = /* @__PURE__ */ new Set();
|
|
2049
|
+
this.events.forEach((r) => {
|
|
2050
|
+
let s = this._getEventGroupId(r), o = this._getEventGroupName(r);
|
|
2051
|
+
e.has(s) || (t.push({
|
|
2052
|
+
id: s,
|
|
2053
|
+
name: o,
|
|
2054
|
+
state: r
|
|
2055
|
+
}), e.add(s));
|
|
2056
|
+
}), this.eventGroups = t;
|
|
2057
|
+
}
|
|
2058
|
+
_createInitRenderData(t, e, r, s) {
|
|
2059
|
+
let o = t ? e : r, i = [], a = /* @__PURE__ */ new Map();
|
|
2060
|
+
o.forEach((f) => {
|
|
2061
|
+
let m = s.map((v) => this._createInitHeaderEvents(v)), E = {
|
|
2062
|
+
slotId: f.id,
|
|
2063
|
+
slotName: f.name,
|
|
2064
|
+
parentId: f.parentId,
|
|
2065
|
+
groupOnly: f.groupOnly,
|
|
2066
|
+
hasSummary: !1,
|
|
2067
|
+
rowMaxCount: 0,
|
|
2068
|
+
rowHeight: this.config.nonAgendaSlotMinHeight !== 0 ? this.config.nonAgendaSlotMinHeight : this.config.eventItemLineHeight + 2,
|
|
2069
|
+
headerItems: m,
|
|
2070
|
+
indent: 0,
|
|
2071
|
+
hasChildren: !1,
|
|
2072
|
+
expanded: !0,
|
|
2073
|
+
render: !0
|
|
2074
|
+
}, C = f.id, R;
|
|
2075
|
+
a.has(C) ? (R = a.get(C), R.data = E) : (R = {
|
|
2076
|
+
data: E,
|
|
2077
|
+
children: []
|
|
2078
|
+
}, a.set(C, R));
|
|
2079
|
+
let x = f.parentId;
|
|
2080
|
+
if (!x || x === C)
|
|
2081
|
+
i.push(R);
|
|
2082
|
+
else {
|
|
2083
|
+
let v;
|
|
2084
|
+
a.has(x) ? v = a.get(x) : (v = {
|
|
2085
|
+
data: void 0,
|
|
2086
|
+
children: []
|
|
2087
|
+
}, a.set(x, v)), v.children.push(R);
|
|
2088
|
+
}
|
|
2089
|
+
});
|
|
2090
|
+
let d = [], c;
|
|
2091
|
+
for (c = i.length - 1; c >= 0; c--)
|
|
2092
|
+
d.push(i[c]);
|
|
2093
|
+
let h = [], p;
|
|
2094
|
+
for (; d.length > 0; )
|
|
2095
|
+
for (p = d.pop(), p.data.indent > 0 && (p.data.render = this.config.defaultExpanded), p.children.length > 0 && (p.data.hasChildren = !0, p.data.expanded = this.config.defaultExpanded), h.push(p.data), c = p.children.length - 1; c >= 0; c--)
|
|
2096
|
+
p.children[c].data.indent = p.data.indent + 1, d.push(p.children[c]);
|
|
2097
|
+
return h;
|
|
2098
|
+
}
|
|
2099
|
+
_getSpan(t, e, r) {
|
|
2100
|
+
if (this.showAgenda)
|
|
2101
|
+
return 1;
|
|
2102
|
+
let s = this.localeMoment(t), o = this.localeMoment(e), i = 0;
|
|
2103
|
+
for (let a of r) {
|
|
2104
|
+
let d = this.localeMoment(a.time), c = this.cellUnit === X.Hour ? this.localeMoment(a.time).add(this.config.minuteStep, "minutes") : this.localeMoment(a.time).add(1, "days");
|
|
2105
|
+
d < o && c > s && i++;
|
|
2106
|
+
}
|
|
2107
|
+
return i;
|
|
2108
|
+
}
|
|
2109
|
+
_validateResource(t) {
|
|
2110
|
+
if (Object.prototype.toString.call(t) !== "[object Array]")
|
|
2111
|
+
throw new Error("Resources should be Array object");
|
|
2112
|
+
t.forEach((e, r) => {
|
|
2113
|
+
if (e == null)
|
|
2114
|
+
throw console.error(`Resource undefined: ${r}`), new Error(`Resource undefined: ${r}`);
|
|
2115
|
+
if (e.id == null || e.name == null)
|
|
2116
|
+
throw console.error("Resource property missed", r, e), new Error(`Resource property undefined: ${r}`);
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
_validateEventGroups(t) {
|
|
2120
|
+
if (Object.prototype.toString.call(t) !== "[object Array]")
|
|
2121
|
+
throw new Error("Event groups should be Array object");
|
|
2122
|
+
t.forEach((e, r) => {
|
|
2123
|
+
if (e == null)
|
|
2124
|
+
throw console.error(`Event group undefined: ${r}`), new Error(`Event group undefined: ${r}`);
|
|
2125
|
+
if (e.id == null || e.name == null)
|
|
2126
|
+
throw console.error("Event group property missed", r, e), new Error(`Event group property undefined: ${r}`);
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
_validateEvents(t) {
|
|
2130
|
+
if (Object.prototype.toString.call(t) !== "[object Array]")
|
|
2131
|
+
throw new Error("Events should be Array object");
|
|
2132
|
+
t.forEach((e, r) => {
|
|
2133
|
+
if (e == null)
|
|
2134
|
+
throw console.error(`Event undefined: ${r}`), new Error(`Event undefined: ${r}`);
|
|
2135
|
+
if (e.id == null || e.resourceId == null || e.title == null || e.start == null || e.end == null)
|
|
2136
|
+
throw console.error("Event property missed", r, e), new Error(`Event property undefined: ${r}`);
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
_validateMinuteStep(t) {
|
|
2140
|
+
if (60 % t !== 0)
|
|
2141
|
+
throw console.error("Minute step is not set properly - 60 minutes must be divisible without remainder by this number"), new Error("Minute step is not set properly - 60 minutes must be divisible without remainder by this number");
|
|
2142
|
+
}
|
|
2143
|
+
_compare(t, e) {
|
|
2144
|
+
let r = this.localeMoment(t.start), s = this.localeMoment(e.start);
|
|
2145
|
+
if (r !== s)
|
|
2146
|
+
return r < s ? -1 : 1;
|
|
2147
|
+
let o = this.localeMoment(t.end), i = this.localeMoment(e.end);
|
|
2148
|
+
return o !== i ? o < i ? -1 : 1 : t.id < e.id ? -1 : 1;
|
|
2149
|
+
}
|
|
2150
|
+
_createRenderData() {
|
|
2151
|
+
let t = this._createInitRenderData(this.isEventPerspective, this.eventGroups, this.resources, this.headers), e = this.getCellMaxEvents();
|
|
2152
|
+
const r = 30;
|
|
2153
|
+
this.events.forEach((s) => {
|
|
2154
|
+
let o = t.filter((i) => i.slotId === this._getEventSlotId(s));
|
|
2155
|
+
if (o.length > 0) {
|
|
2156
|
+
let i = o[0], a = this._getSpan(s.start, s.end, this.headers), d = this.localeMoment(s.start), c = this.localeMoment(s.end), h = -1;
|
|
2157
|
+
i.headerItems.forEach((p, f) => {
|
|
2158
|
+
let m = this.localeMoment(p.start);
|
|
2159
|
+
if (this.localeMoment(p.end) > d && m < c) {
|
|
2160
|
+
if (p.count = p.count + 1, p.count > i.rowMaxCount) {
|
|
2161
|
+
i.rowMaxCount = p.count;
|
|
2162
|
+
let x = (e <= r && i.rowMaxCount > e ? e : i.rowMaxCount) * this.config.eventItemLineHeight + (this.config.creatable && this.config.checkConflict === !1 ? 20 : 2);
|
|
2163
|
+
x > i.rowHeight && (i.rowHeight = x);
|
|
2164
|
+
}
|
|
2165
|
+
if (h === -1) {
|
|
2166
|
+
let R = 0;
|
|
2167
|
+
for (; p.events[R] !== void 0; )
|
|
2168
|
+
R++;
|
|
2169
|
+
h = R;
|
|
2170
|
+
}
|
|
2171
|
+
let C = m <= d || f === 0;
|
|
2172
|
+
if (C === !1) {
|
|
2173
|
+
let R = i.headerItems[f - 1], x = this.localeMoment(R.start);
|
|
2174
|
+
(this.localeMoment(R.end) <= d || x >= c) && (C = !0);
|
|
2175
|
+
}
|
|
2176
|
+
p.events[h] = this._createHeaderEvent(C, a, s);
|
|
2177
|
+
}
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
}), (e <= r || this.behaviors.getSummaryFunc !== void 0) && t.forEach((s) => {
|
|
2181
|
+
let o = !1;
|
|
2182
|
+
if (s.headerItems.forEach((i) => {
|
|
2183
|
+
if (e <= r) {
|
|
2184
|
+
let a = 0, d = 0, c = 0;
|
|
2185
|
+
for (; c < e - 1; )
|
|
2186
|
+
i.events[c] !== void 0 && (a++, d = c + 1), c++;
|
|
2187
|
+
i.events[c] !== void 0 ? a + 1 < i.count && (i.addMore = i.count - a, i.addMoreIndex = d) : a < i.count && (i.addMore = i.count - a, i.addMoreIndex = d);
|
|
2188
|
+
}
|
|
2189
|
+
if (this.behaviors.getSummaryFunc !== void 0) {
|
|
2190
|
+
let a = [];
|
|
2191
|
+
i.events.forEach((d) => {
|
|
2192
|
+
d && d.eventItem && a.push(d.eventItem);
|
|
2193
|
+
}), i.summary = this.behaviors.getSummaryFunc(this, a, s.slotId, s.slotName, i.start, i.end), i.summary && i.summary.text != null && (o = !0);
|
|
2194
|
+
}
|
|
2195
|
+
}), s.hasSummary = o, o) {
|
|
2196
|
+
let a = ((e <= r && s.rowMaxCount > e ? e : s.rowMaxCount) + 1) * this.config.eventItemLineHeight + (this.config.creatable && this.config.checkConflict === !1 ? 20 : 2);
|
|
2197
|
+
a > s.rowHeight && (s.rowHeight = a);
|
|
2198
|
+
}
|
|
2199
|
+
}), this.renderData = t;
|
|
2200
|
+
}
|
|
2201
|
+
_startResizing() {
|
|
2202
|
+
this.resizing = !0;
|
|
2203
|
+
}
|
|
2204
|
+
_stopResizing() {
|
|
2205
|
+
this.resizing = !1;
|
|
2206
|
+
}
|
|
2207
|
+
_isResizing() {
|
|
2208
|
+
return this.resizing;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
const yr = {
|
|
2212
|
+
resources: [
|
|
2213
|
+
{
|
|
2214
|
+
id: "r0",
|
|
2215
|
+
name: "Resource0",
|
|
2216
|
+
groupOnly: !0
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
id: "r1",
|
|
2220
|
+
name: "Resource1",
|
|
2221
|
+
parentId: "r0"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
id: "r2",
|
|
2225
|
+
name: "Resource2",
|
|
2226
|
+
parentId: "r3"
|
|
2227
|
+
},
|
|
2228
|
+
{
|
|
2229
|
+
id: "r3",
|
|
2230
|
+
name: "Resource3",
|
|
2231
|
+
parentId: "r1"
|
|
2232
|
+
},
|
|
2233
|
+
{
|
|
2234
|
+
id: "r4",
|
|
2235
|
+
name: "Resource4"
|
|
2236
|
+
},
|
|
2237
|
+
{
|
|
2238
|
+
id: "r5",
|
|
2239
|
+
name: "Resource5"
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
id: "r6",
|
|
2243
|
+
name: "Resource6"
|
|
2244
|
+
},
|
|
2245
|
+
{
|
|
2246
|
+
id: "r7",
|
|
2247
|
+
name: "Resource7Resource7Resource7Resource7Resource7"
|
|
2248
|
+
}
|
|
2249
|
+
],
|
|
2250
|
+
events: [
|
|
2251
|
+
{
|
|
2252
|
+
id: 1,
|
|
2253
|
+
start: "2022-12-18 09:30:00",
|
|
2254
|
+
end: "2022-12-19 23:30:00",
|
|
2255
|
+
resourceId: "r1",
|
|
2256
|
+
title: "I am finished",
|
|
2257
|
+
bgColor: "#D9D9D9",
|
|
2258
|
+
showPopover: !1
|
|
2259
|
+
},
|
|
2260
|
+
{
|
|
2261
|
+
id: 2,
|
|
2262
|
+
start: "2022-12-18 12:30:00",
|
|
2263
|
+
end: "2022-12-26 23:30:00",
|
|
2264
|
+
resourceId: "r2",
|
|
2265
|
+
title: "I am not resizable",
|
|
2266
|
+
resizable: !1
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
id: 3,
|
|
2270
|
+
start: "2022-12-19 12:30:00",
|
|
2271
|
+
end: "2022-12-20 23:30:00",
|
|
2272
|
+
resourceId: "r3",
|
|
2273
|
+
title: "I am not movable",
|
|
2274
|
+
movable: !1
|
|
2275
|
+
},
|
|
2276
|
+
{
|
|
2277
|
+
id: 4,
|
|
2278
|
+
start: "2022-12-19 14:30:00",
|
|
2279
|
+
end: "2022-12-20 23:30:00",
|
|
2280
|
+
resourceId: "r4",
|
|
2281
|
+
title: "I am not start-resizable",
|
|
2282
|
+
startResizable: !1
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
id: 5,
|
|
2286
|
+
start: "2022-12-19 15:30:00",
|
|
2287
|
+
end: "2022-12-20 23:30:00",
|
|
2288
|
+
resourceId: "r5",
|
|
2289
|
+
title: "I am not end-resizable",
|
|
2290
|
+
endResizable: !1
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
id: 6,
|
|
2294
|
+
start: "2022-12-19 15:35:00",
|
|
2295
|
+
end: "2022-12-19 23:30:00",
|
|
2296
|
+
resourceId: "r6",
|
|
2297
|
+
title: "I am normal"
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
id: 7,
|
|
2301
|
+
start: "2022-12-19 15:40:00",
|
|
2302
|
+
end: "2022-12-20 23:30:00",
|
|
2303
|
+
resourceId: "r7",
|
|
2304
|
+
title: "I am exceptional",
|
|
2305
|
+
bgColor: "#FA9E95"
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
id: 8,
|
|
2309
|
+
start: "2022-12-19 15:50:00",
|
|
2310
|
+
end: "2022-12-19 23:30:00",
|
|
2311
|
+
resourceId: "r1",
|
|
2312
|
+
title: "I am locked",
|
|
2313
|
+
movable: !1,
|
|
2314
|
+
resizable: !1,
|
|
2315
|
+
bgColor: "red"
|
|
2316
|
+
},
|
|
2317
|
+
{
|
|
2318
|
+
id: 9,
|
|
2319
|
+
start: "2022-12-19 16:30:00",
|
|
2320
|
+
end: "2022-12-27 23:30:00",
|
|
2321
|
+
resourceId: "r1",
|
|
2322
|
+
title: "R1 has many tasks 1"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
id: 10,
|
|
2326
|
+
start: "2022-12-19 17:30:00",
|
|
2327
|
+
end: "2022-12-19 23:30:00",
|
|
2328
|
+
resourceId: "r1",
|
|
2329
|
+
title: "R1 has recurring tasks every week on Tuesday, Friday",
|
|
2330
|
+
bgColor: "#f759ab"
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
id: 11,
|
|
2334
|
+
start: "2022-12-19 18:30:00",
|
|
2335
|
+
end: "2022-12-20 23:30:00",
|
|
2336
|
+
resourceId: "r1",
|
|
2337
|
+
title: "R1 has many tasks 3"
|
|
2338
|
+
},
|
|
2339
|
+
{
|
|
2340
|
+
id: 12,
|
|
2341
|
+
start: "2022-12-20 18:30:00",
|
|
2342
|
+
end: "2022-12-20 23:30:00",
|
|
2343
|
+
resourceId: "r1",
|
|
2344
|
+
title: "R1 has many tasks 4"
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
id: 13,
|
|
2348
|
+
start: "2022-12-21 18:30:00",
|
|
2349
|
+
end: "2022-12-24 23:30:00",
|
|
2350
|
+
resourceId: "r1",
|
|
2351
|
+
title: "R1 has many tasks 5"
|
|
2352
|
+
},
|
|
2353
|
+
{
|
|
2354
|
+
id: 14,
|
|
2355
|
+
start: "2022-12-23 18:30:00",
|
|
2356
|
+
end: "2022-12-27 23:30:00",
|
|
2357
|
+
resourceId: "r1",
|
|
2358
|
+
title: "R1 has many tasks 6"
|
|
2359
|
+
}
|
|
2360
|
+
],
|
|
2361
|
+
eventsForTaskView: [
|
|
2362
|
+
{
|
|
2363
|
+
id: 1,
|
|
2364
|
+
start: "2022-12-18 09:30:00",
|
|
2365
|
+
end: "2022-12-18 23:30:00",
|
|
2366
|
+
resourceId: "r1",
|
|
2367
|
+
title: "I am finished",
|
|
2368
|
+
bgColor: "#D9D9D9",
|
|
2369
|
+
groupId: 1,
|
|
2370
|
+
groupName: "Task1"
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
id: 2,
|
|
2374
|
+
start: "2022-12-18 12:30:00",
|
|
2375
|
+
end: "2022-12-26 23:30:00",
|
|
2376
|
+
resourceId: "r2",
|
|
2377
|
+
title: "I am not resizable",
|
|
2378
|
+
resizable: !1,
|
|
2379
|
+
groupId: 2,
|
|
2380
|
+
groupName: "Task2"
|
|
2381
|
+
},
|
|
2382
|
+
{
|
|
2383
|
+
id: 3,
|
|
2384
|
+
start: "2022-12-19 12:30:00",
|
|
2385
|
+
end: "2022-12-20 23:30:00",
|
|
2386
|
+
resourceId: "r3",
|
|
2387
|
+
title: "I am not movable",
|
|
2388
|
+
movable: !1,
|
|
2389
|
+
groupId: 3,
|
|
2390
|
+
groupName: "Task3"
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
id: 7,
|
|
2394
|
+
start: "2022-12-19 15:40:00",
|
|
2395
|
+
end: "2022-12-20 23:30:00",
|
|
2396
|
+
resourceId: "r7",
|
|
2397
|
+
title: "I am exceptional",
|
|
2398
|
+
bgColor: "#FA9E95",
|
|
2399
|
+
groupId: 4,
|
|
2400
|
+
groupName: "Task4"
|
|
2401
|
+
},
|
|
2402
|
+
{
|
|
2403
|
+
id: 4,
|
|
2404
|
+
start: "2022-12-20 14:30:00",
|
|
2405
|
+
end: "2022-12-21 23:30:00",
|
|
2406
|
+
resourceId: "r4",
|
|
2407
|
+
title: "I am not start-resizable",
|
|
2408
|
+
startResizable: !1,
|
|
2409
|
+
groupId: 1,
|
|
2410
|
+
groupName: "Task1"
|
|
2411
|
+
},
|
|
2412
|
+
{
|
|
2413
|
+
id: 5,
|
|
2414
|
+
start: "2022-12-21 15:30:00",
|
|
2415
|
+
end: "2022-12-22 23:30:00",
|
|
2416
|
+
resourceId: "r5",
|
|
2417
|
+
title: "I am not end-resizable",
|
|
2418
|
+
endResizable: !1,
|
|
2419
|
+
groupId: 3,
|
|
2420
|
+
groupName: "Task3"
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
id: 9,
|
|
2424
|
+
start: "2022-12-21 16:30:00",
|
|
2425
|
+
end: "2022-12-21 23:30:00",
|
|
2426
|
+
resourceId: "r1",
|
|
2427
|
+
title: "R1 has many tasks",
|
|
2428
|
+
groupId: 4,
|
|
2429
|
+
groupName: "Task4"
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
id: 6,
|
|
2433
|
+
start: "2022-12-22 15:35:00",
|
|
2434
|
+
end: "2022-12-23 23:30:00",
|
|
2435
|
+
resourceId: "r6",
|
|
2436
|
+
title: "I am normal",
|
|
2437
|
+
groupId: 1,
|
|
2438
|
+
groupName: "Task1"
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
id: 8,
|
|
2442
|
+
start: "2022-12-25 15:50:00",
|
|
2443
|
+
end: "2022-12-26 23:30:00",
|
|
2444
|
+
resourceId: "r1",
|
|
2445
|
+
title: "I am locked",
|
|
2446
|
+
movable: !1,
|
|
2447
|
+
resizable: !1,
|
|
2448
|
+
bgColor: "red",
|
|
2449
|
+
groupId: 1,
|
|
2450
|
+
groupName: "Task1"
|
|
2451
|
+
},
|
|
2452
|
+
{
|
|
2453
|
+
id: 10,
|
|
2454
|
+
start: "2022-12-26 18:30:00",
|
|
2455
|
+
end: "2022-12-26 23:30:00",
|
|
2456
|
+
resourceId: "r2",
|
|
2457
|
+
title: "R2 has many tasks",
|
|
2458
|
+
groupId: 4,
|
|
2459
|
+
groupName: "Task4"
|
|
2460
|
+
},
|
|
2461
|
+
{
|
|
2462
|
+
id: 11,
|
|
2463
|
+
start: "2022-12-27 18:30:00",
|
|
2464
|
+
end: "2022-12-27 23:30:00",
|
|
2465
|
+
resourceId: "r14",
|
|
2466
|
+
title: "R4 has many tasks",
|
|
2467
|
+
groupId: 4,
|
|
2468
|
+
groupName: "Task4"
|
|
2469
|
+
},
|
|
2470
|
+
{
|
|
2471
|
+
id: 12,
|
|
2472
|
+
start: "2022-12-28 18:30:00",
|
|
2473
|
+
end: "2022-12-28 23:30:00",
|
|
2474
|
+
resourceId: "r6",
|
|
2475
|
+
title: "R6 has many tasks",
|
|
2476
|
+
groupId: 3,
|
|
2477
|
+
groupName: "Task3"
|
|
2478
|
+
}
|
|
2479
|
+
],
|
|
2480
|
+
eventsForCustomEventStyle: [
|
|
2481
|
+
{
|
|
2482
|
+
id: 1,
|
|
2483
|
+
start: "2022-12-18 09:30:00",
|
|
2484
|
+
end: "2022-12-19 23:30:00",
|
|
2485
|
+
resourceId: "r1",
|
|
2486
|
+
title: "I am finished",
|
|
2487
|
+
bgColor: "#D9D9D9",
|
|
2488
|
+
type: 1
|
|
2489
|
+
},
|
|
2490
|
+
{
|
|
2491
|
+
id: 2,
|
|
2492
|
+
start: "2022-12-18 12:30:00",
|
|
2493
|
+
end: "2022-12-26 23:30:00",
|
|
2494
|
+
resourceId: "r2",
|
|
2495
|
+
title: "I am not resizable",
|
|
2496
|
+
resizable: !1,
|
|
2497
|
+
type: 2
|
|
2498
|
+
},
|
|
2499
|
+
{
|
|
2500
|
+
id: 3,
|
|
2501
|
+
start: "2022-12-19 12:30:00",
|
|
2502
|
+
end: "2022-12-20 23:30:00",
|
|
2503
|
+
resourceId: "r3",
|
|
2504
|
+
title: "I am not movable",
|
|
2505
|
+
movable: !1,
|
|
2506
|
+
type: 3
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
id: 4,
|
|
2510
|
+
start: "2022-12-19 14:30:00",
|
|
2511
|
+
end: "2022-12-20 23:30:00",
|
|
2512
|
+
resourceId: "r4",
|
|
2513
|
+
title: "I am not start-resizable",
|
|
2514
|
+
startResizable: !1,
|
|
2515
|
+
type: 1
|
|
2516
|
+
},
|
|
2517
|
+
{
|
|
2518
|
+
id: 5,
|
|
2519
|
+
start: "2022-12-19 15:30:00",
|
|
2520
|
+
end: "2022-12-20 23:30:00",
|
|
2521
|
+
resourceId: "r5",
|
|
2522
|
+
title: "I am not end-resizable",
|
|
2523
|
+
endResizable: !1,
|
|
2524
|
+
type: 2
|
|
2525
|
+
},
|
|
2526
|
+
{
|
|
2527
|
+
id: 6,
|
|
2528
|
+
start: "2022-12-19 15:35:00",
|
|
2529
|
+
end: "2022-12-19 23:30:00",
|
|
2530
|
+
resourceId: "r6",
|
|
2531
|
+
title: "I am normal",
|
|
2532
|
+
type: 3
|
|
2533
|
+
},
|
|
2534
|
+
{
|
|
2535
|
+
id: 7,
|
|
2536
|
+
start: "2022-12-19 15:40:00",
|
|
2537
|
+
end: "2022-12-20 23:30:00",
|
|
2538
|
+
resourceId: "r7",
|
|
2539
|
+
title: "I am exceptional",
|
|
2540
|
+
bgColor: "#FA9E95",
|
|
2541
|
+
type: 1
|
|
2542
|
+
},
|
|
2543
|
+
{
|
|
2544
|
+
id: 8,
|
|
2545
|
+
start: "2022-12-19 15:50:00",
|
|
2546
|
+
end: "2022-12-19 23:30:00",
|
|
2547
|
+
resourceId: "r1",
|
|
2548
|
+
title: "I am locked",
|
|
2549
|
+
movable: !1,
|
|
2550
|
+
resizable: !1,
|
|
2551
|
+
bgColor: "red",
|
|
2552
|
+
type: 2
|
|
2553
|
+
},
|
|
2554
|
+
{
|
|
2555
|
+
id: 9,
|
|
2556
|
+
start: "2022-12-19 16:30:00",
|
|
2557
|
+
end: "2022-12-27 23:30:00",
|
|
2558
|
+
resourceId: "r1",
|
|
2559
|
+
title: "R1 has many tasks 1",
|
|
2560
|
+
type: 3
|
|
2561
|
+
},
|
|
2562
|
+
{
|
|
2563
|
+
id: 10,
|
|
2564
|
+
start: "2022-12-20 18:30:00",
|
|
2565
|
+
end: "2022-12-20 23:30:00",
|
|
2566
|
+
resourceId: "r1",
|
|
2567
|
+
title: "R1 has many tasks 2",
|
|
2568
|
+
type: 1
|
|
2569
|
+
},
|
|
2570
|
+
{
|
|
2571
|
+
id: 11,
|
|
2572
|
+
start: "2022-12-21 18:30:00",
|
|
2573
|
+
end: "2022-12-22 23:30:00",
|
|
2574
|
+
resourceId: "r1",
|
|
2575
|
+
title: "R1 has many tasks 3",
|
|
2576
|
+
type: 2
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
id: 12,
|
|
2580
|
+
start: "2022-12-23 18:30:00",
|
|
2581
|
+
end: "2022-12-27 23:30:00",
|
|
2582
|
+
resourceId: "r1",
|
|
2583
|
+
title: "R1 has many tasks 4",
|
|
2584
|
+
type: 3
|
|
2585
|
+
}
|
|
2586
|
+
]
|
|
2587
|
+
};
|
|
2588
|
+
const lr = it.Button, dr = it.Group;
|
|
2589
|
+
class cr extends _e {
|
|
2590
|
+
constructor(e) {
|
|
2591
|
+
super(e);
|
|
2592
|
+
M(this, "onWindowResize", (e) => {
|
|
2593
|
+
const { schedulerData: r } = this.props;
|
|
2594
|
+
r._setDocumentWidth(document.documentElement.clientWidth), this.setState({
|
|
2595
|
+
documentWidth: document.documentElement.clientWidth,
|
|
2596
|
+
documentHeight: document.documentElement.clientHeight
|
|
2597
|
+
});
|
|
2598
|
+
});
|
|
2599
|
+
M(this, "resolveScrollbarSize", () => {
|
|
2600
|
+
const { schedulerData: e } = this.props;
|
|
2601
|
+
let r = 17, s = 17, o = 17, i = 17, a = e.getSchedulerContentDesiredHeight();
|
|
2602
|
+
this.schedulerContent && (r = this.schedulerContent.offsetHeight - this.schedulerContent.clientHeight, s = this.schedulerContent.offsetWidth - this.schedulerContent.clientWidth), this.schedulerResource && (o = this.schedulerResource.offsetHeight - this.schedulerResource.clientHeight, i = this.schedulerResource.offsetWidth - this.schedulerResource.clientWidth), this.schedulerContentBgTable && this.schedulerContentBgTable.offsetHeight && (a = this.schedulerContentBgTable.offsetHeight);
|
|
2603
|
+
let d = {}, c = !1;
|
|
2604
|
+
r != this.state.contentScrollbarHeight && (d = {
|
|
2605
|
+
...d,
|
|
2606
|
+
contentScrollbarHeight: r
|
|
2607
|
+
}, c = !0), s != this.state.contentScrollbarWidth && (d = { ...d, contentScrollbarWidth: s }, c = !0), a != this.state.contentHeight && (d = { ...d, contentHeight: a }, c = !0), o != this.state.resourceScrollbarHeight && (d = {
|
|
2608
|
+
...d,
|
|
2609
|
+
resourceScrollbarHeight: o
|
|
2610
|
+
}, c = !0), i != this.state.resourceScrollbarWidth && (d = {
|
|
2611
|
+
...d,
|
|
2612
|
+
resourceScrollbarWidth: i
|
|
2613
|
+
}, c = !0), c && this.setState(d);
|
|
2614
|
+
});
|
|
2615
|
+
M(this, "schedulerHeadRef", (e) => {
|
|
2616
|
+
this.schedulerHead = e;
|
|
2617
|
+
});
|
|
2618
|
+
M(this, "onSchedulerHeadMouseOver", () => {
|
|
2619
|
+
this.currentArea = 2;
|
|
2620
|
+
});
|
|
2621
|
+
M(this, "onSchedulerHeadMouseOut", () => {
|
|
2622
|
+
this.currentArea = -1;
|
|
2623
|
+
});
|
|
2624
|
+
M(this, "onSchedulerHeadScroll", (e, r) => {
|
|
2625
|
+
(this.currentArea === 2 || this.currentArea === -1) && this.schedulerContent.scrollLeft != this.schedulerHead.scrollLeft && (this.schedulerContent.scrollLeft = this.schedulerHead.scrollLeft);
|
|
2626
|
+
});
|
|
2627
|
+
M(this, "schedulerResourceRef", (e) => {
|
|
2628
|
+
this.schedulerResource = e;
|
|
2629
|
+
});
|
|
2630
|
+
M(this, "onSchedulerResourceMouseOver", () => {
|
|
2631
|
+
this.currentArea = 1;
|
|
2632
|
+
});
|
|
2633
|
+
M(this, "onSchedulerResourceMouseOut", () => {
|
|
2634
|
+
this.currentArea = -1;
|
|
2635
|
+
});
|
|
2636
|
+
M(this, "onSchedulerResourceScroll", (e, r) => {
|
|
2637
|
+
(this.currentArea === 1 || this.currentArea === -1) && this.schedulerContent.scrollTop != this.schedulerResource.scrollTop && (this.schedulerContent.scrollTop = this.schedulerResource.scrollTop);
|
|
2638
|
+
});
|
|
2639
|
+
M(this, "schedulerContentRef", (e) => {
|
|
2640
|
+
this.schedulerContent = e;
|
|
2641
|
+
});
|
|
2642
|
+
M(this, "schedulerContentBgTableRef", (e) => {
|
|
2643
|
+
this.schedulerContentBgTable = e;
|
|
2644
|
+
});
|
|
2645
|
+
M(this, "onSchedulerContentMouseOver", () => {
|
|
2646
|
+
this.currentArea = 0;
|
|
2647
|
+
});
|
|
2648
|
+
M(this, "onSchedulerContentMouseOut", () => {
|
|
2649
|
+
this.currentArea = -1;
|
|
2650
|
+
});
|
|
2651
|
+
M(this, "onSchedulerContentScroll", (e, r) => {
|
|
2652
|
+
(this.currentArea === 0 || this.currentArea === -1) && (this.schedulerHead.scrollLeft != this.schedulerContent.scrollLeft && (this.schedulerHead.scrollLeft = this.schedulerContent.scrollLeft), this.schedulerResource.scrollTop != this.schedulerContent.scrollTop && (this.schedulerResource.scrollTop = this.schedulerContent.scrollTop));
|
|
2653
|
+
const { schedulerData: s, onScrollLeft: o, onScrollRight: i, onScrollTop: a, onScrollBottom: d } = this.props, { scrollLeft: c, scrollTop: h } = this.state;
|
|
2654
|
+
this.schedulerContent.scrollLeft !== c ? (this.schedulerContent.scrollLeft === 0 && o != null && o(s, this.schedulerContent, this.schedulerContent.scrollWidth - this.schedulerContent.clientWidth), this.schedulerContent.scrollLeft === this.schedulerContent.scrollWidth - this.schedulerContent.clientWidth && i != null && i(s, this.schedulerContent, this.schedulerContent.scrollWidth - this.schedulerContent.clientWidth)) : this.schedulerContent.scrollTop !== h && (this.schedulerContent.scrollTop === 0 && a != null && a(s, this.schedulerContent, this.schedulerContent.scrollHeight - this.schedulerContent.clientHeight), this.schedulerContent.scrollTop === this.schedulerContent.scrollHeight - this.schedulerContent.clientHeight && d != null && d(s, this.schedulerContent, this.schedulerContent.scrollHeight - this.schedulerContent.clientHeight)), this.setState({
|
|
2655
|
+
scrollLeft: this.schedulerContent.scrollLeft,
|
|
2656
|
+
scrollTop: this.schedulerContent.scrollTop
|
|
2657
|
+
});
|
|
2658
|
+
});
|
|
2659
|
+
M(this, "onViewChange", (e) => {
|
|
2660
|
+
const { onViewChange: r, schedulerData: s } = this.props;
|
|
2661
|
+
let o = parseInt(e.target.value.charAt(0)), i = e.target.value.charAt(1) === "1", a = e.target.value.charAt(2) === "1";
|
|
2662
|
+
r(s, {
|
|
2663
|
+
viewType: o,
|
|
2664
|
+
showAgenda: i,
|
|
2665
|
+
isEventPerspective: a
|
|
2666
|
+
});
|
|
2667
|
+
});
|
|
2668
|
+
M(this, "goNext", () => {
|
|
2669
|
+
const { nextClick: e, schedulerData: r } = this.props;
|
|
2670
|
+
e(r);
|
|
2671
|
+
});
|
|
2672
|
+
M(this, "goBack", () => {
|
|
2673
|
+
const { prevClick: e, schedulerData: r } = this.props;
|
|
2674
|
+
e(r);
|
|
2675
|
+
});
|
|
2676
|
+
M(this, "handleVisibleChange", (e) => {
|
|
2677
|
+
this.setState({ visible: e });
|
|
2678
|
+
});
|
|
2679
|
+
M(this, "onSelect", (e) => {
|
|
2680
|
+
this.setState({
|
|
2681
|
+
visible: !1
|
|
2682
|
+
});
|
|
2683
|
+
const { onSelectDate: r, schedulerData: s } = this.props;
|
|
2684
|
+
r(s, e);
|
|
2685
|
+
});
|
|
2686
|
+
const { schedulerData: r, dndSources: s } = e;
|
|
2687
|
+
let o = [];
|
|
2688
|
+
o.push(new ot((a) => a.eventItem, Ne)), s != null && s.length > 0 && (o = [...o, ...s]);
|
|
2689
|
+
let i = new rr(o, ft);
|
|
2690
|
+
this.currentArea = -1, r._setDocumentWidth(document.documentElement.clientWidth), this.state = {
|
|
2691
|
+
visible: !1,
|
|
2692
|
+
dndContext: i,
|
|
2693
|
+
contentHeight: r.getSchedulerContentDesiredHeight(),
|
|
2694
|
+
contentScrollbarHeight: 17,
|
|
2695
|
+
contentScrollbarWidth: 17,
|
|
2696
|
+
resourceScrollbarHeight: 17,
|
|
2697
|
+
resourceScrollbarWidth: 17,
|
|
2698
|
+
scrollLeft: 0,
|
|
2699
|
+
scrollTop: 0,
|
|
2700
|
+
documentWidth: document.documentElement.clientWidth,
|
|
2701
|
+
documentHeight: document.documentElement.clientHeight
|
|
2702
|
+
}, r.isSchedulerResponsive() && (window.onresize = this.onWindowResize);
|
|
2703
|
+
}
|
|
2704
|
+
componentDidMount(e, r) {
|
|
2705
|
+
this.resolveScrollbarSize();
|
|
2706
|
+
}
|
|
2707
|
+
componentDidUpdate(e, r) {
|
|
2708
|
+
this.resolveScrollbarSize();
|
|
2709
|
+
const { schedulerData: s } = this.props, { localeMoment: o, behaviors: i } = s;
|
|
2710
|
+
if (s.getScrollToSpecialMoment() && i.getScrollSpecialMomentFunc && this.schedulerContent && this.schedulerContent.scrollWidth > this.schedulerContent.clientWidth) {
|
|
2711
|
+
let a = o(s.startDate).startOf("day"), d = o(s.endDate).endOf("day"), c = i.getScrollSpecialMomentFunc(s, a, d);
|
|
2712
|
+
if (c >= a && c <= d) {
|
|
2713
|
+
let h = 0;
|
|
2714
|
+
s.headers.forEach((p) => {
|
|
2715
|
+
let f = o(p.time);
|
|
2716
|
+
c >= f && h++;
|
|
2717
|
+
}), this.schedulerContent.scrollLeft = (h - 1) * s.getContentCellWidth(), s.setScrollToSpecialMoment(!1);
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
render() {
|
|
2722
|
+
const { schedulerData: e, leftCustomHeader: r, rightCustomHeader: s } = this.props, { renderData: o, viewType: i, showAgenda: a, isEventPerspective: d, config: c } = e, h = e.getSchedulerWidth(), p = c.calendarPopoverEnabled;
|
|
2723
|
+
let f = e.getDateLabel(), m = `${i}${a ? 1 : 0}${d ? 1 : 0}`, E = c.views.map((v) => /* @__PURE__ */ l.jsx(lr, { value: `${v.viewType}${v.showAgenda ? 1 : 0}${v.isEventPerspective ? 1 : 0}`, children: /* @__PURE__ */ l.jsx("span", { style: { margin: "0px 8px" }, children: v.viewName }) }, `${v.viewType}${v.showAgenda ? 1 : 0}${v.isEventPerspective ? 1 : 0}`)), C = /* @__PURE__ */ l.jsx("tr", {});
|
|
2724
|
+
if (a)
|
|
2725
|
+
C = /* @__PURE__ */ l.jsx(pt, { ...this.props });
|
|
2726
|
+
else {
|
|
2727
|
+
let v = e.getResourceTableWidth(), T = h - v + 1, w = e.getContentTableWidth() - 1, j = this.state.dndContext.getDropTarget(), k = this.state.dndContext.getDndSource(), P = o.filter((B) => B.render).map((B) => /* @__PURE__ */ he(j, { ...this.props, key: B.slotId, resourceEvents: B, dndSource: k })), S = this.state.contentScrollbarHeight, W = this.state.contentScrollbarWidth, q = this.state.resourceScrollbarHeight, Q = this.state.resourceScrollbarWidth, V = this.state.contentHeight, K = q === 0 ? S : 0, A = {
|
|
2728
|
+
overflow: "auto",
|
|
2729
|
+
margin: "0px",
|
|
2730
|
+
position: "relative",
|
|
2731
|
+
paddingBottom: S === 0 ? q : 0
|
|
2732
|
+
}, F = {
|
|
2733
|
+
overflowX: "auto",
|
|
2734
|
+
overflowY: "auto",
|
|
2735
|
+
width: v + Q - 2,
|
|
2736
|
+
margin: `0px -${W}px 0px 0px`
|
|
2737
|
+
};
|
|
2738
|
+
c.schedulerMaxHeight > 0 && (A = {
|
|
2739
|
+
...A,
|
|
2740
|
+
maxHeight: c.schedulerMaxHeight - c.tableHeaderHeight
|
|
2741
|
+
}, F = {
|
|
2742
|
+
...F,
|
|
2743
|
+
maxHeight: c.schedulerMaxHeight - c.tableHeaderHeight
|
|
2744
|
+
});
|
|
2745
|
+
let Y = e.isEventPerspective ? c.taskName : c.resourceName;
|
|
2746
|
+
C = /* @__PURE__ */ l.jsxs("tr", { children: [
|
|
2747
|
+
/* @__PURE__ */ l.jsx("td", { style: { width: v, verticalAlign: "top" }, children: /* @__PURE__ */ l.jsxs("div", { className: "resource-view", children: [
|
|
2748
|
+
/* @__PURE__ */ l.jsx(
|
|
2749
|
+
"div",
|
|
2750
|
+
{
|
|
2751
|
+
style: {
|
|
2752
|
+
overflow: "hidden",
|
|
2753
|
+
borderBottom: "1px solid #e9e9e9",
|
|
2754
|
+
height: c.tableHeaderHeight
|
|
2755
|
+
},
|
|
2756
|
+
children: /* @__PURE__ */ l.jsx(
|
|
2757
|
+
"div",
|
|
2758
|
+
{
|
|
2759
|
+
style: {
|
|
2760
|
+
overflowX: "scroll",
|
|
2761
|
+
overflowY: "hidden",
|
|
2762
|
+
margin: `0px 0px -${S}px`
|
|
2763
|
+
},
|
|
2764
|
+
children: /* @__PURE__ */ l.jsx("table", { className: "resource-table", children: /* @__PURE__ */ l.jsx("thead", { children: /* @__PURE__ */ l.jsx("tr", { style: { height: c.tableHeaderHeight }, children: /* @__PURE__ */ l.jsx("th", { className: "header3-text", children: Y }) }) }) })
|
|
2765
|
+
}
|
|
2766
|
+
)
|
|
2767
|
+
}
|
|
2768
|
+
),
|
|
2769
|
+
/* @__PURE__ */ l.jsx(
|
|
2770
|
+
"div",
|
|
2771
|
+
{
|
|
2772
|
+
style: F,
|
|
2773
|
+
ref: this.schedulerResourceRef,
|
|
2774
|
+
onMouseOver: this.onSchedulerResourceMouseOver,
|
|
2775
|
+
onMouseOut: this.onSchedulerResourceMouseOut,
|
|
2776
|
+
onScroll: this.onSchedulerResourceScroll,
|
|
2777
|
+
children: /* @__PURE__ */ l.jsx(at, { ...this.props, contentScrollbarHeight: K })
|
|
2778
|
+
}
|
|
2779
|
+
)
|
|
2780
|
+
] }) }),
|
|
2781
|
+
/* @__PURE__ */ l.jsx("td", { children: /* @__PURE__ */ l.jsxs("div", { className: "scheduler-view", style: { width: T, verticalAlign: "top" }, children: [
|
|
2782
|
+
/* @__PURE__ */ l.jsx(
|
|
2783
|
+
"div",
|
|
2784
|
+
{
|
|
2785
|
+
style: {
|
|
2786
|
+
overflow: "hidden",
|
|
2787
|
+
borderBottom: "1px solid #e9e9e9",
|
|
2788
|
+
height: c.tableHeaderHeight
|
|
2789
|
+
},
|
|
2790
|
+
children: /* @__PURE__ */ l.jsx(
|
|
2791
|
+
"div",
|
|
2792
|
+
{
|
|
2793
|
+
style: {
|
|
2794
|
+
overflowX: "scroll",
|
|
2795
|
+
overflowY: "hidden",
|
|
2796
|
+
margin: `0px 0px -${S}px`
|
|
2797
|
+
},
|
|
2798
|
+
ref: this.schedulerHeadRef,
|
|
2799
|
+
onMouseOver: this.onSchedulerHeadMouseOver,
|
|
2800
|
+
onMouseOut: this.onSchedulerHeadMouseOut,
|
|
2801
|
+
onScroll: this.onSchedulerHeadScroll,
|
|
2802
|
+
children: /* @__PURE__ */ l.jsx(
|
|
2803
|
+
"div",
|
|
2804
|
+
{
|
|
2805
|
+
style: {
|
|
2806
|
+
paddingRight: `${W}px`,
|
|
2807
|
+
width: w + W
|
|
2808
|
+
},
|
|
2809
|
+
children: /* @__PURE__ */ l.jsx("table", { className: "scheduler-bg-table", children: /* @__PURE__ */ l.jsx(lt, { ...this.props }) })
|
|
2810
|
+
}
|
|
2811
|
+
)
|
|
2812
|
+
}
|
|
2813
|
+
)
|
|
2814
|
+
}
|
|
2815
|
+
),
|
|
2816
|
+
/* @__PURE__ */ l.jsx(
|
|
2817
|
+
"div",
|
|
2818
|
+
{
|
|
2819
|
+
style: A,
|
|
2820
|
+
ref: this.schedulerContentRef,
|
|
2821
|
+
onMouseOver: this.onSchedulerContentMouseOver,
|
|
2822
|
+
onMouseOut: this.onSchedulerContentMouseOut,
|
|
2823
|
+
onScroll: this.onSchedulerContentScroll,
|
|
2824
|
+
children: /* @__PURE__ */ l.jsxs("div", { style: { width: w, height: V }, children: [
|
|
2825
|
+
/* @__PURE__ */ l.jsx("div", { className: "scheduler-content", children: /* @__PURE__ */ l.jsx("table", { className: "scheduler-content-table", children: /* @__PURE__ */ l.jsx("tbody", { children: P }) }) }),
|
|
2826
|
+
/* @__PURE__ */ l.jsx("div", { className: "scheduler-bg", children: /* @__PURE__ */ l.jsx("table", { className: "scheduler-bg-table", style: { width: w }, ref: this.schedulerContentBgTableRef, children: /* @__PURE__ */ l.jsx(dt, { ...this.props }) }) })
|
|
2827
|
+
] })
|
|
2828
|
+
}
|
|
2829
|
+
)
|
|
2830
|
+
] }) })
|
|
2831
|
+
] });
|
|
2832
|
+
}
|
|
2833
|
+
let R = /* @__PURE__ */ l.jsx("div", { className: "popover-calendar", children: /* @__PURE__ */ l.jsx(Qt, { fullscreen: !1, onSelect: this.onSelect }) }), x = /* @__PURE__ */ l.jsx("div", {});
|
|
2834
|
+
return c.headerEnabled && (x = /* @__PURE__ */ l.jsxs(
|
|
2835
|
+
"div",
|
|
2836
|
+
{
|
|
2837
|
+
style: {
|
|
2838
|
+
display: "flex",
|
|
2839
|
+
alignItems: "center",
|
|
2840
|
+
justifyContent: "space-between",
|
|
2841
|
+
marginBottom: "24px"
|
|
2842
|
+
},
|
|
2843
|
+
children: [
|
|
2844
|
+
r,
|
|
2845
|
+
/* @__PURE__ */ l.jsx("div", { children: /* @__PURE__ */ l.jsxs("div", { className: "header2-text", children: [
|
|
2846
|
+
/* @__PURE__ */ l.jsx(Xt, { style: { marginRight: "8px" }, className: "icon-nav", onClick: this.goBack }),
|
|
2847
|
+
p ? /* @__PURE__ */ l.jsx(He, { content: R, placement: "bottom", trigger: "click", open: this.state.visible, onOpenChange: this.handleVisibleChange, children: /* @__PURE__ */ l.jsx("span", { className: "header2-text-label", style: { cursor: "pointer" }, children: f }) }) : /* @__PURE__ */ l.jsx("span", { className: "header2-text-label", children: f }),
|
|
2848
|
+
/* @__PURE__ */ l.jsx(Ut, { style: { marginLeft: "8px" }, className: "icon-nav", onClick: this.goNext })
|
|
2849
|
+
] }) }),
|
|
2850
|
+
/* @__PURE__ */ l.jsx("div", { children: /* @__PURE__ */ l.jsxs(dr, { defaultValue: m, size: "default", onChange: this.onViewChange, children: [
|
|
2851
|
+
E,
|
|
2852
|
+
"xx"
|
|
2853
|
+
] }) }),
|
|
2854
|
+
s
|
|
2855
|
+
]
|
|
2856
|
+
}
|
|
2857
|
+
)), /* @__PURE__ */ l.jsx("div", { className: "scheduler-component-module", children: /* @__PURE__ */ l.jsxs("table", { id: "RBS-Scheduler-root", className: "scheduler", style: { width: `${h}px` }, children: [
|
|
2858
|
+
/* @__PURE__ */ l.jsx("thead", { children: /* @__PURE__ */ l.jsx("tr", { children: /* @__PURE__ */ l.jsx("td", { colSpan: "2", children: x }) }) }),
|
|
2859
|
+
/* @__PURE__ */ l.jsx("tbody", { children: C })
|
|
2860
|
+
] }) });
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
M(cr, "propTypes", {
|
|
2864
|
+
schedulerData: u.object.isRequired,
|
|
2865
|
+
prevClick: u.func.isRequired,
|
|
2866
|
+
nextClick: u.func.isRequired,
|
|
2867
|
+
onViewChange: u.func.isRequired,
|
|
2868
|
+
onSelectDate: u.func.isRequired,
|
|
2869
|
+
onSetAddMoreState: u.func,
|
|
2870
|
+
updateEventStart: u.func,
|
|
2871
|
+
updateEventEnd: u.func,
|
|
2872
|
+
moveEvent: u.func,
|
|
2873
|
+
movingEvent: u.func,
|
|
2874
|
+
leftCustomHeader: u.object,
|
|
2875
|
+
rightCustomHeader: u.object,
|
|
2876
|
+
newEvent: u.func,
|
|
2877
|
+
subtitleGetter: u.func,
|
|
2878
|
+
eventItemClick: u.func,
|
|
2879
|
+
viewEventClick: u.func,
|
|
2880
|
+
viewEventText: u.string,
|
|
2881
|
+
viewEvent2Click: u.func,
|
|
2882
|
+
viewEvent2Text: u.string,
|
|
2883
|
+
conflictOccurred: u.func,
|
|
2884
|
+
eventItemTemplateResolver: u.func,
|
|
2885
|
+
dndSources: u.array,
|
|
2886
|
+
slotClickedFunc: u.func,
|
|
2887
|
+
toggleExpandFunc: u.func,
|
|
2888
|
+
slotItemTemplateResolver: u.func,
|
|
2889
|
+
nonAgendaCellHeaderTemplateResolver: u.func,
|
|
2890
|
+
onScrollLeft: u.func,
|
|
2891
|
+
onScrollRight: u.func,
|
|
2892
|
+
onScrollTop: u.func,
|
|
2893
|
+
onScrollBottom: u.func
|
|
2894
|
+
});
|
|
2895
|
+
export {
|
|
2896
|
+
nr as AddMorePopover,
|
|
2897
|
+
X as CellUnits,
|
|
2898
|
+
L as DATETIME_FORMAT,
|
|
2899
|
+
H as DATE_FORMAT,
|
|
2900
|
+
rr as DnDContext,
|
|
2901
|
+
ot as DnDSource,
|
|
2902
|
+
yr as SampleData,
|
|
2903
|
+
cr as Scheduler,
|
|
2904
|
+
br as SchedulerData,
|
|
2905
|
+
ae as SummaryPos,
|
|
2906
|
+
D as ViewTypes
|
|
2907
|
+
};
|