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