@calenderjs/react 0.3.0 → 0.4.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/dist/Calendar.d.ts +82 -2
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/index.cjs +147 -942
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +132 -927
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -6
package/dist/index.mjs
CHANGED
|
@@ -1,914 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var reactJsxRuntime_production_min = {};
|
|
4
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
5
|
-
function requireReactJsxRuntime_production_min() {
|
|
6
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
7
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
8
|
-
var f = require$$0, k = /* @__PURE__ */ Symbol.for("react.element"), l = /* @__PURE__ */ Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
9
|
-
function q(c, a, g) {
|
|
10
|
-
var b, d = {}, e = null, h = null;
|
|
11
|
-
void 0 !== g && (e = "" + g);
|
|
12
|
-
void 0 !== a.key && (e = "" + a.key);
|
|
13
|
-
void 0 !== a.ref && (h = a.ref);
|
|
14
|
-
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
15
|
-
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
16
|
-
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
17
|
-
}
|
|
18
|
-
reactJsxRuntime_production_min.Fragment = l;
|
|
19
|
-
reactJsxRuntime_production_min.jsx = q;
|
|
20
|
-
reactJsxRuntime_production_min.jsxs = q;
|
|
21
|
-
return reactJsxRuntime_production_min;
|
|
22
|
-
}
|
|
23
|
-
var reactJsxRuntime_development = {};
|
|
24
|
-
var hasRequiredReactJsxRuntime_development;
|
|
25
|
-
function requireReactJsxRuntime_development() {
|
|
26
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
27
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
28
|
-
if (process.env.NODE_ENV !== "production") {
|
|
29
|
-
(function() {
|
|
30
|
-
var React = require$$0;
|
|
31
|
-
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
|
|
32
|
-
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
33
|
-
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
34
|
-
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
35
|
-
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
36
|
-
var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
|
|
37
|
-
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
38
|
-
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
39
|
-
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
40
|
-
var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
|
|
41
|
-
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
42
|
-
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
43
|
-
var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
|
|
44
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
45
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
46
|
-
function getIteratorFn(maybeIterable) {
|
|
47
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
51
|
-
if (typeof maybeIterator === "function") {
|
|
52
|
-
return maybeIterator;
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
57
|
-
function error(format) {
|
|
58
|
-
{
|
|
59
|
-
{
|
|
60
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
61
|
-
args[_key2 - 1] = arguments[_key2];
|
|
62
|
-
}
|
|
63
|
-
printWarning("error", format, args);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function printWarning(level, format, args) {
|
|
68
|
-
{
|
|
69
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
70
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
71
|
-
if (stack !== "") {
|
|
72
|
-
format += "%s";
|
|
73
|
-
args = args.concat([stack]);
|
|
74
|
-
}
|
|
75
|
-
var argsWithFormat = args.map(function(item) {
|
|
76
|
-
return String(item);
|
|
77
|
-
});
|
|
78
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
79
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
var enableScopeAPI = false;
|
|
83
|
-
var enableCacheElement = false;
|
|
84
|
-
var enableTransitionTracing = false;
|
|
85
|
-
var enableLegacyHidden = false;
|
|
86
|
-
var enableDebugTracing = false;
|
|
87
|
-
var REACT_MODULE_REFERENCE;
|
|
88
|
-
{
|
|
89
|
-
REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
90
|
-
}
|
|
91
|
-
function isValidElementType(type) {
|
|
92
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
if (typeof type === "object" && type !== null) {
|
|
99
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
100
|
-
// types supported by any Flight configuration anywhere since
|
|
101
|
-
// we don't know which Flight build this will end up being used
|
|
102
|
-
// with.
|
|
103
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
110
|
-
var displayName = outerType.displayName;
|
|
111
|
-
if (displayName) {
|
|
112
|
-
return displayName;
|
|
113
|
-
}
|
|
114
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
115
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
116
|
-
}
|
|
117
|
-
function getContextName(type) {
|
|
118
|
-
return type.displayName || "Context";
|
|
119
|
-
}
|
|
120
|
-
function getComponentNameFromType(type) {
|
|
121
|
-
if (type == null) {
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
{
|
|
125
|
-
if (typeof type.tag === "number") {
|
|
126
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (typeof type === "function") {
|
|
130
|
-
return type.displayName || type.name || null;
|
|
131
|
-
}
|
|
132
|
-
if (typeof type === "string") {
|
|
133
|
-
return type;
|
|
134
|
-
}
|
|
135
|
-
switch (type) {
|
|
136
|
-
case REACT_FRAGMENT_TYPE:
|
|
137
|
-
return "Fragment";
|
|
138
|
-
case REACT_PORTAL_TYPE:
|
|
139
|
-
return "Portal";
|
|
140
|
-
case REACT_PROFILER_TYPE:
|
|
141
|
-
return "Profiler";
|
|
142
|
-
case REACT_STRICT_MODE_TYPE:
|
|
143
|
-
return "StrictMode";
|
|
144
|
-
case REACT_SUSPENSE_TYPE:
|
|
145
|
-
return "Suspense";
|
|
146
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
147
|
-
return "SuspenseList";
|
|
148
|
-
}
|
|
149
|
-
if (typeof type === "object") {
|
|
150
|
-
switch (type.$$typeof) {
|
|
151
|
-
case REACT_CONTEXT_TYPE:
|
|
152
|
-
var context = type;
|
|
153
|
-
return getContextName(context) + ".Consumer";
|
|
154
|
-
case REACT_PROVIDER_TYPE:
|
|
155
|
-
var provider = type;
|
|
156
|
-
return getContextName(provider._context) + ".Provider";
|
|
157
|
-
case REACT_FORWARD_REF_TYPE:
|
|
158
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
159
|
-
case REACT_MEMO_TYPE:
|
|
160
|
-
var outerName = type.displayName || null;
|
|
161
|
-
if (outerName !== null) {
|
|
162
|
-
return outerName;
|
|
163
|
-
}
|
|
164
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
165
|
-
case REACT_LAZY_TYPE: {
|
|
166
|
-
var lazyComponent = type;
|
|
167
|
-
var payload = lazyComponent._payload;
|
|
168
|
-
var init = lazyComponent._init;
|
|
169
|
-
try {
|
|
170
|
-
return getComponentNameFromType(init(payload));
|
|
171
|
-
} catch (x) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
var assign = Object.assign;
|
|
180
|
-
var disabledDepth = 0;
|
|
181
|
-
var prevLog;
|
|
182
|
-
var prevInfo;
|
|
183
|
-
var prevWarn;
|
|
184
|
-
var prevError;
|
|
185
|
-
var prevGroup;
|
|
186
|
-
var prevGroupCollapsed;
|
|
187
|
-
var prevGroupEnd;
|
|
188
|
-
function disabledLog() {
|
|
189
|
-
}
|
|
190
|
-
disabledLog.__reactDisabledLog = true;
|
|
191
|
-
function disableLogs() {
|
|
192
|
-
{
|
|
193
|
-
if (disabledDepth === 0) {
|
|
194
|
-
prevLog = console.log;
|
|
195
|
-
prevInfo = console.info;
|
|
196
|
-
prevWarn = console.warn;
|
|
197
|
-
prevError = console.error;
|
|
198
|
-
prevGroup = console.group;
|
|
199
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
200
|
-
prevGroupEnd = console.groupEnd;
|
|
201
|
-
var props = {
|
|
202
|
-
configurable: true,
|
|
203
|
-
enumerable: true,
|
|
204
|
-
value: disabledLog,
|
|
205
|
-
writable: true
|
|
206
|
-
};
|
|
207
|
-
Object.defineProperties(console, {
|
|
208
|
-
info: props,
|
|
209
|
-
log: props,
|
|
210
|
-
warn: props,
|
|
211
|
-
error: props,
|
|
212
|
-
group: props,
|
|
213
|
-
groupCollapsed: props,
|
|
214
|
-
groupEnd: props
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
disabledDepth++;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function reenableLogs() {
|
|
221
|
-
{
|
|
222
|
-
disabledDepth--;
|
|
223
|
-
if (disabledDepth === 0) {
|
|
224
|
-
var props = {
|
|
225
|
-
configurable: true,
|
|
226
|
-
enumerable: true,
|
|
227
|
-
writable: true
|
|
228
|
-
};
|
|
229
|
-
Object.defineProperties(console, {
|
|
230
|
-
log: assign({}, props, {
|
|
231
|
-
value: prevLog
|
|
232
|
-
}),
|
|
233
|
-
info: assign({}, props, {
|
|
234
|
-
value: prevInfo
|
|
235
|
-
}),
|
|
236
|
-
warn: assign({}, props, {
|
|
237
|
-
value: prevWarn
|
|
238
|
-
}),
|
|
239
|
-
error: assign({}, props, {
|
|
240
|
-
value: prevError
|
|
241
|
-
}),
|
|
242
|
-
group: assign({}, props, {
|
|
243
|
-
value: prevGroup
|
|
244
|
-
}),
|
|
245
|
-
groupCollapsed: assign({}, props, {
|
|
246
|
-
value: prevGroupCollapsed
|
|
247
|
-
}),
|
|
248
|
-
groupEnd: assign({}, props, {
|
|
249
|
-
value: prevGroupEnd
|
|
250
|
-
})
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
if (disabledDepth < 0) {
|
|
254
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
259
|
-
var prefix;
|
|
260
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
261
|
-
{
|
|
262
|
-
if (prefix === void 0) {
|
|
263
|
-
try {
|
|
264
|
-
throw Error();
|
|
265
|
-
} catch (x) {
|
|
266
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
267
|
-
prefix = match && match[1] || "";
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return "\n" + prefix + name;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
var reentry = false;
|
|
274
|
-
var componentFrameCache;
|
|
275
|
-
{
|
|
276
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
277
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
278
|
-
}
|
|
279
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
280
|
-
if (!fn || reentry) {
|
|
281
|
-
return "";
|
|
282
|
-
}
|
|
283
|
-
{
|
|
284
|
-
var frame = componentFrameCache.get(fn);
|
|
285
|
-
if (frame !== void 0) {
|
|
286
|
-
return frame;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
var control;
|
|
290
|
-
reentry = true;
|
|
291
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
292
|
-
Error.prepareStackTrace = void 0;
|
|
293
|
-
var previousDispatcher;
|
|
294
|
-
{
|
|
295
|
-
previousDispatcher = ReactCurrentDispatcher.current;
|
|
296
|
-
ReactCurrentDispatcher.current = null;
|
|
297
|
-
disableLogs();
|
|
298
|
-
}
|
|
299
|
-
try {
|
|
300
|
-
if (construct) {
|
|
301
|
-
var Fake = function() {
|
|
302
|
-
throw Error();
|
|
303
|
-
};
|
|
304
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
305
|
-
set: function() {
|
|
306
|
-
throw Error();
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
310
|
-
try {
|
|
311
|
-
Reflect.construct(Fake, []);
|
|
312
|
-
} catch (x) {
|
|
313
|
-
control = x;
|
|
314
|
-
}
|
|
315
|
-
Reflect.construct(fn, [], Fake);
|
|
316
|
-
} else {
|
|
317
|
-
try {
|
|
318
|
-
Fake.call();
|
|
319
|
-
} catch (x) {
|
|
320
|
-
control = x;
|
|
321
|
-
}
|
|
322
|
-
fn.call(Fake.prototype);
|
|
323
|
-
}
|
|
324
|
-
} else {
|
|
325
|
-
try {
|
|
326
|
-
throw Error();
|
|
327
|
-
} catch (x) {
|
|
328
|
-
control = x;
|
|
329
|
-
}
|
|
330
|
-
fn();
|
|
331
|
-
}
|
|
332
|
-
} catch (sample) {
|
|
333
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
334
|
-
var sampleLines = sample.stack.split("\n");
|
|
335
|
-
var controlLines = control.stack.split("\n");
|
|
336
|
-
var s = sampleLines.length - 1;
|
|
337
|
-
var c = controlLines.length - 1;
|
|
338
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
339
|
-
c--;
|
|
340
|
-
}
|
|
341
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
342
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
343
|
-
if (s !== 1 || c !== 1) {
|
|
344
|
-
do {
|
|
345
|
-
s--;
|
|
346
|
-
c--;
|
|
347
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
348
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
349
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
350
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
351
|
-
}
|
|
352
|
-
{
|
|
353
|
-
if (typeof fn === "function") {
|
|
354
|
-
componentFrameCache.set(fn, _frame);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return _frame;
|
|
358
|
-
}
|
|
359
|
-
} while (s >= 1 && c >= 0);
|
|
360
|
-
}
|
|
361
|
-
break;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
} finally {
|
|
366
|
-
reentry = false;
|
|
367
|
-
{
|
|
368
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
369
|
-
reenableLogs();
|
|
370
|
-
}
|
|
371
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
372
|
-
}
|
|
373
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
374
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
375
|
-
{
|
|
376
|
-
if (typeof fn === "function") {
|
|
377
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
return syntheticFrame;
|
|
381
|
-
}
|
|
382
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
383
|
-
{
|
|
384
|
-
return describeNativeComponentFrame(fn, false);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
function shouldConstruct(Component) {
|
|
388
|
-
var prototype = Component.prototype;
|
|
389
|
-
return !!(prototype && prototype.isReactComponent);
|
|
390
|
-
}
|
|
391
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
392
|
-
if (type == null) {
|
|
393
|
-
return "";
|
|
394
|
-
}
|
|
395
|
-
if (typeof type === "function") {
|
|
396
|
-
{
|
|
397
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
if (typeof type === "string") {
|
|
401
|
-
return describeBuiltInComponentFrame(type);
|
|
402
|
-
}
|
|
403
|
-
switch (type) {
|
|
404
|
-
case REACT_SUSPENSE_TYPE:
|
|
405
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
406
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
407
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
408
|
-
}
|
|
409
|
-
if (typeof type === "object") {
|
|
410
|
-
switch (type.$$typeof) {
|
|
411
|
-
case REACT_FORWARD_REF_TYPE:
|
|
412
|
-
return describeFunctionComponentFrame(type.render);
|
|
413
|
-
case REACT_MEMO_TYPE:
|
|
414
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
415
|
-
case REACT_LAZY_TYPE: {
|
|
416
|
-
var lazyComponent = type;
|
|
417
|
-
var payload = lazyComponent._payload;
|
|
418
|
-
var init = lazyComponent._init;
|
|
419
|
-
try {
|
|
420
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
421
|
-
} catch (x) {
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return "";
|
|
427
|
-
}
|
|
428
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
429
|
-
var loggedTypeFailures = {};
|
|
430
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
431
|
-
function setCurrentlyValidatingElement(element) {
|
|
432
|
-
{
|
|
433
|
-
if (element) {
|
|
434
|
-
var owner = element._owner;
|
|
435
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
436
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
437
|
-
} else {
|
|
438
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
443
|
-
{
|
|
444
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
445
|
-
for (var typeSpecName in typeSpecs) {
|
|
446
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
447
|
-
var error$1 = void 0;
|
|
448
|
-
try {
|
|
449
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
450
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
451
|
-
err.name = "Invariant Violation";
|
|
452
|
-
throw err;
|
|
453
|
-
}
|
|
454
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
455
|
-
} catch (ex) {
|
|
456
|
-
error$1 = ex;
|
|
457
|
-
}
|
|
458
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
459
|
-
setCurrentlyValidatingElement(element);
|
|
460
|
-
error("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
461
|
-
setCurrentlyValidatingElement(null);
|
|
462
|
-
}
|
|
463
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
464
|
-
loggedTypeFailures[error$1.message] = true;
|
|
465
|
-
setCurrentlyValidatingElement(element);
|
|
466
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
467
|
-
setCurrentlyValidatingElement(null);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
var isArrayImpl = Array.isArray;
|
|
474
|
-
function isArray(a) {
|
|
475
|
-
return isArrayImpl(a);
|
|
476
|
-
}
|
|
477
|
-
function typeName(value) {
|
|
478
|
-
{
|
|
479
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
480
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
481
|
-
return type;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
function willCoercionThrow(value) {
|
|
485
|
-
{
|
|
486
|
-
try {
|
|
487
|
-
testStringCoercion(value);
|
|
488
|
-
return false;
|
|
489
|
-
} catch (e) {
|
|
490
|
-
return true;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function testStringCoercion(value) {
|
|
495
|
-
return "" + value;
|
|
496
|
-
}
|
|
497
|
-
function checkKeyStringCoercion(value) {
|
|
498
|
-
{
|
|
499
|
-
if (willCoercionThrow(value)) {
|
|
500
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
501
|
-
return testStringCoercion(value);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
506
|
-
var RESERVED_PROPS = {
|
|
507
|
-
key: true,
|
|
508
|
-
ref: true,
|
|
509
|
-
__self: true,
|
|
510
|
-
__source: true
|
|
511
|
-
};
|
|
512
|
-
var specialPropKeyWarningShown;
|
|
513
|
-
var specialPropRefWarningShown;
|
|
514
|
-
function hasValidRef(config) {
|
|
515
|
-
{
|
|
516
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
517
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
518
|
-
if (getter && getter.isReactWarning) {
|
|
519
|
-
return false;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return config.ref !== void 0;
|
|
524
|
-
}
|
|
525
|
-
function hasValidKey(config) {
|
|
526
|
-
{
|
|
527
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
528
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
529
|
-
if (getter && getter.isReactWarning) {
|
|
530
|
-
return false;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
return config.key !== void 0;
|
|
535
|
-
}
|
|
536
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
537
|
-
{
|
|
538
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self) ;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
542
|
-
{
|
|
543
|
-
var warnAboutAccessingKey = function() {
|
|
544
|
-
if (!specialPropKeyWarningShown) {
|
|
545
|
-
specialPropKeyWarningShown = true;
|
|
546
|
-
error("%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)", displayName);
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
550
|
-
Object.defineProperty(props, "key", {
|
|
551
|
-
get: warnAboutAccessingKey,
|
|
552
|
-
configurable: true
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
557
|
-
{
|
|
558
|
-
var warnAboutAccessingRef = function() {
|
|
559
|
-
if (!specialPropRefWarningShown) {
|
|
560
|
-
specialPropRefWarningShown = true;
|
|
561
|
-
error("%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)", displayName);
|
|
562
|
-
}
|
|
563
|
-
};
|
|
564
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
565
|
-
Object.defineProperty(props, "ref", {
|
|
566
|
-
get: warnAboutAccessingRef,
|
|
567
|
-
configurable: true
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
572
|
-
var element = {
|
|
573
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
574
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
575
|
-
// Built-in properties that belong on the element
|
|
576
|
-
type,
|
|
577
|
-
key,
|
|
578
|
-
ref,
|
|
579
|
-
props,
|
|
580
|
-
// Record the component responsible for creating this element.
|
|
581
|
-
_owner: owner
|
|
582
|
-
};
|
|
583
|
-
{
|
|
584
|
-
element._store = {};
|
|
585
|
-
Object.defineProperty(element._store, "validated", {
|
|
586
|
-
configurable: false,
|
|
587
|
-
enumerable: false,
|
|
588
|
-
writable: true,
|
|
589
|
-
value: false
|
|
590
|
-
});
|
|
591
|
-
Object.defineProperty(element, "_self", {
|
|
592
|
-
configurable: false,
|
|
593
|
-
enumerable: false,
|
|
594
|
-
writable: false,
|
|
595
|
-
value: self
|
|
596
|
-
});
|
|
597
|
-
Object.defineProperty(element, "_source", {
|
|
598
|
-
configurable: false,
|
|
599
|
-
enumerable: false,
|
|
600
|
-
writable: false,
|
|
601
|
-
value: source
|
|
602
|
-
});
|
|
603
|
-
if (Object.freeze) {
|
|
604
|
-
Object.freeze(element.props);
|
|
605
|
-
Object.freeze(element);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
return element;
|
|
609
|
-
};
|
|
610
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
611
|
-
{
|
|
612
|
-
var propName;
|
|
613
|
-
var props = {};
|
|
614
|
-
var key = null;
|
|
615
|
-
var ref = null;
|
|
616
|
-
if (maybeKey !== void 0) {
|
|
617
|
-
{
|
|
618
|
-
checkKeyStringCoercion(maybeKey);
|
|
619
|
-
}
|
|
620
|
-
key = "" + maybeKey;
|
|
621
|
-
}
|
|
622
|
-
if (hasValidKey(config)) {
|
|
623
|
-
{
|
|
624
|
-
checkKeyStringCoercion(config.key);
|
|
625
|
-
}
|
|
626
|
-
key = "" + config.key;
|
|
627
|
-
}
|
|
628
|
-
if (hasValidRef(config)) {
|
|
629
|
-
ref = config.ref;
|
|
630
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
631
|
-
}
|
|
632
|
-
for (propName in config) {
|
|
633
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
634
|
-
props[propName] = config[propName];
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
if (type && type.defaultProps) {
|
|
638
|
-
var defaultProps = type.defaultProps;
|
|
639
|
-
for (propName in defaultProps) {
|
|
640
|
-
if (props[propName] === void 0) {
|
|
641
|
-
props[propName] = defaultProps[propName];
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
if (key || ref) {
|
|
646
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
647
|
-
if (key) {
|
|
648
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
649
|
-
}
|
|
650
|
-
if (ref) {
|
|
651
|
-
defineRefPropWarningGetter(props, displayName);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
658
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
659
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
660
|
-
{
|
|
661
|
-
if (element) {
|
|
662
|
-
var owner = element._owner;
|
|
663
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
664
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
665
|
-
} else {
|
|
666
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
var propTypesMisspellWarningShown;
|
|
671
|
-
{
|
|
672
|
-
propTypesMisspellWarningShown = false;
|
|
673
|
-
}
|
|
674
|
-
function isValidElement(object) {
|
|
675
|
-
{
|
|
676
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
function getDeclarationErrorAddendum() {
|
|
680
|
-
{
|
|
681
|
-
if (ReactCurrentOwner$1.current) {
|
|
682
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
683
|
-
if (name) {
|
|
684
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
return "";
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
function getSourceInfoErrorAddendum(source) {
|
|
691
|
-
{
|
|
692
|
-
return "";
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
var ownerHasKeyUseWarning = {};
|
|
696
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
697
|
-
{
|
|
698
|
-
var info = getDeclarationErrorAddendum();
|
|
699
|
-
if (!info) {
|
|
700
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
701
|
-
if (parentName) {
|
|
702
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
return info;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
function validateExplicitKey(element, parentType) {
|
|
709
|
-
{
|
|
710
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
711
|
-
return;
|
|
712
|
-
}
|
|
713
|
-
element._store.validated = true;
|
|
714
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
715
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
719
|
-
var childOwner = "";
|
|
720
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
721
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
722
|
-
}
|
|
723
|
-
setCurrentlyValidatingElement$1(element);
|
|
724
|
-
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
725
|
-
setCurrentlyValidatingElement$1(null);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
function validateChildKeys(node, parentType) {
|
|
729
|
-
{
|
|
730
|
-
if (typeof node !== "object") {
|
|
731
|
-
return;
|
|
732
|
-
}
|
|
733
|
-
if (isArray(node)) {
|
|
734
|
-
for (var i = 0; i < node.length; i++) {
|
|
735
|
-
var child = node[i];
|
|
736
|
-
if (isValidElement(child)) {
|
|
737
|
-
validateExplicitKey(child, parentType);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
} else if (isValidElement(node)) {
|
|
741
|
-
if (node._store) {
|
|
742
|
-
node._store.validated = true;
|
|
743
|
-
}
|
|
744
|
-
} else if (node) {
|
|
745
|
-
var iteratorFn = getIteratorFn(node);
|
|
746
|
-
if (typeof iteratorFn === "function") {
|
|
747
|
-
if (iteratorFn !== node.entries) {
|
|
748
|
-
var iterator = iteratorFn.call(node);
|
|
749
|
-
var step;
|
|
750
|
-
while (!(step = iterator.next()).done) {
|
|
751
|
-
if (isValidElement(step.value)) {
|
|
752
|
-
validateExplicitKey(step.value, parentType);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
function validatePropTypes(element) {
|
|
761
|
-
{
|
|
762
|
-
var type = element.type;
|
|
763
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
var propTypes;
|
|
767
|
-
if (typeof type === "function") {
|
|
768
|
-
propTypes = type.propTypes;
|
|
769
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
770
|
-
// Inner props are checked in the reconciler.
|
|
771
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
772
|
-
propTypes = type.propTypes;
|
|
773
|
-
} else {
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
if (propTypes) {
|
|
777
|
-
var name = getComponentNameFromType(type);
|
|
778
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
779
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
780
|
-
propTypesMisspellWarningShown = true;
|
|
781
|
-
var _name = getComponentNameFromType(type);
|
|
782
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
783
|
-
}
|
|
784
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
785
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
function validateFragmentProps(fragment) {
|
|
790
|
-
{
|
|
791
|
-
var keys = Object.keys(fragment.props);
|
|
792
|
-
for (var i = 0; i < keys.length; i++) {
|
|
793
|
-
var key = keys[i];
|
|
794
|
-
if (key !== "children" && key !== "key") {
|
|
795
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
796
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
797
|
-
setCurrentlyValidatingElement$1(null);
|
|
798
|
-
break;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
if (fragment.ref !== null) {
|
|
802
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
803
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
804
|
-
setCurrentlyValidatingElement$1(null);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
var didWarnAboutKeySpread = {};
|
|
809
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
810
|
-
{
|
|
811
|
-
var validType = isValidElementType(type);
|
|
812
|
-
if (!validType) {
|
|
813
|
-
var info = "";
|
|
814
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
815
|
-
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
816
|
-
}
|
|
817
|
-
var sourceInfo = getSourceInfoErrorAddendum();
|
|
818
|
-
if (sourceInfo) {
|
|
819
|
-
info += sourceInfo;
|
|
820
|
-
} else {
|
|
821
|
-
info += getDeclarationErrorAddendum();
|
|
822
|
-
}
|
|
823
|
-
var typeString;
|
|
824
|
-
if (type === null) {
|
|
825
|
-
typeString = "null";
|
|
826
|
-
} else if (isArray(type)) {
|
|
827
|
-
typeString = "array";
|
|
828
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
829
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
830
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
831
|
-
} else {
|
|
832
|
-
typeString = typeof type;
|
|
833
|
-
}
|
|
834
|
-
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
835
|
-
}
|
|
836
|
-
var element = jsxDEV(type, props, key, source, self);
|
|
837
|
-
if (element == null) {
|
|
838
|
-
return element;
|
|
839
|
-
}
|
|
840
|
-
if (validType) {
|
|
841
|
-
var children = props.children;
|
|
842
|
-
if (children !== void 0) {
|
|
843
|
-
if (isStaticChildren) {
|
|
844
|
-
if (isArray(children)) {
|
|
845
|
-
for (var i = 0; i < children.length; i++) {
|
|
846
|
-
validateChildKeys(children[i], type);
|
|
847
|
-
}
|
|
848
|
-
if (Object.freeze) {
|
|
849
|
-
Object.freeze(children);
|
|
850
|
-
}
|
|
851
|
-
} else {
|
|
852
|
-
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
853
|
-
}
|
|
854
|
-
} else {
|
|
855
|
-
validateChildKeys(children, type);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
{
|
|
860
|
-
if (hasOwnProperty.call(props, "key")) {
|
|
861
|
-
var componentName = getComponentNameFromType(type);
|
|
862
|
-
var keys = Object.keys(props).filter(function(k) {
|
|
863
|
-
return k !== "key";
|
|
864
|
-
});
|
|
865
|
-
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
866
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
867
|
-
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
|
868
|
-
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
869
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
874
|
-
validateFragmentProps(element);
|
|
875
|
-
} else {
|
|
876
|
-
validatePropTypes(element);
|
|
877
|
-
}
|
|
878
|
-
return element;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
882
|
-
{
|
|
883
|
-
return jsxWithValidation(type, props, key, true);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
887
|
-
{
|
|
888
|
-
return jsxWithValidation(type, props, key, false);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
var jsx = jsxWithValidationDynamic;
|
|
892
|
-
var jsxs = jsxWithValidationStatic;
|
|
893
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
894
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
895
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
896
|
-
})();
|
|
897
|
-
}
|
|
898
|
-
return reactJsxRuntime_development;
|
|
899
|
-
}
|
|
900
|
-
var hasRequiredJsxRuntime;
|
|
901
|
-
function requireJsxRuntime() {
|
|
902
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
903
|
-
hasRequiredJsxRuntime = 1;
|
|
904
|
-
if (process.env.NODE_ENV === "production") {
|
|
905
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
906
|
-
} else {
|
|
907
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
908
|
-
}
|
|
909
|
-
return jsxRuntime.exports;
|
|
910
|
-
}
|
|
911
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef, useState, useEffect, useImperativeHandle, useCallback } from "react";
|
|
912
3
|
let calendarRegistered = false;
|
|
913
4
|
const registerCalendar = () => {
|
|
914
5
|
if (typeof window !== "undefined" && !calendarRegistered) {
|
|
@@ -922,10 +13,20 @@ const Calendar = forwardRef(
|
|
|
922
13
|
date,
|
|
923
14
|
events,
|
|
924
15
|
user,
|
|
16
|
+
eventTypeDefinitions,
|
|
17
|
+
mode,
|
|
925
18
|
onDateChange,
|
|
926
19
|
onViewChange,
|
|
927
20
|
onEventClick,
|
|
21
|
+
onEventEditRequest,
|
|
928
22
|
onDateDoubleClick,
|
|
23
|
+
onEventCreate,
|
|
24
|
+
onEventUpdate,
|
|
25
|
+
onEventUpdateDenied,
|
|
26
|
+
onEventUpdateError,
|
|
27
|
+
onEventDelete,
|
|
28
|
+
onEventActionDenied,
|
|
29
|
+
onSlotClick,
|
|
929
30
|
className,
|
|
930
31
|
style,
|
|
931
32
|
...rest
|
|
@@ -953,10 +54,38 @@ const Calendar = forwardRef(
|
|
|
953
54
|
if (calendarRef.current) {
|
|
954
55
|
calendarRef.current.date = /* @__PURE__ */ new Date();
|
|
955
56
|
}
|
|
57
|
+
},
|
|
58
|
+
getEvents: () => {
|
|
59
|
+
if (calendarRef.current && typeof calendarRef.current.getEvents === "function") {
|
|
60
|
+
return calendarRef.current.getEvents();
|
|
61
|
+
}
|
|
62
|
+
return calendarRef.current?.events || [];
|
|
63
|
+
},
|
|
64
|
+
getEventDSL: () => {
|
|
65
|
+
if (calendarRef.current && typeof calendarRef.current.getEventDSL === "function") {
|
|
66
|
+
return calendarRef.current.getEventDSL();
|
|
67
|
+
}
|
|
68
|
+
return calendarRef.current?.eventTypeDefinitions ?? calendarRef.current?.eventDSL ?? null;
|
|
69
|
+
},
|
|
70
|
+
addEvent: (newEvent) => {
|
|
71
|
+
if (calendarRef.current && typeof calendarRef.current.addEvent === "function") {
|
|
72
|
+
return calendarRef.current.addEvent(newEvent);
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
},
|
|
76
|
+
proposeEventUpdate: (updatedEvent) => {
|
|
77
|
+
const element = calendarRef.current;
|
|
78
|
+
if (typeof element?.proposeEventUpdate !== "function") return false;
|
|
79
|
+
return element.proposeEventUpdate(updatedEvent);
|
|
80
|
+
},
|
|
81
|
+
canPerformAction: (action, event) => {
|
|
82
|
+
const element = calendarRef.current;
|
|
83
|
+
if (typeof element?.canPerformAction !== "function") return false;
|
|
84
|
+
return element.canPerformAction(action, event);
|
|
956
85
|
}
|
|
957
86
|
}));
|
|
958
87
|
useEffect(() => {
|
|
959
|
-
if (!calendarRef.current) return;
|
|
88
|
+
if (!isClient || !calendarRef.current) return;
|
|
960
89
|
const element = calendarRef.current;
|
|
961
90
|
if (view !== void 0) {
|
|
962
91
|
element.view = view;
|
|
@@ -970,9 +99,15 @@ const Calendar = forwardRef(
|
|
|
970
99
|
if (user !== void 0) {
|
|
971
100
|
element.user = user;
|
|
972
101
|
}
|
|
973
|
-
|
|
102
|
+
if (eventTypeDefinitions !== void 0) {
|
|
103
|
+
element.eventTypeDefinitions = eventTypeDefinitions;
|
|
104
|
+
}
|
|
105
|
+
if (mode !== void 0) {
|
|
106
|
+
element.mode = mode;
|
|
107
|
+
}
|
|
108
|
+
}, [isClient, view, date, events, user, eventTypeDefinitions, mode]);
|
|
974
109
|
useEffect(() => {
|
|
975
|
-
if (!calendarRef.current) return;
|
|
110
|
+
if (!isClient || !calendarRef.current) return;
|
|
976
111
|
const element = calendarRef.current;
|
|
977
112
|
const handleDateChange = (e) => {
|
|
978
113
|
onDateChange?.(e);
|
|
@@ -983,22 +118,92 @@ const Calendar = forwardRef(
|
|
|
983
118
|
const handleEventClick = (e) => {
|
|
984
119
|
onEventClick?.(e);
|
|
985
120
|
};
|
|
121
|
+
const handleEventEditRequest = (e) => {
|
|
122
|
+
onEventEditRequest?.(e);
|
|
123
|
+
};
|
|
986
124
|
const handleDateDoubleClick = (e) => {
|
|
987
125
|
onDateDoubleClick?.(e);
|
|
988
126
|
};
|
|
127
|
+
const handleEventCreate = (e) => {
|
|
128
|
+
onEventCreate?.(e);
|
|
129
|
+
};
|
|
130
|
+
const handleEventUpdate = (e) => {
|
|
131
|
+
onEventUpdate?.(e);
|
|
132
|
+
};
|
|
133
|
+
const handleEventUpdateDenied = (e) => {
|
|
134
|
+
onEventUpdateDenied?.(e);
|
|
135
|
+
};
|
|
136
|
+
const handleEventUpdateError = (e) => {
|
|
137
|
+
onEventUpdateError?.(
|
|
138
|
+
e
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
const handleEventDelete = (e) => {
|
|
142
|
+
onEventDelete?.(e);
|
|
143
|
+
};
|
|
144
|
+
const handleEventActionDenied = (e) => {
|
|
145
|
+
onEventActionDenied?.(
|
|
146
|
+
e
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
const handleSlotClick = (e) => {
|
|
150
|
+
onSlotClick?.(e);
|
|
151
|
+
};
|
|
989
152
|
element.addEventListener("date-change", handleDateChange);
|
|
990
153
|
element.addEventListener("view-change", handleViewChange);
|
|
991
154
|
element.addEventListener("event-click", handleEventClick);
|
|
155
|
+
element.addEventListener("event-edit-request", handleEventEditRequest);
|
|
992
156
|
element.addEventListener("date-double-click", handleDateDoubleClick);
|
|
157
|
+
element.addEventListener("event-create", handleEventCreate);
|
|
158
|
+
element.addEventListener("event-update", handleEventUpdate);
|
|
159
|
+
element.addEventListener("event-update-denied", handleEventUpdateDenied);
|
|
160
|
+
element.addEventListener("event-update-error", handleEventUpdateError);
|
|
161
|
+
element.addEventListener("event-delete", handleEventDelete);
|
|
162
|
+
element.addEventListener("event-action-denied", handleEventActionDenied);
|
|
163
|
+
element.addEventListener("slot-click", handleSlotClick);
|
|
993
164
|
return () => {
|
|
994
165
|
element.removeEventListener("date-change", handleDateChange);
|
|
995
166
|
element.removeEventListener("view-change", handleViewChange);
|
|
996
167
|
element.removeEventListener("event-click", handleEventClick);
|
|
168
|
+
element.removeEventListener(
|
|
169
|
+
"event-edit-request",
|
|
170
|
+
handleEventEditRequest
|
|
171
|
+
);
|
|
997
172
|
element.removeEventListener("date-double-click", handleDateDoubleClick);
|
|
173
|
+
element.removeEventListener("event-create", handleEventCreate);
|
|
174
|
+
element.removeEventListener("event-update", handleEventUpdate);
|
|
175
|
+
element.removeEventListener(
|
|
176
|
+
"event-update-denied",
|
|
177
|
+
handleEventUpdateDenied
|
|
178
|
+
);
|
|
179
|
+
element.removeEventListener(
|
|
180
|
+
"event-update-error",
|
|
181
|
+
handleEventUpdateError
|
|
182
|
+
);
|
|
183
|
+
element.removeEventListener("event-delete", handleEventDelete);
|
|
184
|
+
element.removeEventListener(
|
|
185
|
+
"event-action-denied",
|
|
186
|
+
handleEventActionDenied
|
|
187
|
+
);
|
|
188
|
+
element.removeEventListener("slot-click", handleSlotClick);
|
|
998
189
|
};
|
|
999
|
-
}, [
|
|
190
|
+
}, [
|
|
191
|
+
isClient,
|
|
192
|
+
onDateChange,
|
|
193
|
+
onViewChange,
|
|
194
|
+
onEventClick,
|
|
195
|
+
onEventEditRequest,
|
|
196
|
+
onDateDoubleClick,
|
|
197
|
+
onEventCreate,
|
|
198
|
+
onEventUpdate,
|
|
199
|
+
onEventUpdateDenied,
|
|
200
|
+
onEventUpdateError,
|
|
201
|
+
onEventDelete,
|
|
202
|
+
onEventActionDenied,
|
|
203
|
+
onSlotClick
|
|
204
|
+
]);
|
|
1000
205
|
if (!isClient) {
|
|
1001
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ jsx(
|
|
1002
207
|
"div",
|
|
1003
208
|
{
|
|
1004
209
|
className,
|
|
@@ -1010,11 +215,11 @@ const Calendar = forwardRef(
|
|
|
1010
215
|
justifyContent: "center"
|
|
1011
216
|
},
|
|
1012
217
|
...rest,
|
|
1013
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ jsx("div", { children: "加载中..." })
|
|
1014
219
|
}
|
|
1015
220
|
);
|
|
1016
221
|
}
|
|
1017
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ jsx(
|
|
1018
223
|
"wsx-calendar",
|
|
1019
224
|
{
|
|
1020
225
|
ref: calendarRef,
|
|
@@ -1072,7 +277,7 @@ function ResizableSplitter({
|
|
|
1072
277
|
};
|
|
1073
278
|
}
|
|
1074
279
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
1075
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsxs(
|
|
1076
281
|
"div",
|
|
1077
282
|
{
|
|
1078
283
|
ref: containerRef,
|
|
@@ -1084,7 +289,7 @@ function ResizableSplitter({
|
|
|
1084
289
|
position: "relative"
|
|
1085
290
|
},
|
|
1086
291
|
children: [
|
|
1087
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ jsx(
|
|
1088
293
|
"div",
|
|
1089
294
|
{
|
|
1090
295
|
style: {
|
|
@@ -1097,7 +302,7 @@ function ResizableSplitter({
|
|
|
1097
302
|
children: left
|
|
1098
303
|
}
|
|
1099
304
|
),
|
|
1100
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ jsx(
|
|
1101
306
|
"div",
|
|
1102
307
|
{
|
|
1103
308
|
ref: splitterRef,
|
|
@@ -1121,7 +326,7 @@ function ResizableSplitter({
|
|
|
1121
326
|
e.currentTarget.style.backgroundColor = "var(--resizable-splitter-bg-color, #ddd)";
|
|
1122
327
|
}
|
|
1123
328
|
},
|
|
1124
|
-
children: /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ jsx(
|
|
1125
330
|
"div",
|
|
1126
331
|
{
|
|
1127
332
|
style: {
|
|
@@ -1138,7 +343,7 @@ function ResizableSplitter({
|
|
|
1138
343
|
justifyContent: "center",
|
|
1139
344
|
pointerEvents: "none"
|
|
1140
345
|
},
|
|
1141
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ jsxs(
|
|
1142
347
|
"div",
|
|
1143
348
|
{
|
|
1144
349
|
style: {
|
|
@@ -1147,7 +352,7 @@ function ResizableSplitter({
|
|
|
1147
352
|
gap: "var(--resizable-splitter-dot-gap, 2px)"
|
|
1148
353
|
},
|
|
1149
354
|
children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ jsx(
|
|
1151
356
|
"div",
|
|
1152
357
|
{
|
|
1153
358
|
style: {
|
|
@@ -1158,7 +363,7 @@ function ResizableSplitter({
|
|
|
1158
363
|
}
|
|
1159
364
|
}
|
|
1160
365
|
),
|
|
1161
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ jsx(
|
|
1162
367
|
"div",
|
|
1163
368
|
{
|
|
1164
369
|
style: {
|
|
@@ -1169,7 +374,7 @@ function ResizableSplitter({
|
|
|
1169
374
|
}
|
|
1170
375
|
}
|
|
1171
376
|
),
|
|
1172
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ jsx(
|
|
1173
378
|
"div",
|
|
1174
379
|
{
|
|
1175
380
|
style: {
|
|
@@ -1187,7 +392,7 @@ function ResizableSplitter({
|
|
|
1187
392
|
)
|
|
1188
393
|
}
|
|
1189
394
|
),
|
|
1190
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ jsx(
|
|
1191
396
|
"div",
|
|
1192
397
|
{
|
|
1193
398
|
style: {
|