@wavelengthusaf/web-components 1.17.0 → 1.19.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/dist/cjs/index.cjs +708 -2507
- package/dist/cjs/index.d.cts +80 -17
- package/dist/esm/index.d.ts +80 -17
- package/dist/esm/index.js +708 -2507
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,2189 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
// ../../../node_modules/react/cjs/react.production.min.js
|
|
28
|
-
var require_react_production_min = __commonJS({
|
|
29
|
-
"../../../node_modules/react/cjs/react.production.min.js"(exports) {
|
|
30
|
-
"use strict";
|
|
31
|
-
var l = /* @__PURE__ */ Symbol.for("react.element");
|
|
32
|
-
var n = /* @__PURE__ */ Symbol.for("react.portal");
|
|
33
|
-
var p = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
34
|
-
var q = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
35
|
-
var r = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
36
|
-
var t = /* @__PURE__ */ Symbol.for("react.provider");
|
|
37
|
-
var u = /* @__PURE__ */ Symbol.for("react.context");
|
|
38
|
-
var v = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
39
|
-
var w = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
40
|
-
var x = /* @__PURE__ */ Symbol.for("react.memo");
|
|
41
|
-
var y = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
42
|
-
var z = Symbol.iterator;
|
|
43
|
-
function A(a) {
|
|
44
|
-
if (null === a || "object" !== typeof a) return null;
|
|
45
|
-
a = z && a[z] || a["@@iterator"];
|
|
46
|
-
return "function" === typeof a ? a : null;
|
|
47
|
-
}
|
|
48
|
-
var B = { isMounted: function() {
|
|
49
|
-
return false;
|
|
50
|
-
}, enqueueForceUpdate: function() {
|
|
51
|
-
}, enqueueReplaceState: function() {
|
|
52
|
-
}, enqueueSetState: function() {
|
|
53
|
-
} };
|
|
54
|
-
var C = Object.assign;
|
|
55
|
-
var D = {};
|
|
56
|
-
function E(a, b, e) {
|
|
57
|
-
this.props = a;
|
|
58
|
-
this.context = b;
|
|
59
|
-
this.refs = D;
|
|
60
|
-
this.updater = e || B;
|
|
61
|
-
}
|
|
62
|
-
E.prototype.isReactComponent = {};
|
|
63
|
-
E.prototype.setState = function(a, b) {
|
|
64
|
-
if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
65
|
-
this.updater.enqueueSetState(this, a, b, "setState");
|
|
66
|
-
};
|
|
67
|
-
E.prototype.forceUpdate = function(a) {
|
|
68
|
-
this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
|
69
|
-
};
|
|
70
|
-
function F() {
|
|
71
|
-
}
|
|
72
|
-
F.prototype = E.prototype;
|
|
73
|
-
function G(a, b, e) {
|
|
74
|
-
this.props = a;
|
|
75
|
-
this.context = b;
|
|
76
|
-
this.refs = D;
|
|
77
|
-
this.updater = e || B;
|
|
78
|
-
}
|
|
79
|
-
var H = G.prototype = new F();
|
|
80
|
-
H.constructor = G;
|
|
81
|
-
C(H, E.prototype);
|
|
82
|
-
H.isPureReactComponent = true;
|
|
83
|
-
var I = Array.isArray;
|
|
84
|
-
var J = Object.prototype.hasOwnProperty;
|
|
85
|
-
var K = { current: null };
|
|
86
|
-
var L = { key: true, ref: true, __self: true, __source: true };
|
|
87
|
-
function M(a, b, e) {
|
|
88
|
-
var d, c = {}, k = null, h = null;
|
|
89
|
-
if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
|
|
90
|
-
var g = arguments.length - 2;
|
|
91
|
-
if (1 === g) c.children = e;
|
|
92
|
-
else if (1 < g) {
|
|
93
|
-
for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
|
|
94
|
-
c.children = f;
|
|
95
|
-
}
|
|
96
|
-
if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
|
|
97
|
-
return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
|
|
98
|
-
}
|
|
99
|
-
function N(a, b) {
|
|
100
|
-
return { $$typeof: l, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner };
|
|
101
|
-
}
|
|
102
|
-
function O(a) {
|
|
103
|
-
return "object" === typeof a && null !== a && a.$$typeof === l;
|
|
104
|
-
}
|
|
105
|
-
function escape(a) {
|
|
106
|
-
var b = { "=": "=0", ":": "=2" };
|
|
107
|
-
return "$" + a.replace(/[=:]/g, function(a2) {
|
|
108
|
-
return b[a2];
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
var P = /\/+/g;
|
|
112
|
-
function Q(a, b) {
|
|
113
|
-
return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
|
|
114
|
-
}
|
|
115
|
-
function R(a, b, e, d, c) {
|
|
116
|
-
var k = typeof a;
|
|
117
|
-
if ("undefined" === k || "boolean" === k) a = null;
|
|
118
|
-
var h = false;
|
|
119
|
-
if (null === a) h = true;
|
|
120
|
-
else switch (k) {
|
|
121
|
-
case "string":
|
|
122
|
-
case "number":
|
|
123
|
-
h = true;
|
|
124
|
-
break;
|
|
125
|
-
case "object":
|
|
126
|
-
switch (a.$$typeof) {
|
|
127
|
-
case l:
|
|
128
|
-
case n:
|
|
129
|
-
h = true;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (h) return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function(a2) {
|
|
133
|
-
return a2;
|
|
134
|
-
})) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1;
|
|
135
|
-
h = 0;
|
|
136
|
-
d = "" === d ? "." : d + ":";
|
|
137
|
-
if (I(a)) for (var g = 0; g < a.length; g++) {
|
|
138
|
-
k = a[g];
|
|
139
|
-
var f = d + Q(k, g);
|
|
140
|
-
h += R(k, b, e, f, c);
|
|
141
|
-
}
|
|
142
|
-
else if (f = A(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done; ) k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);
|
|
143
|
-
else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
|
|
144
|
-
return h;
|
|
145
|
-
}
|
|
146
|
-
function S(a, b, e) {
|
|
147
|
-
if (null == a) return a;
|
|
148
|
-
var d = [], c = 0;
|
|
149
|
-
R(a, d, "", "", function(a2) {
|
|
150
|
-
return b.call(e, a2, c++);
|
|
151
|
-
});
|
|
152
|
-
return d;
|
|
153
|
-
}
|
|
154
|
-
function T(a) {
|
|
155
|
-
if (-1 === a._status) {
|
|
156
|
-
var b = a._result;
|
|
157
|
-
b = b();
|
|
158
|
-
b.then(function(b2) {
|
|
159
|
-
if (0 === a._status || -1 === a._status) a._status = 1, a._result = b2;
|
|
160
|
-
}, function(b2) {
|
|
161
|
-
if (0 === a._status || -1 === a._status) a._status = 2, a._result = b2;
|
|
162
|
-
});
|
|
163
|
-
-1 === a._status && (a._status = 0, a._result = b);
|
|
164
|
-
}
|
|
165
|
-
if (1 === a._status) return a._result.default;
|
|
166
|
-
throw a._result;
|
|
167
|
-
}
|
|
168
|
-
var U = { current: null };
|
|
169
|
-
var V = { transition: null };
|
|
170
|
-
var W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
|
|
171
|
-
function X() {
|
|
172
|
-
throw Error("act(...) is not supported in production builds of React.");
|
|
173
|
-
}
|
|
174
|
-
exports.Children = { map: S, forEach: function(a, b, e) {
|
|
175
|
-
S(a, function() {
|
|
176
|
-
b.apply(this, arguments);
|
|
177
|
-
}, e);
|
|
178
|
-
}, count: function(a) {
|
|
179
|
-
var b = 0;
|
|
180
|
-
S(a, function() {
|
|
181
|
-
b++;
|
|
182
|
-
});
|
|
183
|
-
return b;
|
|
184
|
-
}, toArray: function(a) {
|
|
185
|
-
return S(a, function(a2) {
|
|
186
|
-
return a2;
|
|
187
|
-
}) || [];
|
|
188
|
-
}, only: function(a) {
|
|
189
|
-
if (!O(a)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
190
|
-
return a;
|
|
191
|
-
} };
|
|
192
|
-
exports.Component = E;
|
|
193
|
-
exports.Fragment = p;
|
|
194
|
-
exports.Profiler = r;
|
|
195
|
-
exports.PureComponent = G;
|
|
196
|
-
exports.StrictMode = q;
|
|
197
|
-
exports.Suspense = w;
|
|
198
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
|
|
199
|
-
exports.act = X;
|
|
200
|
-
exports.cloneElement = function(a, b, e) {
|
|
201
|
-
if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
202
|
-
var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
|
|
203
|
-
if (null != b) {
|
|
204
|
-
void 0 !== b.ref && (k = b.ref, h = K.current);
|
|
205
|
-
void 0 !== b.key && (c = "" + b.key);
|
|
206
|
-
if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
|
|
207
|
-
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
|
|
208
|
-
}
|
|
209
|
-
var f = arguments.length - 2;
|
|
210
|
-
if (1 === f) d.children = e;
|
|
211
|
-
else if (1 < f) {
|
|
212
|
-
g = Array(f);
|
|
213
|
-
for (var m = 0; m < f; m++) g[m] = arguments[m + 2];
|
|
214
|
-
d.children = g;
|
|
215
|
-
}
|
|
216
|
-
return { $$typeof: l, type: a.type, key: c, ref: k, props: d, _owner: h };
|
|
217
|
-
};
|
|
218
|
-
exports.createContext = function(a) {
|
|
219
|
-
a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
|
|
220
|
-
a.Provider = { $$typeof: t, _context: a };
|
|
221
|
-
return a.Consumer = a;
|
|
222
|
-
};
|
|
223
|
-
exports.createElement = M;
|
|
224
|
-
exports.createFactory = function(a) {
|
|
225
|
-
var b = M.bind(null, a);
|
|
226
|
-
b.type = a;
|
|
227
|
-
return b;
|
|
228
|
-
};
|
|
229
|
-
exports.createRef = function() {
|
|
230
|
-
return { current: null };
|
|
231
|
-
};
|
|
232
|
-
exports.forwardRef = function(a) {
|
|
233
|
-
return { $$typeof: v, render: a };
|
|
234
|
-
};
|
|
235
|
-
exports.isValidElement = O;
|
|
236
|
-
exports.lazy = function(a) {
|
|
237
|
-
return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
|
|
238
|
-
};
|
|
239
|
-
exports.memo = function(a, b) {
|
|
240
|
-
return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
|
|
241
|
-
};
|
|
242
|
-
exports.startTransition = function(a) {
|
|
243
|
-
var b = V.transition;
|
|
244
|
-
V.transition = {};
|
|
245
|
-
try {
|
|
246
|
-
a();
|
|
247
|
-
} finally {
|
|
248
|
-
V.transition = b;
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
exports.unstable_act = X;
|
|
252
|
-
exports.useCallback = function(a, b) {
|
|
253
|
-
return U.current.useCallback(a, b);
|
|
254
|
-
};
|
|
255
|
-
exports.useContext = function(a) {
|
|
256
|
-
return U.current.useContext(a);
|
|
257
|
-
};
|
|
258
|
-
exports.useDebugValue = function() {
|
|
259
|
-
};
|
|
260
|
-
exports.useDeferredValue = function(a) {
|
|
261
|
-
return U.current.useDeferredValue(a);
|
|
262
|
-
};
|
|
263
|
-
exports.useEffect = function(a, b) {
|
|
264
|
-
return U.current.useEffect(a, b);
|
|
265
|
-
};
|
|
266
|
-
exports.useId = function() {
|
|
267
|
-
return U.current.useId();
|
|
268
|
-
};
|
|
269
|
-
exports.useImperativeHandle = function(a, b, e) {
|
|
270
|
-
return U.current.useImperativeHandle(a, b, e);
|
|
271
|
-
};
|
|
272
|
-
exports.useInsertionEffect = function(a, b) {
|
|
273
|
-
return U.current.useInsertionEffect(a, b);
|
|
274
|
-
};
|
|
275
|
-
exports.useLayoutEffect = function(a, b) {
|
|
276
|
-
return U.current.useLayoutEffect(a, b);
|
|
277
|
-
};
|
|
278
|
-
exports.useMemo = function(a, b) {
|
|
279
|
-
return U.current.useMemo(a, b);
|
|
280
|
-
};
|
|
281
|
-
exports.useReducer = function(a, b, e) {
|
|
282
|
-
return U.current.useReducer(a, b, e);
|
|
283
|
-
};
|
|
284
|
-
exports.useRef = function(a) {
|
|
285
|
-
return U.current.useRef(a);
|
|
286
|
-
};
|
|
287
|
-
exports.useState = function(a) {
|
|
288
|
-
return U.current.useState(a);
|
|
289
|
-
};
|
|
290
|
-
exports.useSyncExternalStore = function(a, b, e) {
|
|
291
|
-
return U.current.useSyncExternalStore(a, b, e);
|
|
292
|
-
};
|
|
293
|
-
exports.useTransition = function() {
|
|
294
|
-
return U.current.useTransition();
|
|
295
|
-
};
|
|
296
|
-
exports.version = "18.3.1";
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
// ../../../node_modules/react/cjs/react.development.js
|
|
301
|
-
var require_react_development = __commonJS({
|
|
302
|
-
"../../../node_modules/react/cjs/react.development.js"(exports, module) {
|
|
303
|
-
"use strict";
|
|
304
|
-
if (process.env.NODE_ENV !== "production") {
|
|
305
|
-
(function() {
|
|
306
|
-
"use strict";
|
|
307
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
308
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
309
|
-
}
|
|
310
|
-
var ReactVersion = "18.3.1";
|
|
311
|
-
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
|
|
312
|
-
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
313
|
-
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
314
|
-
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
315
|
-
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
316
|
-
var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
|
|
317
|
-
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
318
|
-
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
319
|
-
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
320
|
-
var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
|
|
321
|
-
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
322
|
-
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
323
|
-
var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
|
|
324
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
325
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
326
|
-
function getIteratorFn(maybeIterable) {
|
|
327
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
328
|
-
return null;
|
|
329
|
-
}
|
|
330
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
331
|
-
if (typeof maybeIterator === "function") {
|
|
332
|
-
return maybeIterator;
|
|
333
|
-
}
|
|
334
|
-
return null;
|
|
335
|
-
}
|
|
336
|
-
var ReactCurrentDispatcher = {
|
|
337
|
-
/**
|
|
338
|
-
* @internal
|
|
339
|
-
* @type {ReactComponent}
|
|
340
|
-
*/
|
|
341
|
-
current: null
|
|
342
|
-
};
|
|
343
|
-
var ReactCurrentBatchConfig = {
|
|
344
|
-
transition: null
|
|
345
|
-
};
|
|
346
|
-
var ReactCurrentActQueue = {
|
|
347
|
-
current: null,
|
|
348
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
349
|
-
isBatchingLegacy: false,
|
|
350
|
-
didScheduleLegacyUpdate: false
|
|
351
|
-
};
|
|
352
|
-
var ReactCurrentOwner = {
|
|
353
|
-
/**
|
|
354
|
-
* @internal
|
|
355
|
-
* @type {ReactComponent}
|
|
356
|
-
*/
|
|
357
|
-
current: null
|
|
358
|
-
};
|
|
359
|
-
var ReactDebugCurrentFrame = {};
|
|
360
|
-
var currentExtraStackFrame = null;
|
|
361
|
-
function setExtraStackFrame(stack) {
|
|
362
|
-
{
|
|
363
|
-
currentExtraStackFrame = stack;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
{
|
|
367
|
-
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
|
368
|
-
{
|
|
369
|
-
currentExtraStackFrame = stack;
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
373
|
-
ReactDebugCurrentFrame.getStackAddendum = function() {
|
|
374
|
-
var stack = "";
|
|
375
|
-
if (currentExtraStackFrame) {
|
|
376
|
-
stack += currentExtraStackFrame;
|
|
377
|
-
}
|
|
378
|
-
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
379
|
-
if (impl) {
|
|
380
|
-
stack += impl() || "";
|
|
381
|
-
}
|
|
382
|
-
return stack;
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
var enableScopeAPI = false;
|
|
386
|
-
var enableCacheElement = false;
|
|
387
|
-
var enableTransitionTracing = false;
|
|
388
|
-
var enableLegacyHidden = false;
|
|
389
|
-
var enableDebugTracing = false;
|
|
390
|
-
var ReactSharedInternals = {
|
|
391
|
-
ReactCurrentDispatcher,
|
|
392
|
-
ReactCurrentBatchConfig,
|
|
393
|
-
ReactCurrentOwner
|
|
394
|
-
};
|
|
395
|
-
{
|
|
396
|
-
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
397
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
398
|
-
}
|
|
399
|
-
function warn(format) {
|
|
400
|
-
{
|
|
401
|
-
{
|
|
402
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
403
|
-
args[_key - 1] = arguments[_key];
|
|
404
|
-
}
|
|
405
|
-
printWarning("warn", format, args);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
function error(format) {
|
|
410
|
-
{
|
|
411
|
-
{
|
|
412
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
413
|
-
args[_key2 - 1] = arguments[_key2];
|
|
414
|
-
}
|
|
415
|
-
printWarning("error", format, args);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
function printWarning(level, format, args) {
|
|
420
|
-
{
|
|
421
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
422
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
423
|
-
if (stack !== "") {
|
|
424
|
-
format += "%s";
|
|
425
|
-
args = args.concat([stack]);
|
|
426
|
-
}
|
|
427
|
-
var argsWithFormat = args.map(function(item) {
|
|
428
|
-
return String(item);
|
|
429
|
-
});
|
|
430
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
431
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
var didWarnStateUpdateForUnmountedComponent = {};
|
|
435
|
-
function warnNoop(publicInstance, callerName) {
|
|
436
|
-
{
|
|
437
|
-
var _constructor = publicInstance.constructor;
|
|
438
|
-
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
|
|
439
|
-
var warningKey = componentName + "." + callerName;
|
|
440
|
-
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
|
|
444
|
-
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
var ReactNoopUpdateQueue = {
|
|
448
|
-
/**
|
|
449
|
-
* Checks whether or not this composite component is mounted.
|
|
450
|
-
* @param {ReactClass} publicInstance The instance we want to test.
|
|
451
|
-
* @return {boolean} True if mounted, false otherwise.
|
|
452
|
-
* @protected
|
|
453
|
-
* @final
|
|
454
|
-
*/
|
|
455
|
-
isMounted: function(publicInstance) {
|
|
456
|
-
return false;
|
|
457
|
-
},
|
|
458
|
-
/**
|
|
459
|
-
* Forces an update. This should only be invoked when it is known with
|
|
460
|
-
* certainty that we are **not** in a DOM transaction.
|
|
461
|
-
*
|
|
462
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
463
|
-
* component's state has changed but `setState` was not called.
|
|
464
|
-
*
|
|
465
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
466
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
467
|
-
*
|
|
468
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
469
|
-
* @param {?function} callback Called after component is updated.
|
|
470
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
471
|
-
* @internal
|
|
472
|
-
*/
|
|
473
|
-
enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
|
474
|
-
warnNoop(publicInstance, "forceUpdate");
|
|
475
|
-
},
|
|
476
|
-
/**
|
|
477
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
478
|
-
* You should treat `this.state` as immutable.
|
|
479
|
-
*
|
|
480
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
481
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
482
|
-
*
|
|
483
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
484
|
-
* @param {object} completeState Next state.
|
|
485
|
-
* @param {?function} callback Called after component is updated.
|
|
486
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
487
|
-
* @internal
|
|
488
|
-
*/
|
|
489
|
-
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
|
490
|
-
warnNoop(publicInstance, "replaceState");
|
|
491
|
-
},
|
|
492
|
-
/**
|
|
493
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
|
494
|
-
* internal. This provides a merging strategy that is not available to deep
|
|
495
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
496
|
-
* during the merge.
|
|
497
|
-
*
|
|
498
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
499
|
-
* @param {object} partialState Next partial state to be merged with state.
|
|
500
|
-
* @param {?function} callback Called after component is updated.
|
|
501
|
-
* @param {?string} Name of the calling function in the public API.
|
|
502
|
-
* @internal
|
|
503
|
-
*/
|
|
504
|
-
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
|
505
|
-
warnNoop(publicInstance, "setState");
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
var assign = Object.assign;
|
|
509
|
-
var emptyObject = {};
|
|
510
|
-
{
|
|
511
|
-
Object.freeze(emptyObject);
|
|
512
|
-
}
|
|
513
|
-
function Component(props, context, updater) {
|
|
514
|
-
this.props = props;
|
|
515
|
-
this.context = context;
|
|
516
|
-
this.refs = emptyObject;
|
|
517
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
518
|
-
}
|
|
519
|
-
Component.prototype.isReactComponent = {};
|
|
520
|
-
Component.prototype.setState = function(partialState, callback) {
|
|
521
|
-
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
|
|
522
|
-
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
523
|
-
}
|
|
524
|
-
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
525
|
-
};
|
|
526
|
-
Component.prototype.forceUpdate = function(callback) {
|
|
527
|
-
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
528
|
-
};
|
|
529
|
-
{
|
|
530
|
-
var deprecatedAPIs = {
|
|
531
|
-
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
|
532
|
-
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
|
533
|
-
};
|
|
534
|
-
var defineDeprecationWarning = function(methodName, info) {
|
|
535
|
-
Object.defineProperty(Component.prototype, methodName, {
|
|
536
|
-
get: function() {
|
|
537
|
-
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
538
|
-
return void 0;
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
};
|
|
542
|
-
for (var fnName in deprecatedAPIs) {
|
|
543
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
544
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
function ComponentDummy() {
|
|
549
|
-
}
|
|
550
|
-
ComponentDummy.prototype = Component.prototype;
|
|
551
|
-
function PureComponent(props, context, updater) {
|
|
552
|
-
this.props = props;
|
|
553
|
-
this.context = context;
|
|
554
|
-
this.refs = emptyObject;
|
|
555
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
556
|
-
}
|
|
557
|
-
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
558
|
-
pureComponentPrototype.constructor = PureComponent;
|
|
559
|
-
assign(pureComponentPrototype, Component.prototype);
|
|
560
|
-
pureComponentPrototype.isPureReactComponent = true;
|
|
561
|
-
function createRef() {
|
|
562
|
-
var refObject = {
|
|
563
|
-
current: null
|
|
564
|
-
};
|
|
565
|
-
{
|
|
566
|
-
Object.seal(refObject);
|
|
567
|
-
}
|
|
568
|
-
return refObject;
|
|
569
|
-
}
|
|
570
|
-
var isArrayImpl = Array.isArray;
|
|
571
|
-
function isArray(a) {
|
|
572
|
-
return isArrayImpl(a);
|
|
573
|
-
}
|
|
574
|
-
function typeName(value) {
|
|
575
|
-
{
|
|
576
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
577
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
578
|
-
return type;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
function willCoercionThrow(value) {
|
|
582
|
-
{
|
|
583
|
-
try {
|
|
584
|
-
testStringCoercion(value);
|
|
585
|
-
return false;
|
|
586
|
-
} catch (e) {
|
|
587
|
-
return true;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
function testStringCoercion(value) {
|
|
592
|
-
return "" + value;
|
|
593
|
-
}
|
|
594
|
-
function checkKeyStringCoercion(value) {
|
|
595
|
-
{
|
|
596
|
-
if (willCoercionThrow(value)) {
|
|
597
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
598
|
-
return testStringCoercion(value);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
603
|
-
var displayName = outerType.displayName;
|
|
604
|
-
if (displayName) {
|
|
605
|
-
return displayName;
|
|
606
|
-
}
|
|
607
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
608
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
609
|
-
}
|
|
610
|
-
function getContextName(type) {
|
|
611
|
-
return type.displayName || "Context";
|
|
612
|
-
}
|
|
613
|
-
function getComponentNameFromType(type) {
|
|
614
|
-
if (type == null) {
|
|
615
|
-
return null;
|
|
616
|
-
}
|
|
617
|
-
{
|
|
618
|
-
if (typeof type.tag === "number") {
|
|
619
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
if (typeof type === "function") {
|
|
623
|
-
return type.displayName || type.name || null;
|
|
624
|
-
}
|
|
625
|
-
if (typeof type === "string") {
|
|
626
|
-
return type;
|
|
627
|
-
}
|
|
628
|
-
switch (type) {
|
|
629
|
-
case REACT_FRAGMENT_TYPE:
|
|
630
|
-
return "Fragment";
|
|
631
|
-
case REACT_PORTAL_TYPE:
|
|
632
|
-
return "Portal";
|
|
633
|
-
case REACT_PROFILER_TYPE:
|
|
634
|
-
return "Profiler";
|
|
635
|
-
case REACT_STRICT_MODE_TYPE:
|
|
636
|
-
return "StrictMode";
|
|
637
|
-
case REACT_SUSPENSE_TYPE:
|
|
638
|
-
return "Suspense";
|
|
639
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
640
|
-
return "SuspenseList";
|
|
641
|
-
}
|
|
642
|
-
if (typeof type === "object") {
|
|
643
|
-
switch (type.$$typeof) {
|
|
644
|
-
case REACT_CONTEXT_TYPE:
|
|
645
|
-
var context = type;
|
|
646
|
-
return getContextName(context) + ".Consumer";
|
|
647
|
-
case REACT_PROVIDER_TYPE:
|
|
648
|
-
var provider = type;
|
|
649
|
-
return getContextName(provider._context) + ".Provider";
|
|
650
|
-
case REACT_FORWARD_REF_TYPE:
|
|
651
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
652
|
-
case REACT_MEMO_TYPE:
|
|
653
|
-
var outerName = type.displayName || null;
|
|
654
|
-
if (outerName !== null) {
|
|
655
|
-
return outerName;
|
|
656
|
-
}
|
|
657
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
658
|
-
case REACT_LAZY_TYPE: {
|
|
659
|
-
var lazyComponent = type;
|
|
660
|
-
var payload = lazyComponent._payload;
|
|
661
|
-
var init = lazyComponent._init;
|
|
662
|
-
try {
|
|
663
|
-
return getComponentNameFromType(init(payload));
|
|
664
|
-
} catch (x) {
|
|
665
|
-
return null;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
return null;
|
|
671
|
-
}
|
|
672
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
673
|
-
var RESERVED_PROPS = {
|
|
674
|
-
key: true,
|
|
675
|
-
ref: true,
|
|
676
|
-
__self: true,
|
|
677
|
-
__source: true
|
|
678
|
-
};
|
|
679
|
-
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
680
|
-
{
|
|
681
|
-
didWarnAboutStringRefs = {};
|
|
682
|
-
}
|
|
683
|
-
function hasValidRef(config) {
|
|
684
|
-
{
|
|
685
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
686
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
687
|
-
if (getter && getter.isReactWarning) {
|
|
688
|
-
return false;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
return config.ref !== void 0;
|
|
693
|
-
}
|
|
694
|
-
function hasValidKey(config) {
|
|
695
|
-
{
|
|
696
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
697
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
698
|
-
if (getter && getter.isReactWarning) {
|
|
699
|
-
return false;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
return config.key !== void 0;
|
|
704
|
-
}
|
|
705
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
706
|
-
var warnAboutAccessingKey = function() {
|
|
707
|
-
{
|
|
708
|
-
if (!specialPropKeyWarningShown) {
|
|
709
|
-
specialPropKeyWarningShown = true;
|
|
710
|
-
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);
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
715
|
-
Object.defineProperty(props, "key", {
|
|
716
|
-
get: warnAboutAccessingKey,
|
|
717
|
-
configurable: true
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
721
|
-
var warnAboutAccessingRef = function() {
|
|
722
|
-
{
|
|
723
|
-
if (!specialPropRefWarningShown) {
|
|
724
|
-
specialPropRefWarningShown = true;
|
|
725
|
-
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);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
730
|
-
Object.defineProperty(props, "ref", {
|
|
731
|
-
get: warnAboutAccessingRef,
|
|
732
|
-
configurable: true
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
736
|
-
{
|
|
737
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
738
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
739
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
740
|
-
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
|
741
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
747
|
-
var element = {
|
|
748
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
749
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
750
|
-
// Built-in properties that belong on the element
|
|
751
|
-
type,
|
|
752
|
-
key,
|
|
753
|
-
ref,
|
|
754
|
-
props,
|
|
755
|
-
// Record the component responsible for creating this element.
|
|
756
|
-
_owner: owner
|
|
757
|
-
};
|
|
758
|
-
{
|
|
759
|
-
element._store = {};
|
|
760
|
-
Object.defineProperty(element._store, "validated", {
|
|
761
|
-
configurable: false,
|
|
762
|
-
enumerable: false,
|
|
763
|
-
writable: true,
|
|
764
|
-
value: false
|
|
765
|
-
});
|
|
766
|
-
Object.defineProperty(element, "_self", {
|
|
767
|
-
configurable: false,
|
|
768
|
-
enumerable: false,
|
|
769
|
-
writable: false,
|
|
770
|
-
value: self
|
|
771
|
-
});
|
|
772
|
-
Object.defineProperty(element, "_source", {
|
|
773
|
-
configurable: false,
|
|
774
|
-
enumerable: false,
|
|
775
|
-
writable: false,
|
|
776
|
-
value: source
|
|
777
|
-
});
|
|
778
|
-
if (Object.freeze) {
|
|
779
|
-
Object.freeze(element.props);
|
|
780
|
-
Object.freeze(element);
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
return element;
|
|
784
|
-
};
|
|
785
|
-
function createElement(type, config, children) {
|
|
786
|
-
var propName;
|
|
787
|
-
var props = {};
|
|
788
|
-
var key = null;
|
|
789
|
-
var ref = null;
|
|
790
|
-
var self = null;
|
|
791
|
-
var source = null;
|
|
792
|
-
if (config != null) {
|
|
793
|
-
if (hasValidRef(config)) {
|
|
794
|
-
ref = config.ref;
|
|
795
|
-
{
|
|
796
|
-
warnIfStringRefCannotBeAutoConverted(config);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
if (hasValidKey(config)) {
|
|
800
|
-
{
|
|
801
|
-
checkKeyStringCoercion(config.key);
|
|
802
|
-
}
|
|
803
|
-
key = "" + config.key;
|
|
804
|
-
}
|
|
805
|
-
self = config.__self === void 0 ? null : config.__self;
|
|
806
|
-
source = config.__source === void 0 ? null : config.__source;
|
|
807
|
-
for (propName in config) {
|
|
808
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
809
|
-
props[propName] = config[propName];
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
var childrenLength = arguments.length - 2;
|
|
814
|
-
if (childrenLength === 1) {
|
|
815
|
-
props.children = children;
|
|
816
|
-
} else if (childrenLength > 1) {
|
|
817
|
-
var childArray = Array(childrenLength);
|
|
818
|
-
for (var i = 0; i < childrenLength; i++) {
|
|
819
|
-
childArray[i] = arguments[i + 2];
|
|
820
|
-
}
|
|
821
|
-
{
|
|
822
|
-
if (Object.freeze) {
|
|
823
|
-
Object.freeze(childArray);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
props.children = childArray;
|
|
827
|
-
}
|
|
828
|
-
if (type && type.defaultProps) {
|
|
829
|
-
var defaultProps = type.defaultProps;
|
|
830
|
-
for (propName in defaultProps) {
|
|
831
|
-
if (props[propName] === void 0) {
|
|
832
|
-
props[propName] = defaultProps[propName];
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
{
|
|
837
|
-
if (key || ref) {
|
|
838
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
839
|
-
if (key) {
|
|
840
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
841
|
-
}
|
|
842
|
-
if (ref) {
|
|
843
|
-
defineRefPropWarningGetter(props, displayName);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
848
|
-
}
|
|
849
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
|
850
|
-
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
851
|
-
return newElement;
|
|
852
|
-
}
|
|
853
|
-
function cloneElement(element, config, children) {
|
|
854
|
-
if (element === null || element === void 0) {
|
|
855
|
-
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
856
|
-
}
|
|
857
|
-
var propName;
|
|
858
|
-
var props = assign({}, element.props);
|
|
859
|
-
var key = element.key;
|
|
860
|
-
var ref = element.ref;
|
|
861
|
-
var self = element._self;
|
|
862
|
-
var source = element._source;
|
|
863
|
-
var owner = element._owner;
|
|
864
|
-
if (config != null) {
|
|
865
|
-
if (hasValidRef(config)) {
|
|
866
|
-
ref = config.ref;
|
|
867
|
-
owner = ReactCurrentOwner.current;
|
|
868
|
-
}
|
|
869
|
-
if (hasValidKey(config)) {
|
|
870
|
-
{
|
|
871
|
-
checkKeyStringCoercion(config.key);
|
|
872
|
-
}
|
|
873
|
-
key = "" + config.key;
|
|
874
|
-
}
|
|
875
|
-
var defaultProps;
|
|
876
|
-
if (element.type && element.type.defaultProps) {
|
|
877
|
-
defaultProps = element.type.defaultProps;
|
|
878
|
-
}
|
|
879
|
-
for (propName in config) {
|
|
880
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
881
|
-
if (config[propName] === void 0 && defaultProps !== void 0) {
|
|
882
|
-
props[propName] = defaultProps[propName];
|
|
883
|
-
} else {
|
|
884
|
-
props[propName] = config[propName];
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
var childrenLength = arguments.length - 2;
|
|
890
|
-
if (childrenLength === 1) {
|
|
891
|
-
props.children = children;
|
|
892
|
-
} else if (childrenLength > 1) {
|
|
893
|
-
var childArray = Array(childrenLength);
|
|
894
|
-
for (var i = 0; i < childrenLength; i++) {
|
|
895
|
-
childArray[i] = arguments[i + 2];
|
|
896
|
-
}
|
|
897
|
-
props.children = childArray;
|
|
898
|
-
}
|
|
899
|
-
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
900
|
-
}
|
|
901
|
-
function isValidElement2(object) {
|
|
902
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
903
|
-
}
|
|
904
|
-
var SEPARATOR = ".";
|
|
905
|
-
var SUBSEPARATOR = ":";
|
|
906
|
-
function escape(key) {
|
|
907
|
-
var escapeRegex = /[=:]/g;
|
|
908
|
-
var escaperLookup = {
|
|
909
|
-
"=": "=0",
|
|
910
|
-
":": "=2"
|
|
911
|
-
};
|
|
912
|
-
var escapedString = key.replace(escapeRegex, function(match) {
|
|
913
|
-
return escaperLookup[match];
|
|
914
|
-
});
|
|
915
|
-
return "$" + escapedString;
|
|
916
|
-
}
|
|
917
|
-
var didWarnAboutMaps = false;
|
|
918
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
919
|
-
function escapeUserProvidedKey(text) {
|
|
920
|
-
return text.replace(userProvidedKeyEscapeRegex, "$&/");
|
|
921
|
-
}
|
|
922
|
-
function getElementKey(element, index) {
|
|
923
|
-
if (typeof element === "object" && element !== null && element.key != null) {
|
|
924
|
-
{
|
|
925
|
-
checkKeyStringCoercion(element.key);
|
|
926
|
-
}
|
|
927
|
-
return escape("" + element.key);
|
|
928
|
-
}
|
|
929
|
-
return index.toString(36);
|
|
930
|
-
}
|
|
931
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
932
|
-
var type = typeof children;
|
|
933
|
-
if (type === "undefined" || type === "boolean") {
|
|
934
|
-
children = null;
|
|
935
|
-
}
|
|
936
|
-
var invokeCallback = false;
|
|
937
|
-
if (children === null) {
|
|
938
|
-
invokeCallback = true;
|
|
939
|
-
} else {
|
|
940
|
-
switch (type) {
|
|
941
|
-
case "string":
|
|
942
|
-
case "number":
|
|
943
|
-
invokeCallback = true;
|
|
944
|
-
break;
|
|
945
|
-
case "object":
|
|
946
|
-
switch (children.$$typeof) {
|
|
947
|
-
case REACT_ELEMENT_TYPE:
|
|
948
|
-
case REACT_PORTAL_TYPE:
|
|
949
|
-
invokeCallback = true;
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
if (invokeCallback) {
|
|
954
|
-
var _child = children;
|
|
955
|
-
var mappedChild = callback(_child);
|
|
956
|
-
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
957
|
-
if (isArray(mappedChild)) {
|
|
958
|
-
var escapedChildKey = "";
|
|
959
|
-
if (childKey != null) {
|
|
960
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
|
961
|
-
}
|
|
962
|
-
mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
|
|
963
|
-
return c;
|
|
964
|
-
});
|
|
965
|
-
} else if (mappedChild != null) {
|
|
966
|
-
if (isValidElement2(mappedChild)) {
|
|
967
|
-
{
|
|
968
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
969
|
-
checkKeyStringCoercion(mappedChild.key);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
mappedChild = cloneAndReplaceKey(
|
|
973
|
-
mappedChild,
|
|
974
|
-
// Keep both the (mapped) and old keys if they differ, just as
|
|
975
|
-
// traverseAllChildren used to do for objects as children
|
|
976
|
-
escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
977
|
-
(mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
|
|
978
|
-
// $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
979
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
980
|
-
escapeUserProvidedKey("" + mappedChild.key) + "/"
|
|
981
|
-
) : "") + childKey
|
|
982
|
-
);
|
|
983
|
-
}
|
|
984
|
-
array.push(mappedChild);
|
|
985
|
-
}
|
|
986
|
-
return 1;
|
|
987
|
-
}
|
|
988
|
-
var child;
|
|
989
|
-
var nextName;
|
|
990
|
-
var subtreeCount = 0;
|
|
991
|
-
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
992
|
-
if (isArray(children)) {
|
|
993
|
-
for (var i = 0; i < children.length; i++) {
|
|
994
|
-
child = children[i];
|
|
995
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
|
996
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
997
|
-
}
|
|
998
|
-
} else {
|
|
999
|
-
var iteratorFn = getIteratorFn(children);
|
|
1000
|
-
if (typeof iteratorFn === "function") {
|
|
1001
|
-
var iterableChildren = children;
|
|
1002
|
-
{
|
|
1003
|
-
if (iteratorFn === iterableChildren.entries) {
|
|
1004
|
-
if (!didWarnAboutMaps) {
|
|
1005
|
-
warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
|
1006
|
-
}
|
|
1007
|
-
didWarnAboutMaps = true;
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
var iterator = iteratorFn.call(iterableChildren);
|
|
1011
|
-
var step;
|
|
1012
|
-
var ii = 0;
|
|
1013
|
-
while (!(step = iterator.next()).done) {
|
|
1014
|
-
child = step.value;
|
|
1015
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1016
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1017
|
-
}
|
|
1018
|
-
} else if (type === "object") {
|
|
1019
|
-
var childrenString = String(children);
|
|
1020
|
-
throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
return subtreeCount;
|
|
1024
|
-
}
|
|
1025
|
-
function mapChildren(children, func, context) {
|
|
1026
|
-
if (children == null) {
|
|
1027
|
-
return children;
|
|
1028
|
-
}
|
|
1029
|
-
var result = [];
|
|
1030
|
-
var count = 0;
|
|
1031
|
-
mapIntoArray(children, result, "", "", function(child) {
|
|
1032
|
-
return func.call(context, child, count++);
|
|
1033
|
-
});
|
|
1034
|
-
return result;
|
|
1035
|
-
}
|
|
1036
|
-
function countChildren(children) {
|
|
1037
|
-
var n = 0;
|
|
1038
|
-
mapChildren(children, function() {
|
|
1039
|
-
n++;
|
|
1040
|
-
});
|
|
1041
|
-
return n;
|
|
1042
|
-
}
|
|
1043
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1044
|
-
mapChildren(children, function() {
|
|
1045
|
-
forEachFunc.apply(this, arguments);
|
|
1046
|
-
}, forEachContext);
|
|
1047
|
-
}
|
|
1048
|
-
function toArray(children) {
|
|
1049
|
-
return mapChildren(children, function(child) {
|
|
1050
|
-
return child;
|
|
1051
|
-
}) || [];
|
|
1052
|
-
}
|
|
1053
|
-
function onlyChild(children) {
|
|
1054
|
-
if (!isValidElement2(children)) {
|
|
1055
|
-
throw new Error("React.Children.only expected to receive a single React element child.");
|
|
1056
|
-
}
|
|
1057
|
-
return children;
|
|
1058
|
-
}
|
|
1059
|
-
function createContext(defaultValue) {
|
|
1060
|
-
var context = {
|
|
1061
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
1062
|
-
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1063
|
-
// some renderers as primary and others as secondary. We only expect
|
|
1064
|
-
// there to be two concurrent renderers at most: React Native (primary) and
|
|
1065
|
-
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
1066
|
-
// Secondary renderers store their context values on separate fields.
|
|
1067
|
-
_currentValue: defaultValue,
|
|
1068
|
-
_currentValue2: defaultValue,
|
|
1069
|
-
// Used to track how many concurrent renderers this context currently
|
|
1070
|
-
// supports within in a single renderer. Such as parallel server rendering.
|
|
1071
|
-
_threadCount: 0,
|
|
1072
|
-
// These are circular
|
|
1073
|
-
Provider: null,
|
|
1074
|
-
Consumer: null,
|
|
1075
|
-
// Add these to use same hidden class in VM as ServerContext
|
|
1076
|
-
_defaultValue: null,
|
|
1077
|
-
_globalName: null
|
|
1078
|
-
};
|
|
1079
|
-
context.Provider = {
|
|
1080
|
-
$$typeof: REACT_PROVIDER_TYPE,
|
|
1081
|
-
_context: context
|
|
1082
|
-
};
|
|
1083
|
-
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1084
|
-
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1085
|
-
var hasWarnedAboutDisplayNameOnConsumer = false;
|
|
1086
|
-
{
|
|
1087
|
-
var Consumer = {
|
|
1088
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
1089
|
-
_context: context
|
|
1090
|
-
};
|
|
1091
|
-
Object.defineProperties(Consumer, {
|
|
1092
|
-
Provider: {
|
|
1093
|
-
get: function() {
|
|
1094
|
-
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
1095
|
-
hasWarnedAboutUsingConsumerProvider = true;
|
|
1096
|
-
error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
|
|
1097
|
-
}
|
|
1098
|
-
return context.Provider;
|
|
1099
|
-
},
|
|
1100
|
-
set: function(_Provider) {
|
|
1101
|
-
context.Provider = _Provider;
|
|
1102
|
-
}
|
|
1103
|
-
},
|
|
1104
|
-
_currentValue: {
|
|
1105
|
-
get: function() {
|
|
1106
|
-
return context._currentValue;
|
|
1107
|
-
},
|
|
1108
|
-
set: function(_currentValue) {
|
|
1109
|
-
context._currentValue = _currentValue;
|
|
1110
|
-
}
|
|
1111
|
-
},
|
|
1112
|
-
_currentValue2: {
|
|
1113
|
-
get: function() {
|
|
1114
|
-
return context._currentValue2;
|
|
1115
|
-
},
|
|
1116
|
-
set: function(_currentValue2) {
|
|
1117
|
-
context._currentValue2 = _currentValue2;
|
|
1118
|
-
}
|
|
1119
|
-
},
|
|
1120
|
-
_threadCount: {
|
|
1121
|
-
get: function() {
|
|
1122
|
-
return context._threadCount;
|
|
1123
|
-
},
|
|
1124
|
-
set: function(_threadCount) {
|
|
1125
|
-
context._threadCount = _threadCount;
|
|
1126
|
-
}
|
|
1127
|
-
},
|
|
1128
|
-
Consumer: {
|
|
1129
|
-
get: function() {
|
|
1130
|
-
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
1131
|
-
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1132
|
-
error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
|
1133
|
-
}
|
|
1134
|
-
return context.Consumer;
|
|
1135
|
-
}
|
|
1136
|
-
},
|
|
1137
|
-
displayName: {
|
|
1138
|
-
get: function() {
|
|
1139
|
-
return context.displayName;
|
|
1140
|
-
},
|
|
1141
|
-
set: function(displayName) {
|
|
1142
|
-
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
1143
|
-
warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
1144
|
-
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
});
|
|
1149
|
-
context.Consumer = Consumer;
|
|
1150
|
-
}
|
|
1151
|
-
{
|
|
1152
|
-
context._currentRenderer = null;
|
|
1153
|
-
context._currentRenderer2 = null;
|
|
1154
|
-
}
|
|
1155
|
-
return context;
|
|
1156
|
-
}
|
|
1157
|
-
var Uninitialized = -1;
|
|
1158
|
-
var Pending = 0;
|
|
1159
|
-
var Resolved = 1;
|
|
1160
|
-
var Rejected = 2;
|
|
1161
|
-
function lazyInitializer(payload) {
|
|
1162
|
-
if (payload._status === Uninitialized) {
|
|
1163
|
-
var ctor = payload._result;
|
|
1164
|
-
var thenable = ctor();
|
|
1165
|
-
thenable.then(function(moduleObject2) {
|
|
1166
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1167
|
-
var resolved = payload;
|
|
1168
|
-
resolved._status = Resolved;
|
|
1169
|
-
resolved._result = moduleObject2;
|
|
1170
|
-
}
|
|
1171
|
-
}, function(error2) {
|
|
1172
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1173
|
-
var rejected = payload;
|
|
1174
|
-
rejected._status = Rejected;
|
|
1175
|
-
rejected._result = error2;
|
|
1176
|
-
}
|
|
1177
|
-
});
|
|
1178
|
-
if (payload._status === Uninitialized) {
|
|
1179
|
-
var pending = payload;
|
|
1180
|
-
pending._status = Pending;
|
|
1181
|
-
pending._result = thenable;
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
if (payload._status === Resolved) {
|
|
1185
|
-
var moduleObject = payload._result;
|
|
1186
|
-
{
|
|
1187
|
-
if (moduleObject === void 0) {
|
|
1188
|
-
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
{
|
|
1192
|
-
if (!("default" in moduleObject)) {
|
|
1193
|
-
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
return moduleObject.default;
|
|
1197
|
-
} else {
|
|
1198
|
-
throw payload._result;
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
function lazy(ctor) {
|
|
1202
|
-
var payload = {
|
|
1203
|
-
// We use these fields to store the result.
|
|
1204
|
-
_status: Uninitialized,
|
|
1205
|
-
_result: ctor
|
|
1206
|
-
};
|
|
1207
|
-
var lazyType = {
|
|
1208
|
-
$$typeof: REACT_LAZY_TYPE,
|
|
1209
|
-
_payload: payload,
|
|
1210
|
-
_init: lazyInitializer
|
|
1211
|
-
};
|
|
1212
|
-
{
|
|
1213
|
-
var defaultProps;
|
|
1214
|
-
var propTypes;
|
|
1215
|
-
Object.defineProperties(lazyType, {
|
|
1216
|
-
defaultProps: {
|
|
1217
|
-
configurable: true,
|
|
1218
|
-
get: function() {
|
|
1219
|
-
return defaultProps;
|
|
1220
|
-
},
|
|
1221
|
-
set: function(newDefaultProps) {
|
|
1222
|
-
error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
1223
|
-
defaultProps = newDefaultProps;
|
|
1224
|
-
Object.defineProperty(lazyType, "defaultProps", {
|
|
1225
|
-
enumerable: true
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
},
|
|
1229
|
-
propTypes: {
|
|
1230
|
-
configurable: true,
|
|
1231
|
-
get: function() {
|
|
1232
|
-
return propTypes;
|
|
1233
|
-
},
|
|
1234
|
-
set: function(newPropTypes) {
|
|
1235
|
-
error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
1236
|
-
propTypes = newPropTypes;
|
|
1237
|
-
Object.defineProperty(lazyType, "propTypes", {
|
|
1238
|
-
enumerable: true
|
|
1239
|
-
});
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
return lazyType;
|
|
1245
|
-
}
|
|
1246
|
-
function forwardRef(render) {
|
|
1247
|
-
{
|
|
1248
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1249
|
-
error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
|
1250
|
-
} else if (typeof render !== "function") {
|
|
1251
|
-
error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
|
|
1252
|
-
} else {
|
|
1253
|
-
if (render.length !== 0 && render.length !== 2) {
|
|
1254
|
-
error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
if (render != null) {
|
|
1258
|
-
if (render.defaultProps != null || render.propTypes != null) {
|
|
1259
|
-
error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
var elementType = {
|
|
1264
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1265
|
-
render
|
|
1266
|
-
};
|
|
1267
|
-
{
|
|
1268
|
-
var ownName;
|
|
1269
|
-
Object.defineProperty(elementType, "displayName", {
|
|
1270
|
-
enumerable: false,
|
|
1271
|
-
configurable: true,
|
|
1272
|
-
get: function() {
|
|
1273
|
-
return ownName;
|
|
1274
|
-
},
|
|
1275
|
-
set: function(name) {
|
|
1276
|
-
ownName = name;
|
|
1277
|
-
if (!render.name && !render.displayName) {
|
|
1278
|
-
render.displayName = name;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
return elementType;
|
|
1284
|
-
}
|
|
1285
|
-
var REACT_MODULE_REFERENCE;
|
|
1286
|
-
{
|
|
1287
|
-
REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
1288
|
-
}
|
|
1289
|
-
function isValidElementType(type) {
|
|
1290
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
1291
|
-
return true;
|
|
1292
|
-
}
|
|
1293
|
-
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) {
|
|
1294
|
-
return true;
|
|
1295
|
-
}
|
|
1296
|
-
if (typeof type === "object" && type !== null) {
|
|
1297
|
-
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
|
|
1298
|
-
// types supported by any Flight configuration anywhere since
|
|
1299
|
-
// we don't know which Flight build this will end up being used
|
|
1300
|
-
// with.
|
|
1301
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1302
|
-
return true;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
return false;
|
|
1306
|
-
}
|
|
1307
|
-
function memo(type, compare) {
|
|
1308
|
-
{
|
|
1309
|
-
if (!isValidElementType(type)) {
|
|
1310
|
-
error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
var elementType = {
|
|
1314
|
-
$$typeof: REACT_MEMO_TYPE,
|
|
1315
|
-
type,
|
|
1316
|
-
compare: compare === void 0 ? null : compare
|
|
1317
|
-
};
|
|
1318
|
-
{
|
|
1319
|
-
var ownName;
|
|
1320
|
-
Object.defineProperty(elementType, "displayName", {
|
|
1321
|
-
enumerable: false,
|
|
1322
|
-
configurable: true,
|
|
1323
|
-
get: function() {
|
|
1324
|
-
return ownName;
|
|
1325
|
-
},
|
|
1326
|
-
set: function(name) {
|
|
1327
|
-
ownName = name;
|
|
1328
|
-
if (!type.name && !type.displayName) {
|
|
1329
|
-
type.displayName = name;
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
});
|
|
1333
|
-
}
|
|
1334
|
-
return elementType;
|
|
1335
|
-
}
|
|
1336
|
-
function resolveDispatcher() {
|
|
1337
|
-
var dispatcher = ReactCurrentDispatcher.current;
|
|
1338
|
-
{
|
|
1339
|
-
if (dispatcher === null) {
|
|
1340
|
-
error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
return dispatcher;
|
|
1344
|
-
}
|
|
1345
|
-
function useContext(Context) {
|
|
1346
|
-
var dispatcher = resolveDispatcher();
|
|
1347
|
-
{
|
|
1348
|
-
if (Context._context !== void 0) {
|
|
1349
|
-
var realContext = Context._context;
|
|
1350
|
-
if (realContext.Consumer === Context) {
|
|
1351
|
-
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
1352
|
-
} else if (realContext.Provider === Context) {
|
|
1353
|
-
error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
return dispatcher.useContext(Context);
|
|
1358
|
-
}
|
|
1359
|
-
function useState(initialState) {
|
|
1360
|
-
var dispatcher = resolveDispatcher();
|
|
1361
|
-
return dispatcher.useState(initialState);
|
|
1362
|
-
}
|
|
1363
|
-
function useReducer(reducer, initialArg, init) {
|
|
1364
|
-
var dispatcher = resolveDispatcher();
|
|
1365
|
-
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1366
|
-
}
|
|
1367
|
-
function useRef(initialValue) {
|
|
1368
|
-
var dispatcher = resolveDispatcher();
|
|
1369
|
-
return dispatcher.useRef(initialValue);
|
|
1370
|
-
}
|
|
1371
|
-
function useEffect(create, deps) {
|
|
1372
|
-
var dispatcher = resolveDispatcher();
|
|
1373
|
-
return dispatcher.useEffect(create, deps);
|
|
1374
|
-
}
|
|
1375
|
-
function useInsertionEffect(create, deps) {
|
|
1376
|
-
var dispatcher = resolveDispatcher();
|
|
1377
|
-
return dispatcher.useInsertionEffect(create, deps);
|
|
1378
|
-
}
|
|
1379
|
-
function useLayoutEffect(create, deps) {
|
|
1380
|
-
var dispatcher = resolveDispatcher();
|
|
1381
|
-
return dispatcher.useLayoutEffect(create, deps);
|
|
1382
|
-
}
|
|
1383
|
-
function useCallback(callback, deps) {
|
|
1384
|
-
var dispatcher = resolveDispatcher();
|
|
1385
|
-
return dispatcher.useCallback(callback, deps);
|
|
1386
|
-
}
|
|
1387
|
-
function useMemo(create, deps) {
|
|
1388
|
-
var dispatcher = resolveDispatcher();
|
|
1389
|
-
return dispatcher.useMemo(create, deps);
|
|
1390
|
-
}
|
|
1391
|
-
function useImperativeHandle(ref, create, deps) {
|
|
1392
|
-
var dispatcher = resolveDispatcher();
|
|
1393
|
-
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1394
|
-
}
|
|
1395
|
-
function useDebugValue(value, formatterFn) {
|
|
1396
|
-
{
|
|
1397
|
-
var dispatcher = resolveDispatcher();
|
|
1398
|
-
return dispatcher.useDebugValue(value, formatterFn);
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
function useTransition() {
|
|
1402
|
-
var dispatcher = resolveDispatcher();
|
|
1403
|
-
return dispatcher.useTransition();
|
|
1404
|
-
}
|
|
1405
|
-
function useDeferredValue(value) {
|
|
1406
|
-
var dispatcher = resolveDispatcher();
|
|
1407
|
-
return dispatcher.useDeferredValue(value);
|
|
1408
|
-
}
|
|
1409
|
-
function useId() {
|
|
1410
|
-
var dispatcher = resolveDispatcher();
|
|
1411
|
-
return dispatcher.useId();
|
|
1412
|
-
}
|
|
1413
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1414
|
-
var dispatcher = resolveDispatcher();
|
|
1415
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1416
|
-
}
|
|
1417
|
-
var disabledDepth = 0;
|
|
1418
|
-
var prevLog;
|
|
1419
|
-
var prevInfo;
|
|
1420
|
-
var prevWarn;
|
|
1421
|
-
var prevError;
|
|
1422
|
-
var prevGroup;
|
|
1423
|
-
var prevGroupCollapsed;
|
|
1424
|
-
var prevGroupEnd;
|
|
1425
|
-
function disabledLog() {
|
|
1426
|
-
}
|
|
1427
|
-
disabledLog.__reactDisabledLog = true;
|
|
1428
|
-
function disableLogs() {
|
|
1429
|
-
{
|
|
1430
|
-
if (disabledDepth === 0) {
|
|
1431
|
-
prevLog = console.log;
|
|
1432
|
-
prevInfo = console.info;
|
|
1433
|
-
prevWarn = console.warn;
|
|
1434
|
-
prevError = console.error;
|
|
1435
|
-
prevGroup = console.group;
|
|
1436
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
1437
|
-
prevGroupEnd = console.groupEnd;
|
|
1438
|
-
var props = {
|
|
1439
|
-
configurable: true,
|
|
1440
|
-
enumerable: true,
|
|
1441
|
-
value: disabledLog,
|
|
1442
|
-
writable: true
|
|
1443
|
-
};
|
|
1444
|
-
Object.defineProperties(console, {
|
|
1445
|
-
info: props,
|
|
1446
|
-
log: props,
|
|
1447
|
-
warn: props,
|
|
1448
|
-
error: props,
|
|
1449
|
-
group: props,
|
|
1450
|
-
groupCollapsed: props,
|
|
1451
|
-
groupEnd: props
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
disabledDepth++;
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
function reenableLogs() {
|
|
1458
|
-
{
|
|
1459
|
-
disabledDepth--;
|
|
1460
|
-
if (disabledDepth === 0) {
|
|
1461
|
-
var props = {
|
|
1462
|
-
configurable: true,
|
|
1463
|
-
enumerable: true,
|
|
1464
|
-
writable: true
|
|
1465
|
-
};
|
|
1466
|
-
Object.defineProperties(console, {
|
|
1467
|
-
log: assign({}, props, {
|
|
1468
|
-
value: prevLog
|
|
1469
|
-
}),
|
|
1470
|
-
info: assign({}, props, {
|
|
1471
|
-
value: prevInfo
|
|
1472
|
-
}),
|
|
1473
|
-
warn: assign({}, props, {
|
|
1474
|
-
value: prevWarn
|
|
1475
|
-
}),
|
|
1476
|
-
error: assign({}, props, {
|
|
1477
|
-
value: prevError
|
|
1478
|
-
}),
|
|
1479
|
-
group: assign({}, props, {
|
|
1480
|
-
value: prevGroup
|
|
1481
|
-
}),
|
|
1482
|
-
groupCollapsed: assign({}, props, {
|
|
1483
|
-
value: prevGroupCollapsed
|
|
1484
|
-
}),
|
|
1485
|
-
groupEnd: assign({}, props, {
|
|
1486
|
-
value: prevGroupEnd
|
|
1487
|
-
})
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
if (disabledDepth < 0) {
|
|
1491
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1496
|
-
var prefix;
|
|
1497
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1498
|
-
{
|
|
1499
|
-
if (prefix === void 0) {
|
|
1500
|
-
try {
|
|
1501
|
-
throw Error();
|
|
1502
|
-
} catch (x) {
|
|
1503
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1504
|
-
prefix = match && match[1] || "";
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
return "\n" + prefix + name;
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
var reentry = false;
|
|
1511
|
-
var componentFrameCache;
|
|
1512
|
-
{
|
|
1513
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
1514
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
1515
|
-
}
|
|
1516
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
1517
|
-
if (!fn || reentry) {
|
|
1518
|
-
return "";
|
|
1519
|
-
}
|
|
1520
|
-
{
|
|
1521
|
-
var frame = componentFrameCache.get(fn);
|
|
1522
|
-
if (frame !== void 0) {
|
|
1523
|
-
return frame;
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
var control;
|
|
1527
|
-
reentry = true;
|
|
1528
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1529
|
-
Error.prepareStackTrace = void 0;
|
|
1530
|
-
var previousDispatcher;
|
|
1531
|
-
{
|
|
1532
|
-
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
1533
|
-
ReactCurrentDispatcher$1.current = null;
|
|
1534
|
-
disableLogs();
|
|
1535
|
-
}
|
|
1536
|
-
try {
|
|
1537
|
-
if (construct) {
|
|
1538
|
-
var Fake = function() {
|
|
1539
|
-
throw Error();
|
|
1540
|
-
};
|
|
1541
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
1542
|
-
set: function() {
|
|
1543
|
-
throw Error();
|
|
1544
|
-
}
|
|
1545
|
-
});
|
|
1546
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
1547
|
-
try {
|
|
1548
|
-
Reflect.construct(Fake, []);
|
|
1549
|
-
} catch (x) {
|
|
1550
|
-
control = x;
|
|
1551
|
-
}
|
|
1552
|
-
Reflect.construct(fn, [], Fake);
|
|
1553
|
-
} else {
|
|
1554
|
-
try {
|
|
1555
|
-
Fake.call();
|
|
1556
|
-
} catch (x) {
|
|
1557
|
-
control = x;
|
|
1558
|
-
}
|
|
1559
|
-
fn.call(Fake.prototype);
|
|
1560
|
-
}
|
|
1561
|
-
} else {
|
|
1562
|
-
try {
|
|
1563
|
-
throw Error();
|
|
1564
|
-
} catch (x) {
|
|
1565
|
-
control = x;
|
|
1566
|
-
}
|
|
1567
|
-
fn();
|
|
1568
|
-
}
|
|
1569
|
-
} catch (sample) {
|
|
1570
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
1571
|
-
var sampleLines = sample.stack.split("\n");
|
|
1572
|
-
var controlLines = control.stack.split("\n");
|
|
1573
|
-
var s = sampleLines.length - 1;
|
|
1574
|
-
var c = controlLines.length - 1;
|
|
1575
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1576
|
-
c--;
|
|
1577
|
-
}
|
|
1578
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1579
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
1580
|
-
if (s !== 1 || c !== 1) {
|
|
1581
|
-
do {
|
|
1582
|
-
s--;
|
|
1583
|
-
c--;
|
|
1584
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1585
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
1586
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
1587
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
1588
|
-
}
|
|
1589
|
-
{
|
|
1590
|
-
if (typeof fn === "function") {
|
|
1591
|
-
componentFrameCache.set(fn, _frame);
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
return _frame;
|
|
1595
|
-
}
|
|
1596
|
-
} while (s >= 1 && c >= 0);
|
|
1597
|
-
}
|
|
1598
|
-
break;
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
} finally {
|
|
1603
|
-
reentry = false;
|
|
1604
|
-
{
|
|
1605
|
-
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1606
|
-
reenableLogs();
|
|
1607
|
-
}
|
|
1608
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1609
|
-
}
|
|
1610
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
1611
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
1612
|
-
{
|
|
1613
|
-
if (typeof fn === "function") {
|
|
1614
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
return syntheticFrame;
|
|
1618
|
-
}
|
|
1619
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1620
|
-
{
|
|
1621
|
-
return describeNativeComponentFrame(fn, false);
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
function shouldConstruct(Component2) {
|
|
1625
|
-
var prototype = Component2.prototype;
|
|
1626
|
-
return !!(prototype && prototype.isReactComponent);
|
|
1627
|
-
}
|
|
1628
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1629
|
-
if (type == null) {
|
|
1630
|
-
return "";
|
|
1631
|
-
}
|
|
1632
|
-
if (typeof type === "function") {
|
|
1633
|
-
{
|
|
1634
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
if (typeof type === "string") {
|
|
1638
|
-
return describeBuiltInComponentFrame(type);
|
|
1639
|
-
}
|
|
1640
|
-
switch (type) {
|
|
1641
|
-
case REACT_SUSPENSE_TYPE:
|
|
1642
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
1643
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1644
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
1645
|
-
}
|
|
1646
|
-
if (typeof type === "object") {
|
|
1647
|
-
switch (type.$$typeof) {
|
|
1648
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1649
|
-
return describeFunctionComponentFrame(type.render);
|
|
1650
|
-
case REACT_MEMO_TYPE:
|
|
1651
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1652
|
-
case REACT_LAZY_TYPE: {
|
|
1653
|
-
var lazyComponent = type;
|
|
1654
|
-
var payload = lazyComponent._payload;
|
|
1655
|
-
var init = lazyComponent._init;
|
|
1656
|
-
try {
|
|
1657
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1658
|
-
} catch (x) {
|
|
1659
|
-
}
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
return "";
|
|
1664
|
-
}
|
|
1665
|
-
var loggedTypeFailures = {};
|
|
1666
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1667
|
-
function setCurrentlyValidatingElement(element) {
|
|
1668
|
-
{
|
|
1669
|
-
if (element) {
|
|
1670
|
-
var owner = element._owner;
|
|
1671
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1672
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1673
|
-
} else {
|
|
1674
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1679
|
-
{
|
|
1680
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
1681
|
-
for (var typeSpecName in typeSpecs) {
|
|
1682
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
1683
|
-
var error$1 = void 0;
|
|
1684
|
-
try {
|
|
1685
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1686
|
-
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`.");
|
|
1687
|
-
err.name = "Invariant Violation";
|
|
1688
|
-
throw err;
|
|
1689
|
-
}
|
|
1690
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1691
|
-
} catch (ex) {
|
|
1692
|
-
error$1 = ex;
|
|
1693
|
-
}
|
|
1694
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
1695
|
-
setCurrentlyValidatingElement(element);
|
|
1696
|
-
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);
|
|
1697
|
-
setCurrentlyValidatingElement(null);
|
|
1698
|
-
}
|
|
1699
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1700
|
-
loggedTypeFailures[error$1.message] = true;
|
|
1701
|
-
setCurrentlyValidatingElement(element);
|
|
1702
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
1703
|
-
setCurrentlyValidatingElement(null);
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
1710
|
-
{
|
|
1711
|
-
if (element) {
|
|
1712
|
-
var owner = element._owner;
|
|
1713
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1714
|
-
setExtraStackFrame(stack);
|
|
1715
|
-
} else {
|
|
1716
|
-
setExtraStackFrame(null);
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
var propTypesMisspellWarningShown;
|
|
1721
|
-
{
|
|
1722
|
-
propTypesMisspellWarningShown = false;
|
|
1723
|
-
}
|
|
1724
|
-
function getDeclarationErrorAddendum() {
|
|
1725
|
-
if (ReactCurrentOwner.current) {
|
|
1726
|
-
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1727
|
-
if (name) {
|
|
1728
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
return "";
|
|
1732
|
-
}
|
|
1733
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1734
|
-
if (source !== void 0) {
|
|
1735
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1736
|
-
var lineNumber = source.lineNumber;
|
|
1737
|
-
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
1738
|
-
}
|
|
1739
|
-
return "";
|
|
1740
|
-
}
|
|
1741
|
-
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1742
|
-
if (elementProps !== null && elementProps !== void 0) {
|
|
1743
|
-
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1744
|
-
}
|
|
1745
|
-
return "";
|
|
1746
|
-
}
|
|
1747
|
-
var ownerHasKeyUseWarning = {};
|
|
1748
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1749
|
-
var info = getDeclarationErrorAddendum();
|
|
1750
|
-
if (!info) {
|
|
1751
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
1752
|
-
if (parentName) {
|
|
1753
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
return info;
|
|
1757
|
-
}
|
|
1758
|
-
function validateExplicitKey(element, parentType) {
|
|
1759
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1760
|
-
return;
|
|
1761
|
-
}
|
|
1762
|
-
element._store.validated = true;
|
|
1763
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1764
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
1768
|
-
var childOwner = "";
|
|
1769
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1770
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1771
|
-
}
|
|
1772
|
-
{
|
|
1773
|
-
setCurrentlyValidatingElement$1(element);
|
|
1774
|
-
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);
|
|
1775
|
-
setCurrentlyValidatingElement$1(null);
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
function validateChildKeys(node, parentType) {
|
|
1779
|
-
if (typeof node !== "object") {
|
|
1780
|
-
return;
|
|
1781
|
-
}
|
|
1782
|
-
if (isArray(node)) {
|
|
1783
|
-
for (var i = 0; i < node.length; i++) {
|
|
1784
|
-
var child = node[i];
|
|
1785
|
-
if (isValidElement2(child)) {
|
|
1786
|
-
validateExplicitKey(child, parentType);
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
} else if (isValidElement2(node)) {
|
|
1790
|
-
if (node._store) {
|
|
1791
|
-
node._store.validated = true;
|
|
1792
|
-
}
|
|
1793
|
-
} else if (node) {
|
|
1794
|
-
var iteratorFn = getIteratorFn(node);
|
|
1795
|
-
if (typeof iteratorFn === "function") {
|
|
1796
|
-
if (iteratorFn !== node.entries) {
|
|
1797
|
-
var iterator = iteratorFn.call(node);
|
|
1798
|
-
var step;
|
|
1799
|
-
while (!(step = iterator.next()).done) {
|
|
1800
|
-
if (isValidElement2(step.value)) {
|
|
1801
|
-
validateExplicitKey(step.value, parentType);
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
function validatePropTypes(element) {
|
|
1809
|
-
{
|
|
1810
|
-
var type = element.type;
|
|
1811
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
1812
|
-
return;
|
|
1813
|
-
}
|
|
1814
|
-
var propTypes;
|
|
1815
|
-
if (typeof type === "function") {
|
|
1816
|
-
propTypes = type.propTypes;
|
|
1817
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1818
|
-
// Inner props are checked in the reconciler.
|
|
1819
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1820
|
-
propTypes = type.propTypes;
|
|
1821
|
-
} else {
|
|
1822
|
-
return;
|
|
1823
|
-
}
|
|
1824
|
-
if (propTypes) {
|
|
1825
|
-
var name = getComponentNameFromType(type);
|
|
1826
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1827
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1828
|
-
propTypesMisspellWarningShown = true;
|
|
1829
|
-
var _name = getComponentNameFromType(type);
|
|
1830
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
1831
|
-
}
|
|
1832
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
1833
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
}
|
|
1837
|
-
function validateFragmentProps(fragment) {
|
|
1838
|
-
{
|
|
1839
|
-
var keys = Object.keys(fragment.props);
|
|
1840
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1841
|
-
var key = keys[i];
|
|
1842
|
-
if (key !== "children" && key !== "key") {
|
|
1843
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1844
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
1845
|
-
setCurrentlyValidatingElement$1(null);
|
|
1846
|
-
break;
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
if (fragment.ref !== null) {
|
|
1850
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1851
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
1852
|
-
setCurrentlyValidatingElement$1(null);
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
function createElementWithValidation(type, props, children) {
|
|
1857
|
-
var validType = isValidElementType(type);
|
|
1858
|
-
if (!validType) {
|
|
1859
|
-
var info = "";
|
|
1860
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1861
|
-
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.";
|
|
1862
|
-
}
|
|
1863
|
-
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
1864
|
-
if (sourceInfo) {
|
|
1865
|
-
info += sourceInfo;
|
|
1866
|
-
} else {
|
|
1867
|
-
info += getDeclarationErrorAddendum();
|
|
1868
|
-
}
|
|
1869
|
-
var typeString;
|
|
1870
|
-
if (type === null) {
|
|
1871
|
-
typeString = "null";
|
|
1872
|
-
} else if (isArray(type)) {
|
|
1873
|
-
typeString = "array";
|
|
1874
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1875
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1876
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1877
|
-
} else {
|
|
1878
|
-
typeString = typeof type;
|
|
1879
|
-
}
|
|
1880
|
-
{
|
|
1881
|
-
error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
var element = createElement.apply(this, arguments);
|
|
1885
|
-
if (element == null) {
|
|
1886
|
-
return element;
|
|
1887
|
-
}
|
|
1888
|
-
if (validType) {
|
|
1889
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
1890
|
-
validateChildKeys(arguments[i], type);
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1894
|
-
validateFragmentProps(element);
|
|
1895
|
-
} else {
|
|
1896
|
-
validatePropTypes(element);
|
|
1897
|
-
}
|
|
1898
|
-
return element;
|
|
1899
|
-
}
|
|
1900
|
-
var didWarnAboutDeprecatedCreateFactory = false;
|
|
1901
|
-
function createFactoryWithValidation(type) {
|
|
1902
|
-
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1903
|
-
validatedFactory.type = type;
|
|
1904
|
-
{
|
|
1905
|
-
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
1906
|
-
didWarnAboutDeprecatedCreateFactory = true;
|
|
1907
|
-
warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
|
|
1908
|
-
}
|
|
1909
|
-
Object.defineProperty(validatedFactory, "type", {
|
|
1910
|
-
enumerable: false,
|
|
1911
|
-
get: function() {
|
|
1912
|
-
warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
|
|
1913
|
-
Object.defineProperty(this, "type", {
|
|
1914
|
-
value: type
|
|
1915
|
-
});
|
|
1916
|
-
return type;
|
|
1917
|
-
}
|
|
1918
|
-
});
|
|
1919
|
-
}
|
|
1920
|
-
return validatedFactory;
|
|
1921
|
-
}
|
|
1922
|
-
function cloneElementWithValidation(element, props, children) {
|
|
1923
|
-
var newElement = cloneElement.apply(this, arguments);
|
|
1924
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
1925
|
-
validateChildKeys(arguments[i], newElement.type);
|
|
1926
|
-
}
|
|
1927
|
-
validatePropTypes(newElement);
|
|
1928
|
-
return newElement;
|
|
1929
|
-
}
|
|
1930
|
-
function startTransition(scope, options) {
|
|
1931
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
1932
|
-
ReactCurrentBatchConfig.transition = {};
|
|
1933
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
1934
|
-
{
|
|
1935
|
-
ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1936
|
-
}
|
|
1937
|
-
try {
|
|
1938
|
-
scope();
|
|
1939
|
-
} finally {
|
|
1940
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
|
1941
|
-
{
|
|
1942
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
1943
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
1944
|
-
if (updatedFibersCount > 10) {
|
|
1945
|
-
warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
|
|
1946
|
-
}
|
|
1947
|
-
currentTransition._updatedFibers.clear();
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
var didWarnAboutMessageChannel = false;
|
|
1953
|
-
var enqueueTaskImpl = null;
|
|
1954
|
-
function enqueueTask(task) {
|
|
1955
|
-
if (enqueueTaskImpl === null) {
|
|
1956
|
-
try {
|
|
1957
|
-
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
1958
|
-
var nodeRequire = module && module[requireString];
|
|
1959
|
-
enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
|
|
1960
|
-
} catch (_err) {
|
|
1961
|
-
enqueueTaskImpl = function(callback) {
|
|
1962
|
-
{
|
|
1963
|
-
if (didWarnAboutMessageChannel === false) {
|
|
1964
|
-
didWarnAboutMessageChannel = true;
|
|
1965
|
-
if (typeof MessageChannel === "undefined") {
|
|
1966
|
-
error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
var channel = new MessageChannel();
|
|
1971
|
-
channel.port1.onmessage = callback;
|
|
1972
|
-
channel.port2.postMessage(void 0);
|
|
1973
|
-
};
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
return enqueueTaskImpl(task);
|
|
1977
|
-
}
|
|
1978
|
-
var actScopeDepth = 0;
|
|
1979
|
-
var didWarnNoAwaitAct = false;
|
|
1980
|
-
function act(callback) {
|
|
1981
|
-
{
|
|
1982
|
-
var prevActScopeDepth = actScopeDepth;
|
|
1983
|
-
actScopeDepth++;
|
|
1984
|
-
if (ReactCurrentActQueue.current === null) {
|
|
1985
|
-
ReactCurrentActQueue.current = [];
|
|
1986
|
-
}
|
|
1987
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
1988
|
-
var result;
|
|
1989
|
-
try {
|
|
1990
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
1991
|
-
result = callback();
|
|
1992
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
1993
|
-
var queue = ReactCurrentActQueue.current;
|
|
1994
|
-
if (queue !== null) {
|
|
1995
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
1996
|
-
flushActQueue(queue);
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
} catch (error2) {
|
|
2000
|
-
popActScope(prevActScopeDepth);
|
|
2001
|
-
throw error2;
|
|
2002
|
-
} finally {
|
|
2003
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
2004
|
-
}
|
|
2005
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
2006
|
-
var thenableResult = result;
|
|
2007
|
-
var wasAwaited = false;
|
|
2008
|
-
var thenable = {
|
|
2009
|
-
then: function(resolve, reject) {
|
|
2010
|
-
wasAwaited = true;
|
|
2011
|
-
thenableResult.then(function(returnValue2) {
|
|
2012
|
-
popActScope(prevActScopeDepth);
|
|
2013
|
-
if (actScopeDepth === 0) {
|
|
2014
|
-
recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
|
|
2015
|
-
} else {
|
|
2016
|
-
resolve(returnValue2);
|
|
2017
|
-
}
|
|
2018
|
-
}, function(error2) {
|
|
2019
|
-
popActScope(prevActScopeDepth);
|
|
2020
|
-
reject(error2);
|
|
2021
|
-
});
|
|
2022
|
-
}
|
|
2023
|
-
};
|
|
2024
|
-
{
|
|
2025
|
-
if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
|
|
2026
|
-
Promise.resolve().then(function() {
|
|
2027
|
-
}).then(function() {
|
|
2028
|
-
if (!wasAwaited) {
|
|
2029
|
-
didWarnNoAwaitAct = true;
|
|
2030
|
-
error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
|
|
2031
|
-
}
|
|
2032
|
-
});
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
2035
|
-
return thenable;
|
|
2036
|
-
} else {
|
|
2037
|
-
var returnValue = result;
|
|
2038
|
-
popActScope(prevActScopeDepth);
|
|
2039
|
-
if (actScopeDepth === 0) {
|
|
2040
|
-
var _queue = ReactCurrentActQueue.current;
|
|
2041
|
-
if (_queue !== null) {
|
|
2042
|
-
flushActQueue(_queue);
|
|
2043
|
-
ReactCurrentActQueue.current = null;
|
|
2044
|
-
}
|
|
2045
|
-
var _thenable = {
|
|
2046
|
-
then: function(resolve, reject) {
|
|
2047
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2048
|
-
ReactCurrentActQueue.current = [];
|
|
2049
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2050
|
-
} else {
|
|
2051
|
-
resolve(returnValue);
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
};
|
|
2055
|
-
return _thenable;
|
|
2056
|
-
} else {
|
|
2057
|
-
var _thenable2 = {
|
|
2058
|
-
then: function(resolve, reject) {
|
|
2059
|
-
resolve(returnValue);
|
|
2060
|
-
}
|
|
2061
|
-
};
|
|
2062
|
-
return _thenable2;
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
function popActScope(prevActScopeDepth) {
|
|
2068
|
-
{
|
|
2069
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
2070
|
-
error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
|
2071
|
-
}
|
|
2072
|
-
actScopeDepth = prevActScopeDepth;
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2076
|
-
{
|
|
2077
|
-
var queue = ReactCurrentActQueue.current;
|
|
2078
|
-
if (queue !== null) {
|
|
2079
|
-
try {
|
|
2080
|
-
flushActQueue(queue);
|
|
2081
|
-
enqueueTask(function() {
|
|
2082
|
-
if (queue.length === 0) {
|
|
2083
|
-
ReactCurrentActQueue.current = null;
|
|
2084
|
-
resolve(returnValue);
|
|
2085
|
-
} else {
|
|
2086
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2087
|
-
}
|
|
2088
|
-
});
|
|
2089
|
-
} catch (error2) {
|
|
2090
|
-
reject(error2);
|
|
2091
|
-
}
|
|
2092
|
-
} else {
|
|
2093
|
-
resolve(returnValue);
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
var isFlushing = false;
|
|
2098
|
-
function flushActQueue(queue) {
|
|
2099
|
-
{
|
|
2100
|
-
if (!isFlushing) {
|
|
2101
|
-
isFlushing = true;
|
|
2102
|
-
var i = 0;
|
|
2103
|
-
try {
|
|
2104
|
-
for (; i < queue.length; i++) {
|
|
2105
|
-
var callback = queue[i];
|
|
2106
|
-
do {
|
|
2107
|
-
callback = callback(true);
|
|
2108
|
-
} while (callback !== null);
|
|
2109
|
-
}
|
|
2110
|
-
queue.length = 0;
|
|
2111
|
-
} catch (error2) {
|
|
2112
|
-
queue = queue.slice(i + 1);
|
|
2113
|
-
throw error2;
|
|
2114
|
-
} finally {
|
|
2115
|
-
isFlushing = false;
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
}
|
|
2119
|
-
}
|
|
2120
|
-
var createElement$1 = createElementWithValidation;
|
|
2121
|
-
var cloneElement$1 = cloneElementWithValidation;
|
|
2122
|
-
var createFactory = createFactoryWithValidation;
|
|
2123
|
-
var Children = {
|
|
2124
|
-
map: mapChildren,
|
|
2125
|
-
forEach: forEachChildren,
|
|
2126
|
-
count: countChildren,
|
|
2127
|
-
toArray,
|
|
2128
|
-
only: onlyChild
|
|
2129
|
-
};
|
|
2130
|
-
exports.Children = Children;
|
|
2131
|
-
exports.Component = Component;
|
|
2132
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2133
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2134
|
-
exports.PureComponent = PureComponent;
|
|
2135
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2136
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2137
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2138
|
-
exports.act = act;
|
|
2139
|
-
exports.cloneElement = cloneElement$1;
|
|
2140
|
-
exports.createContext = createContext;
|
|
2141
|
-
exports.createElement = createElement$1;
|
|
2142
|
-
exports.createFactory = createFactory;
|
|
2143
|
-
exports.createRef = createRef;
|
|
2144
|
-
exports.forwardRef = forwardRef;
|
|
2145
|
-
exports.isValidElement = isValidElement2;
|
|
2146
|
-
exports.lazy = lazy;
|
|
2147
|
-
exports.memo = memo;
|
|
2148
|
-
exports.startTransition = startTransition;
|
|
2149
|
-
exports.unstable_act = act;
|
|
2150
|
-
exports.useCallback = useCallback;
|
|
2151
|
-
exports.useContext = useContext;
|
|
2152
|
-
exports.useDebugValue = useDebugValue;
|
|
2153
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2154
|
-
exports.useEffect = useEffect;
|
|
2155
|
-
exports.useId = useId;
|
|
2156
|
-
exports.useImperativeHandle = useImperativeHandle;
|
|
2157
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
2158
|
-
exports.useLayoutEffect = useLayoutEffect;
|
|
2159
|
-
exports.useMemo = useMemo;
|
|
2160
|
-
exports.useReducer = useReducer;
|
|
2161
|
-
exports.useRef = useRef;
|
|
2162
|
-
exports.useState = useState;
|
|
2163
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2164
|
-
exports.useTransition = useTransition;
|
|
2165
|
-
exports.version = ReactVersion;
|
|
2166
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
2167
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2168
|
-
}
|
|
2169
|
-
})();
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
});
|
|
2173
|
-
|
|
2174
|
-
// ../../../node_modules/react/index.js
|
|
2175
|
-
var require_react = __commonJS({
|
|
2176
|
-
"../../../node_modules/react/index.js"(exports, module) {
|
|
2177
|
-
"use strict";
|
|
2178
|
-
if (process.env.NODE_ENV === "production") {
|
|
2179
|
-
module.exports = require_react_production_min();
|
|
2180
|
-
} else {
|
|
2181
|
-
module.exports = require_react_development();
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
});
|
|
2185
|
-
|
|
2186
|
-
// src/mixins/StylingMixin.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/mixins/StylingMixin.ts
|
|
2187
2
|
function StylingMixin(mixinBaseClass) {
|
|
2188
3
|
return class extends mixinBaseClass {
|
|
2189
4
|
constructor() {
|
|
@@ -4711,145 +2526,145 @@ if (!customElements.get("wavelength-nav-bar")) {
|
|
|
4711
2526
|
customElements.define("wavelength-nav-bar", WavelengthNavBar);
|
|
4712
2527
|
}
|
|
4713
2528
|
|
|
4714
|
-
// src/web-components/wavelength-child-data-table.
|
|
4715
|
-
var
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
* {
|
|
4722
|
-
font-family: 'montserrat', sans-serif;
|
|
4723
|
-
box-sizing: border-box;
|
|
4724
|
-
}
|
|
2529
|
+
// src/web-components/wavelength-child-data-table.template.html
|
|
2530
|
+
var wavelength_child_data_table_template_default = `<style>
|
|
2531
|
+
* {
|
|
2532
|
+
font-family: 'montserrat', sans-serif;
|
|
2533
|
+
box-sizing: border-box;
|
|
2534
|
+
}
|
|
4725
2535
|
|
|
4726
|
-
*[hidden] {
|
|
4727
|
-
|
|
4728
|
-
}
|
|
2536
|
+
*[hidden] {
|
|
2537
|
+
display: none !important;
|
|
2538
|
+
}
|
|
4729
2539
|
|
|
4730
|
-
[part="table"] {
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
2540
|
+
[part="table"] {
|
|
2541
|
+
width: 100%;
|
|
2542
|
+
max-width: 1200px;
|
|
2543
|
+
outline: 1px solid black;
|
|
2544
|
+
}
|
|
4734
2545
|
|
|
4735
|
-
[part="table-body"] > [part="table-rows"]:nth-child(even) {
|
|
4736
|
-
|
|
4737
|
-
}
|
|
2546
|
+
[part="table-body"] > [part="table-rows"]:nth-child(even) {
|
|
2547
|
+
background-color: var(--even-row-background, white);
|
|
2548
|
+
}
|
|
4738
2549
|
|
|
4739
|
-
[part="table-body"] > [part="table-rows"]:nth-child(odd) {
|
|
4740
|
-
|
|
4741
|
-
}
|
|
2550
|
+
[part="table-body"] > [part="table-rows"]:nth-child(odd) {
|
|
2551
|
+
background-color: var(--odd-row-background, white);
|
|
2552
|
+
}
|
|
4742
2553
|
|
|
4743
|
-
[part="table-body"] {
|
|
4744
|
-
|
|
4745
|
-
}
|
|
2554
|
+
[part="table-body"] {
|
|
2555
|
+
border-radius: 10px;
|
|
2556
|
+
}
|
|
4746
2557
|
|
|
4747
|
-
[part="table-header-row"] {
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
}
|
|
2558
|
+
[part="table-header-row"] {
|
|
2559
|
+
text-align: left;
|
|
2560
|
+
height: 60px;
|
|
2561
|
+
background-color: lightgrey;
|
|
2562
|
+
padding: 10px;
|
|
2563
|
+
}
|
|
4753
2564
|
|
|
4754
|
-
[part="header-cell"] {
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
}
|
|
2565
|
+
[part="header-cell"] {
|
|
2566
|
+
display: flex;
|
|
2567
|
+
align-items: center;
|
|
2568
|
+
}
|
|
4758
2569
|
|
|
4759
|
-
[part="header-title"] {
|
|
4760
|
-
|
|
4761
|
-
}
|
|
2570
|
+
[part="header-title"] {
|
|
2571
|
+
color: black;
|
|
2572
|
+
}
|
|
4762
2573
|
|
|
4763
|
-
[part="data-mission"] {
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
}
|
|
2574
|
+
[part="data-mission"] {
|
|
2575
|
+
font-weight: bold;
|
|
2576
|
+
font-size: larger;
|
|
2577
|
+
}
|
|
4767
2578
|
|
|
4768
|
-
[part="table-rows"] {
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
}
|
|
2579
|
+
[part="table-rows"] {
|
|
2580
|
+
border-top: 1px solid black;
|
|
2581
|
+
padding: 10px;
|
|
2582
|
+
}
|
|
4772
2583
|
|
|
4773
|
-
[part="dropdown-row"] {
|
|
4774
|
-
|
|
4775
|
-
}
|
|
2584
|
+
[part="dropdown-row"] {
|
|
2585
|
+
display: flex;
|
|
2586
|
+
}
|
|
4776
2587
|
|
|
4777
|
-
[part~="dropdown-content"] {
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
display: flex;
|
|
4785
|
-
width: 100%;
|
|
4786
|
-
}
|
|
2588
|
+
[part~="dropdown-content"] {
|
|
2589
|
+
display: flex;
|
|
2590
|
+
width: 100%;
|
|
2591
|
+
flex-direction: column;
|
|
2592
|
+
overflow: auto;
|
|
2593
|
+
padding-top: 10px;
|
|
2594
|
+
}
|
|
4787
2595
|
|
|
4788
|
-
[part
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
}
|
|
2596
|
+
[part~="dropdown-cell"] {
|
|
2597
|
+
display: flex;
|
|
2598
|
+
width: 100%;
|
|
2599
|
+
}
|
|
4793
2600
|
|
|
4794
|
-
[part
|
|
4795
|
-
|
|
4796
|
-
|
|
2601
|
+
[part="dropdown-button-cell"] {
|
|
2602
|
+
text-align: center;
|
|
2603
|
+
border-radius: 8px;
|
|
2604
|
+
padding: 0 !important;
|
|
2605
|
+
}
|
|
4797
2606
|
|
|
4798
|
-
[part~="dropdown-button"]
|
|
4799
|
-
|
|
4800
|
-
|
|
2607
|
+
[part~="dropdown-button"] {
|
|
2608
|
+
transition: transform 0.2s ease-in-out;
|
|
2609
|
+
cursor: pointer;
|
|
2610
|
+
}
|
|
4801
2611
|
|
|
4802
|
-
[part~="
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
}
|
|
2612
|
+
[part~="dropdown-button"].open {
|
|
2613
|
+
transform: rotate(180deg);
|
|
2614
|
+
}
|
|
4806
2615
|
|
|
4807
|
-
[part~="sort-button"]
|
|
4808
|
-
|
|
4809
|
-
|
|
2616
|
+
[part~="sort-button"] {
|
|
2617
|
+
transition: transform 0.2s ease-in-out;
|
|
2618
|
+
transform: rotate(0deg);
|
|
2619
|
+
cursor: pointer;
|
|
2620
|
+
margin-left: 8px;
|
|
2621
|
+
}
|
|
4810
2622
|
|
|
4811
|
-
[part~="sort-button"].desc {
|
|
4812
|
-
|
|
4813
|
-
}
|
|
2623
|
+
[part~="sort-button"].desc {
|
|
2624
|
+
transform: rotate(180deg);
|
|
2625
|
+
}
|
|
4814
2626
|
|
|
4815
|
-
[part="dropdown-arrow-bottom-row"] {
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
}
|
|
4819
|
-
|
|
4820
|
-
[part~="data-row-action-buttons"] {
|
|
4821
|
-
padding: 10px 0px 10px 0px;
|
|
4822
|
-
display: flex;
|
|
4823
|
-
column-gap: 24px;
|
|
4824
|
-
}
|
|
2627
|
+
[part="dropdown-arrow-bottom-row"] {
|
|
2628
|
+
background-color: lightgrey;
|
|
2629
|
+
border-radius: 0px 0px 8px 8px;
|
|
2630
|
+
}
|
|
4825
2631
|
|
|
4826
|
-
[part~="
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
</style>
|
|
2632
|
+
[part~="data-row-action-buttons"] {
|
|
2633
|
+
padding: 10px 0px;
|
|
2634
|
+
display: flex;
|
|
2635
|
+
column-gap: 24px;
|
|
2636
|
+
}
|
|
4833
2637
|
|
|
2638
|
+
[part~="all-buttons"] {
|
|
2639
|
+
background-color: transparent;
|
|
2640
|
+
border: none;
|
|
2641
|
+
}
|
|
2642
|
+
</style>
|
|
4834
2643
|
|
|
4835
|
-
|
|
4836
|
-
<div part="table-head" class="table-head"
|
|
4837
|
-
|
|
4838
|
-
</div>
|
|
2644
|
+
<div part="table" class="table">
|
|
2645
|
+
<div part="table-head" class="table-head">
|
|
2646
|
+
<div id="table-header-row" part="table-header-row" class="table-header-row" style="display:flex; flex-direction:row;"></div>
|
|
2647
|
+
</div>
|
|
4839
2648
|
|
|
4840
2649
|
<div id="table-body" part="table-body" class="table-body"></div>
|
|
4841
2650
|
|
|
4842
2651
|
<div part="table-footer" class="table-footer">
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
2652
|
+
<div part="footer-action-row" class="footer-action-row">
|
|
2653
|
+
<div id="footer-action-cell" part="footer-action-cell" class="footer-action-cell">
|
|
2654
|
+
<div class="footer-action-buttons-container" part="footer-action-buttons-container">
|
|
2655
|
+
<slot></slot>
|
|
2656
|
+
</div>
|
|
2657
|
+
</div>
|
|
4848
2658
|
</div>
|
|
4849
|
-
</div>
|
|
4850
2659
|
</div>
|
|
4851
|
-
|
|
4852
|
-
|
|
2660
|
+
</div>`;
|
|
2661
|
+
|
|
2662
|
+
// src/web-components/wavelength-child-data-table.ts
|
|
2663
|
+
function isReactElement(obj) {
|
|
2664
|
+
return obj !== null && typeof obj === "object" && (obj["$$typeof"] === /* @__PURE__ */ Symbol.for("react.element") || obj["$$typeof"] === 60103);
|
|
2665
|
+
}
|
|
2666
|
+
var template4 = document.createElement("template");
|
|
2667
|
+
template4.innerHTML = wavelength_child_data_table_template_default;
|
|
4853
2668
|
var ChildDataTable = class extends HTMLElement {
|
|
4854
2669
|
constructor() {
|
|
4855
2670
|
super();
|
|
@@ -4858,17 +2673,15 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
4858
2673
|
this._sortOrder = "desc";
|
|
4859
2674
|
this._sortKey = "";
|
|
4860
2675
|
this._dropdownArrowLocation = "right";
|
|
4861
|
-
this.
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
this.
|
|
4865
|
-
<path d="M13.2375 0L7.5 5.725L1.7625 0L0 1.7625L7.5 9.2625L15 1.7625L13.2375 0Z" fill="currentColor"/>
|
|
4866
|
-
</svg>`;
|
|
2676
|
+
this._expanded = false;
|
|
2677
|
+
this._sortIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="15" height="10" viewBox="0 0 15 10" fill="none"><path d="M13.2375 0L7.5 5.725L1.7625 0L0 1.7625L7.5 9.2625L15 1.7625L13.2375 0Z" fill="currentColor"/></svg>`;
|
|
2678
|
+
this._dropdownButtonIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="15" height="10" viewBox="0 0 15 10" fill="none"><path d="M13.2375 0L7.5 5.725L1.7625 0L0 1.7625L7.5 9.2625L15 1.7625L13.2375 0Z" fill="currentColor"/></svg>`;
|
|
2679
|
+
this._externalSort = false;
|
|
4867
2680
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
4868
2681
|
this.shadow.append(template4.content.cloneNode(true));
|
|
4869
2682
|
}
|
|
4870
2683
|
static get observedAttributes() {
|
|
4871
|
-
return ["table-columns", "table-data", "dropdown-arrow-location", "sort-icon", "dropdown-button-icon"];
|
|
2684
|
+
return ["table-columns", "table-data", "dropdown-arrow-location", "sort-icon", "dropdown-button-icon", "external-sort", "sort-key", "sort-order", "expanded"];
|
|
4872
2685
|
}
|
|
4873
2686
|
connectedCallback() {
|
|
4874
2687
|
this.handleDropdownClick();
|
|
@@ -4876,14 +2689,12 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
4876
2689
|
this.handleActionClick();
|
|
4877
2690
|
}
|
|
4878
2691
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
4879
|
-
if (oldValue === newValue
|
|
4880
|
-
return;
|
|
4881
|
-
}
|
|
2692
|
+
if (oldValue === newValue) return;
|
|
4882
2693
|
switch (name) {
|
|
4883
2694
|
case "sort-icon":
|
|
4884
2695
|
this.setSortIcon = newValue;
|
|
4885
2696
|
break;
|
|
4886
|
-
case "dropdown-button":
|
|
2697
|
+
case "dropdown-button-icon":
|
|
4887
2698
|
this.setDropdownButtonIcon = newValue;
|
|
4888
2699
|
break;
|
|
4889
2700
|
case "table-columns":
|
|
@@ -4895,132 +2706,219 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
4895
2706
|
case "dropdown-arrow-location":
|
|
4896
2707
|
this.setDropdownArrowLocation = newValue;
|
|
4897
2708
|
break;
|
|
2709
|
+
case "external-sort":
|
|
2710
|
+
this.setExternalSort = newValue;
|
|
2711
|
+
break;
|
|
2712
|
+
case "sort-key":
|
|
2713
|
+
this._sortKey = newValue;
|
|
2714
|
+
this.renderHeader();
|
|
2715
|
+
break;
|
|
2716
|
+
case "sort-order":
|
|
2717
|
+
this._sortOrder = newValue;
|
|
2718
|
+
this.renderHeader();
|
|
2719
|
+
break;
|
|
2720
|
+
case "expanded":
|
|
2721
|
+
this.setExpanded = newValue;
|
|
2722
|
+
break;
|
|
4898
2723
|
}
|
|
4899
2724
|
}
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
${location === "relative" ? `
|
|
4911
|
-
<div style="flex:1" part="header-cell" class="header-cell" data-item-id=${column.key}>
|
|
4912
|
-
<div part='header-title' class='header-title'>
|
|
4913
|
-
${column.title}
|
|
4914
|
-
</div>
|
|
4915
|
-
${sortButton}
|
|
4916
|
-
</div>` : ""}`;
|
|
4917
|
-
}).join("");
|
|
4918
|
-
const container = this.shadow.getElementById("table-header-row");
|
|
4919
|
-
if (container) {
|
|
4920
|
-
const emptyHeader = "<div style='flex:0.2;'></div>";
|
|
4921
|
-
switch (this._dropdownArrowLocation) {
|
|
4922
|
-
case "left":
|
|
4923
|
-
container.innerHTML = emptyHeader + columnsHTML;
|
|
4924
|
-
break;
|
|
4925
|
-
case "right":
|
|
4926
|
-
container.innerHTML = columnsHTML + emptyHeader;
|
|
4927
|
-
break;
|
|
4928
|
-
case "bottom":
|
|
4929
|
-
container.innerHTML = columnsHTML;
|
|
4930
|
-
break;
|
|
4931
|
-
}
|
|
2725
|
+
normalizeColumns(input) {
|
|
2726
|
+
try {
|
|
2727
|
+
const parsed = typeof input === "string" ? JSON.parse(input) : input;
|
|
2728
|
+
return parsed.map((col) => ({
|
|
2729
|
+
...col,
|
|
2730
|
+
cellLocation: _nullishCoalesce(col.cellLocation, () => ( "relative"))
|
|
2731
|
+
}));
|
|
2732
|
+
} catch (err) {
|
|
2733
|
+
console.error("Failed to parse columns", err);
|
|
2734
|
+
return [];
|
|
4932
2735
|
}
|
|
2736
|
+
}
|
|
2737
|
+
renderHeader() {
|
|
2738
|
+
const container = this.shadow.getElementById("table-header-row");
|
|
2739
|
+
if (!container) return;
|
|
2740
|
+
container.replaceChildren(...this.buildHeaderContent());
|
|
2741
|
+
const totalColumns = this._dropdownArrowLocation !== "bottom" ? this._columns.length + 1 : this._columns.length;
|
|
4933
2742
|
const actionCell = this.shadow.getElementById("footer-action-cell");
|
|
4934
2743
|
if (actionCell) {
|
|
4935
2744
|
actionCell.style.flex = String(totalColumns);
|
|
4936
2745
|
}
|
|
4937
2746
|
}
|
|
2747
|
+
buildHeaderContent() {
|
|
2748
|
+
const cells = this._columns.filter((col) => col.cellLocation === "relative").map((col) => this.createHeaderCell(col));
|
|
2749
|
+
if (this._dropdownArrowLocation === "bottom") {
|
|
2750
|
+
return cells;
|
|
2751
|
+
}
|
|
2752
|
+
const spacer = this.createSpacerCell();
|
|
2753
|
+
return this._dropdownArrowLocation === "left" ? [spacer, ...cells] : [...cells, spacer];
|
|
2754
|
+
}
|
|
2755
|
+
createHeaderCell(column) {
|
|
2756
|
+
const cell = document.createElement("div");
|
|
2757
|
+
cell.className = "header-cell";
|
|
2758
|
+
cell.setAttribute("part", "header-cell");
|
|
2759
|
+
cell.style.flex = "1";
|
|
2760
|
+
cell.dataset.itemId = String(column.key);
|
|
2761
|
+
const title = document.createElement("div");
|
|
2762
|
+
title.className = "header-title";
|
|
2763
|
+
title.setAttribute("part", "header-title");
|
|
2764
|
+
title.textContent = column.title;
|
|
2765
|
+
cell.appendChild(title);
|
|
2766
|
+
if (this.shouldRenderSort(column)) {
|
|
2767
|
+
cell.appendChild(this.createSortButton(column));
|
|
2768
|
+
}
|
|
2769
|
+
return cell;
|
|
2770
|
+
}
|
|
2771
|
+
shouldRenderSort(column) {
|
|
2772
|
+
return !column.renderCell && column.sort !== false;
|
|
2773
|
+
}
|
|
2774
|
+
createSortButton(column) {
|
|
2775
|
+
const button = document.createElement("button");
|
|
2776
|
+
button.className = "sort-button all-buttons";
|
|
2777
|
+
button.setAttribute("part", "sort-button all-buttons");
|
|
2778
|
+
button.dataset.sortKey = String(column.key);
|
|
2779
|
+
if (column.key === this._sortKey) {
|
|
2780
|
+
button.classList.add(this._sortOrder);
|
|
2781
|
+
}
|
|
2782
|
+
if (typeof this._sortIcon === "string") {
|
|
2783
|
+
button.innerHTML = this._sortIcon;
|
|
2784
|
+
} else {
|
|
2785
|
+
button.appendChild(this._sortIcon.cloneNode(true));
|
|
2786
|
+
}
|
|
2787
|
+
return button;
|
|
2788
|
+
}
|
|
2789
|
+
createSpacerCell() {
|
|
2790
|
+
const spacer = document.createElement("div");
|
|
2791
|
+
spacer.style.flex = "0.2";
|
|
2792
|
+
return spacer;
|
|
2793
|
+
}
|
|
4938
2794
|
renderRows(newValue) {
|
|
4939
2795
|
this._data = typeof newValue === "string" ? JSON.parse(newValue) : newValue;
|
|
4940
2796
|
const totalColumns = this._dropdownArrowLocation !== "bottom" ? this._columns.length + 1 : this._columns.length;
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
part="dropdown-button-cell data-cell"
|
|
4977
|
-
class="dropdown-button-cell data-cell">
|
|
4978
|
-
${dropdownButtonHTML}
|
|
4979
|
-
</div>
|
|
4980
|
-
`;
|
|
4981
|
-
const dropdownContentRowHTML = `
|
|
4982
|
-
<div part="dropdown-row" class="dropdown-row">
|
|
4983
|
-
<div style="flex:${totalColumns}" part="dropdown-cell" class="dropdown-cell">
|
|
4984
|
-
<div class="dropdown-content" id="dropdown-${item.id}" part="dropdown-content" hidden="true"></div>
|
|
4985
|
-
</div>
|
|
4986
|
-
</div>
|
|
4987
|
-
`;
|
|
4988
|
-
const topRow = cellLayout.topAlignedCells.length ? `<div class="${item.id} data-cells-location-top-row" part="data-cells-location-top-row" style="text-align: left;">
|
|
4989
|
-
${cellLayout.topAlignedCells.join("")}
|
|
4990
|
-
</div>` : "";
|
|
4991
|
-
const bottomRow = cellLayout.bottomAlignedCells.length ? `<div class="${item.id} data-cells-location-bottom-row" part="data-cells-location-bottom-row">
|
|
4992
|
-
${cellLayout.bottomAlignedCells.join("")}
|
|
4993
|
-
</div>` : "";
|
|
4994
|
-
let middleRowHTML = "";
|
|
4995
|
-
const middleCells = cellLayout.relativeAlignedCells.join("");
|
|
4996
|
-
switch (this._dropdownArrowLocation) {
|
|
4997
|
-
case "left":
|
|
4998
|
-
middleRowHTML = dropdownButtonCellHTML + middleCells;
|
|
4999
|
-
break;
|
|
5000
|
-
case "right":
|
|
5001
|
-
middleRowHTML = middleCells + dropdownButtonCellHTML;
|
|
5002
|
-
break;
|
|
5003
|
-
case "bottom":
|
|
5004
|
-
middleRowHTML = middleCells;
|
|
5005
|
-
break;
|
|
5006
|
-
}
|
|
5007
|
-
const middleRow = `<div class="${item.id} data-cells-location-relative-row" part="data-cells-location-relative-row" style="display:flex; flex-direction:row;">${middleRowHTML} </div>`;
|
|
5008
|
-
const assembledDataCells = topRow + middleRow + bottomRow;
|
|
5009
|
-
if (this._dropdownArrowLocation === "bottom") {
|
|
5010
|
-
const bottomArrowRow = `<div part="dropdown-arrow-bottom-row" class="dropdown-arrow-bottom-row">${dropdownButtonCellHTML}</div>`;
|
|
5011
|
-
return "<div part='table-rows' class='table-rows'><div part='table-rows-data' class='table-rows-data'>" + assembledDataCells + "</div>" + dropdownContentRowHTML + bottomArrowRow + "</div>";
|
|
5012
|
-
} else {
|
|
5013
|
-
return "<div part='table-rows' class='table-rows'>" + assembledDataCells + dropdownContentRowHTML + "</div>";
|
|
5014
|
-
}
|
|
5015
|
-
}).join("");
|
|
5016
|
-
const container = this.shadow.getElementById("table-body");
|
|
5017
|
-
if (container) {
|
|
5018
|
-
container.innerHTML = dataHTML;
|
|
2797
|
+
const container = this.shadow.getElementById("table-body");
|
|
2798
|
+
if (!container) return;
|
|
2799
|
+
container.replaceChildren();
|
|
2800
|
+
if (!this._data || this._data.length === 0) return;
|
|
2801
|
+
const rows = this._data.map((item) => this.buildRow(item, totalColumns));
|
|
2802
|
+
container.replaceChildren(...rows);
|
|
2803
|
+
}
|
|
2804
|
+
buildRow(item, totalColumns) {
|
|
2805
|
+
const tableRow = document.createElement("div");
|
|
2806
|
+
tableRow.className = "table-rows";
|
|
2807
|
+
tableRow.setAttribute("part", "table-rows");
|
|
2808
|
+
const tableRowsData = document.createElement("div");
|
|
2809
|
+
tableRowsData.className = "table-rows-data";
|
|
2810
|
+
tableRowsData.setAttribute("part", "table-rows-data");
|
|
2811
|
+
const topRow = document.createElement("div");
|
|
2812
|
+
topRow.className = `${item.id} data-cells-location-top-row`;
|
|
2813
|
+
topRow.setAttribute("part", "data-cells-location-top-row");
|
|
2814
|
+
topRow.style.textAlign = "left";
|
|
2815
|
+
const bottomRow = document.createElement("div");
|
|
2816
|
+
bottomRow.className = `${item.id} data-cells-location-bottom-row`;
|
|
2817
|
+
bottomRow.setAttribute("part", "data-cells-location-bottom-row");
|
|
2818
|
+
const middleRow = document.createElement("div");
|
|
2819
|
+
middleRow.className = `${item.id} data-cells-location-relative-row`;
|
|
2820
|
+
middleRow.setAttribute("part", "data-cells-location-relative-row");
|
|
2821
|
+
middleRow.style.display = "flex";
|
|
2822
|
+
middleRow.style.flexDirection = "row";
|
|
2823
|
+
this._columns.forEach((column) => {
|
|
2824
|
+
const cellLocation = column.cellLocation || "relative";
|
|
2825
|
+
const dataCell = this.createDataCell(item, column, totalColumns);
|
|
2826
|
+
if (cellLocation === "top") {
|
|
2827
|
+
topRow.appendChild(dataCell);
|
|
2828
|
+
} else if (cellLocation === "bottom") {
|
|
2829
|
+
bottomRow.appendChild(dataCell);
|
|
2830
|
+
} else {
|
|
2831
|
+
middleRow.appendChild(dataCell);
|
|
5019
2832
|
}
|
|
2833
|
+
});
|
|
2834
|
+
const dropdownButtonCell = this.createDropdownButtonCell(item);
|
|
2835
|
+
if (this._dropdownArrowLocation === "left") {
|
|
2836
|
+
middleRow.prepend(dropdownButtonCell);
|
|
2837
|
+
} else if (this._dropdownArrowLocation === "right") {
|
|
2838
|
+
middleRow.appendChild(dropdownButtonCell);
|
|
2839
|
+
}
|
|
2840
|
+
if (topRow.hasChildNodes()) tableRowsData.appendChild(topRow);
|
|
2841
|
+
if (middleRow.hasChildNodes()) tableRowsData.appendChild(middleRow);
|
|
2842
|
+
if (bottomRow.hasChildNodes()) tableRowsData.appendChild(bottomRow);
|
|
2843
|
+
const dropdownContentRow = this.createDropdownContentRow(item, totalColumns);
|
|
2844
|
+
if (this._dropdownArrowLocation === "bottom") {
|
|
2845
|
+
const bottomArrowRow = document.createElement("div");
|
|
2846
|
+
bottomArrowRow.className = "dropdown-arrow-bottom-row";
|
|
2847
|
+
bottomArrowRow.setAttribute("part", "dropdown-arrow-bottom-row");
|
|
2848
|
+
bottomArrowRow.appendChild(dropdownButtonCell);
|
|
2849
|
+
tableRow.appendChild(tableRowsData);
|
|
2850
|
+
tableRow.appendChild(dropdownContentRow);
|
|
2851
|
+
tableRow.appendChild(bottomArrowRow);
|
|
2852
|
+
} else {
|
|
2853
|
+
tableRow.appendChild(tableRowsData);
|
|
2854
|
+
tableRow.appendChild(dropdownContentRow);
|
|
2855
|
+
}
|
|
2856
|
+
return tableRow;
|
|
2857
|
+
}
|
|
2858
|
+
createDataCell(item, column, totalColumns) {
|
|
2859
|
+
const dataCell = document.createElement("div");
|
|
2860
|
+
const cellLocation = column.cellLocation || "relative";
|
|
2861
|
+
dataCell.className = `data-cell data-${column.key}`;
|
|
2862
|
+
dataCell.setAttribute("part", `data-cell data-${column.key}`);
|
|
2863
|
+
dataCell.style.flex = column.renderCell && cellLocation !== "relative" ? String(totalColumns) : "1";
|
|
2864
|
+
dataCell.dataset.itemId = String(item.id);
|
|
2865
|
+
const cellContent = column.renderCell ? column.renderCell(item) : item[column.key];
|
|
2866
|
+
if (cellContent instanceof HTMLElement || cellContent instanceof DocumentFragment) {
|
|
2867
|
+
dataCell.appendChild(cellContent);
|
|
2868
|
+
} else {
|
|
2869
|
+
dataCell.textContent = cellContent !== void 0 && cellContent !== null ? String(cellContent) : "";
|
|
5020
2870
|
}
|
|
2871
|
+
return dataCell;
|
|
2872
|
+
}
|
|
2873
|
+
createDropdownButtonCell(item) {
|
|
2874
|
+
const cell = document.createElement("div");
|
|
2875
|
+
cell.className = "dropdown-button-cell data-cell";
|
|
2876
|
+
cell.setAttribute("part", "dropdown-button-cell data-cell");
|
|
2877
|
+
if (this._dropdownArrowLocation === "bottom") {
|
|
2878
|
+
cell.style.textAlign = "center";
|
|
2879
|
+
cell.style.flex = String(this._columns.length);
|
|
2880
|
+
} else {
|
|
2881
|
+
cell.style.flex = "0.2";
|
|
2882
|
+
}
|
|
2883
|
+
if (item.dropdown) {
|
|
2884
|
+
const button = document.createElement("button");
|
|
2885
|
+
button.className = "dropdown-button all-buttons";
|
|
2886
|
+
button.setAttribute("part", "dropdown-button all-buttons");
|
|
2887
|
+
button.dataset.itemId = String(item.id);
|
|
2888
|
+
if (typeof this._dropdownButtonIcon === "string") {
|
|
2889
|
+
button.innerHTML = this._dropdownButtonIcon;
|
|
2890
|
+
} else {
|
|
2891
|
+
button.appendChild(this._dropdownButtonIcon.cloneNode(true));
|
|
2892
|
+
}
|
|
2893
|
+
cell.appendChild(button);
|
|
2894
|
+
} else {
|
|
2895
|
+
const emptyDiv = document.createElement("div");
|
|
2896
|
+
emptyDiv.className = "empty-dropdown-button all-buttons";
|
|
2897
|
+
emptyDiv.setAttribute("part", "empty-dropdown-button all-buttons");
|
|
2898
|
+
cell.appendChild(emptyDiv);
|
|
2899
|
+
}
|
|
2900
|
+
return cell;
|
|
2901
|
+
}
|
|
2902
|
+
createDropdownContentRow(item, totalColumns) {
|
|
2903
|
+
const row = document.createElement("div");
|
|
2904
|
+
row.className = "dropdown-row";
|
|
2905
|
+
row.setAttribute("part", "dropdown-row");
|
|
2906
|
+
const cell = document.createElement("div");
|
|
2907
|
+
cell.className = "dropdown-cell";
|
|
2908
|
+
cell.setAttribute("part", "dropdown-cell");
|
|
2909
|
+
cell.style.flex = String(totalColumns);
|
|
2910
|
+
const content = document.createElement("div");
|
|
2911
|
+
content.className = "dropdown-content";
|
|
2912
|
+
content.setAttribute("part", "dropdown-content");
|
|
2913
|
+
content.id = `dropdown-${item.id}`;
|
|
2914
|
+
content.hidden = true;
|
|
2915
|
+
cell.appendChild(content);
|
|
2916
|
+
row.appendChild(cell);
|
|
2917
|
+
return row;
|
|
5021
2918
|
}
|
|
5022
2919
|
handleDropdownClick() {
|
|
5023
2920
|
const tableRowsContainer = this.shadow.getElementById("table-body");
|
|
2921
|
+
if (!tableRowsContainer) return;
|
|
5024
2922
|
tableRowsContainer.addEventListener("click", (event) => {
|
|
5025
2923
|
const clickedButton = event.target.closest(".dropdown-button");
|
|
5026
2924
|
if (clickedButton) {
|
|
@@ -5028,19 +2926,17 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
5028
2926
|
const dropdownContainer = this.shadow.getElementById(`dropdown-${itemId}`);
|
|
5029
2927
|
if (dropdownContainer) {
|
|
5030
2928
|
const itemData = this._data.find((item) => String(item.id) === String(itemId));
|
|
5031
|
-
if (dropdownContainer.hidden
|
|
2929
|
+
if (dropdownContainer.hidden) {
|
|
5032
2930
|
if (itemData && itemData.dropdown) {
|
|
5033
2931
|
dropdownContainer.hidden = false;
|
|
5034
|
-
if ((
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
container: dropdownContainer,
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
});
|
|
5043
|
-
this.dispatchEvent(getReactDropdown);
|
|
2932
|
+
if (isReactElement(itemData.dropdown)) {
|
|
2933
|
+
this.dispatchEvent(
|
|
2934
|
+
new CustomEvent("getReactDropdown", {
|
|
2935
|
+
detail: { container: dropdownContainer, itemId },
|
|
2936
|
+
bubbles: true,
|
|
2937
|
+
composed: true
|
|
2938
|
+
})
|
|
2939
|
+
);
|
|
5044
2940
|
} else if (itemData.dropdown instanceof HTMLElement) {
|
|
5045
2941
|
dropdownContainer.appendChild(itemData.dropdown);
|
|
5046
2942
|
} else {
|
|
@@ -5049,16 +2945,14 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
5049
2945
|
clickedButton.classList.add("open");
|
|
5050
2946
|
}
|
|
5051
2947
|
} else {
|
|
5052
|
-
if (itemData && itemData.dropdown) {
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
);
|
|
5061
|
-
}
|
|
2948
|
+
if (itemData && itemData.dropdown && isReactElement(itemData.dropdown)) {
|
|
2949
|
+
this.dispatchEvent(
|
|
2950
|
+
new CustomEvent("cleanupDropdown", {
|
|
2951
|
+
detail: { container: dropdownContainer },
|
|
2952
|
+
bubbles: true,
|
|
2953
|
+
composed: true
|
|
2954
|
+
})
|
|
2955
|
+
);
|
|
5062
2956
|
}
|
|
5063
2957
|
dropdownContainer.hidden = true;
|
|
5064
2958
|
clickedButton.classList.remove("open");
|
|
@@ -5069,30 +2963,18 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
5069
2963
|
}
|
|
5070
2964
|
handleSortClick() {
|
|
5071
2965
|
const tableHeader = this.shadow.getElementById("table-header-row");
|
|
5072
|
-
if (tableHeader)
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
}
|
|
5081
|
-
});
|
|
5082
|
-
const sortKey = clickedButton.getAttribute("data-sort-key");
|
|
5083
|
-
this.handleSort(sortKey);
|
|
5084
|
-
if (this._sortOrder === "asc") {
|
|
5085
|
-
clickedButton.classList.remove("desc");
|
|
5086
|
-
clickedButton.classList.add("asc");
|
|
5087
|
-
} else {
|
|
5088
|
-
clickedButton.classList.remove("asc");
|
|
5089
|
-
clickedButton.classList.add("desc");
|
|
5090
|
-
}
|
|
5091
|
-
});
|
|
5092
|
-
}
|
|
2966
|
+
if (!tableHeader) return;
|
|
2967
|
+
tableHeader.addEventListener("click", (event) => {
|
|
2968
|
+
const clickedButton = event.target.closest(".sort-button");
|
|
2969
|
+
if (!clickedButton) return;
|
|
2970
|
+
const sortKey = clickedButton.getAttribute("data-sort-key");
|
|
2971
|
+
this.handleSort(sortKey);
|
|
2972
|
+
this.renderHeader();
|
|
2973
|
+
});
|
|
5093
2974
|
}
|
|
5094
2975
|
handleActionClick() {
|
|
5095
2976
|
const tableBody = this.shadow.getElementById("table-body");
|
|
2977
|
+
if (!tableBody) return;
|
|
5096
2978
|
tableBody.addEventListener("click", (event) => {
|
|
5097
2979
|
const actionButton = event.target.closest(".action-button");
|
|
5098
2980
|
if (actionButton) {
|
|
@@ -5100,14 +2982,8 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
5100
2982
|
const id = actionButton.getAttribute("data-item");
|
|
5101
2983
|
this.dispatchEvent(
|
|
5102
2984
|
new CustomEvent("action", {
|
|
5103
|
-
detail: {
|
|
5104
|
-
action,
|
|
5105
|
-
// e.g., "edit", "view", or "delete"
|
|
5106
|
-
id,
|
|
5107
|
-
originalTarget: event.target
|
|
5108
|
-
},
|
|
2985
|
+
detail: { action, id, originalTarget: event.target },
|
|
5109
2986
|
bubbles: true,
|
|
5110
|
-
// Allows the event to be heard outside the Shadow DOM
|
|
5111
2987
|
composed: true
|
|
5112
2988
|
})
|
|
5113
2989
|
);
|
|
@@ -5115,51 +2991,65 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
5115
2991
|
});
|
|
5116
2992
|
}
|
|
5117
2993
|
handleSort(sortKey) {
|
|
5118
|
-
this._sortOrder === "asc" ?
|
|
2994
|
+
this._sortOrder = this._sortOrder === "asc" ? "desc" : "asc";
|
|
5119
2995
|
this._sortKey = sortKey;
|
|
2996
|
+
this.dispatchEvent(
|
|
2997
|
+
new CustomEvent("action", {
|
|
2998
|
+
detail: { action: "sort", id: this._sortKey, direction: this._sortOrder },
|
|
2999
|
+
bubbles: true,
|
|
3000
|
+
composed: true
|
|
3001
|
+
})
|
|
3002
|
+
);
|
|
3003
|
+
if (this._externalSort) return;
|
|
5120
3004
|
const sortedData = [..._nullishCoalesce(this._data, () => ( []))];
|
|
5121
3005
|
if (this._sortOrder) {
|
|
5122
3006
|
sortedData.sort((a, b) => {
|
|
5123
3007
|
const valueA = a[sortKey];
|
|
5124
3008
|
const valueB = b[sortKey];
|
|
5125
3009
|
if (typeof valueA === "string" && typeof valueB === "string") {
|
|
5126
|
-
|
|
5127
|
-
return valueA.localeCompare(valueB);
|
|
5128
|
-
} else {
|
|
5129
|
-
return valueB.localeCompare(valueA);
|
|
5130
|
-
}
|
|
3010
|
+
return this._sortOrder === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
|
|
5131
3011
|
} else if (typeof valueA === "number" && typeof valueB === "number") {
|
|
5132
|
-
|
|
5133
|
-
return valueA - valueB;
|
|
5134
|
-
} else {
|
|
5135
|
-
return valueB - valueA;
|
|
5136
|
-
}
|
|
5137
|
-
} else {
|
|
5138
|
-
return 0;
|
|
3012
|
+
return this._sortOrder === "asc" ? valueA - valueB : valueB - valueA;
|
|
5139
3013
|
}
|
|
3014
|
+
return 0;
|
|
5140
3015
|
});
|
|
5141
3016
|
}
|
|
5142
3017
|
this.renderRows(sortedData);
|
|
5143
3018
|
}
|
|
5144
3019
|
set setColumns(columns) {
|
|
5145
|
-
this.
|
|
3020
|
+
this._columns = this.normalizeColumns(columns);
|
|
3021
|
+
this.renderHeader();
|
|
5146
3022
|
}
|
|
5147
3023
|
set setData(data) {
|
|
5148
3024
|
this.renderRows(data);
|
|
5149
3025
|
}
|
|
5150
3026
|
set setDropdownArrowLocation(location) {
|
|
5151
3027
|
this._dropdownArrowLocation = location;
|
|
5152
|
-
this.
|
|
3028
|
+
this.renderHeader();
|
|
5153
3029
|
this.renderRows(this._data);
|
|
5154
3030
|
}
|
|
3031
|
+
set setExpanded(value) {
|
|
3032
|
+
this._expanded = value === "" || value === "true" || value === true;
|
|
3033
|
+
const dropdowns = this.shadow.querySelectorAll(".dropdown-content");
|
|
3034
|
+
const buttons = this.shadow.querySelectorAll(".dropdown-button");
|
|
3035
|
+
dropdowns.forEach((d) => {
|
|
3036
|
+
d.hidden = !this._expanded;
|
|
3037
|
+
});
|
|
3038
|
+
buttons.forEach((b) => {
|
|
3039
|
+
this._expanded ? b.classList.add("open") : b.classList.remove("open");
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
5155
3042
|
set setSortIcon(icon) {
|
|
5156
3043
|
this._sortIcon = icon;
|
|
5157
|
-
this.
|
|
3044
|
+
this.renderHeader();
|
|
5158
3045
|
}
|
|
5159
3046
|
set setDropdownButtonIcon(icon) {
|
|
5160
3047
|
this._dropdownButtonIcon = icon;
|
|
5161
3048
|
this.renderRows(this._data);
|
|
5162
3049
|
}
|
|
3050
|
+
set setExternalSort(value) {
|
|
3051
|
+
this._externalSort = value === "" || value === "true" || value === true;
|
|
3052
|
+
}
|
|
5163
3053
|
};
|
|
5164
3054
|
if (!customElements.get("wavelength-child-data-table")) {
|
|
5165
3055
|
customElements.define("wavelength-child-data-table", ChildDataTable);
|
|
@@ -6826,7 +4716,7 @@ if (!customElements.get("wavelength-search")) {
|
|
|
6826
4716
|
}
|
|
6827
4717
|
|
|
6828
4718
|
// src/web-components/wavelength-switch.template.html
|
|
6829
|
-
var wavelength_switch_template_default = '<style>\n :host {\n display: block;\n --font-color: #333;\n --font-size: 20px;\n --font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n --switch-color: #2196f3;\n --label-font: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n\n /* Variable-based sizing */\n --container-width: 60px;\n --container-height: 34px;\n --track-height: 22px;\n --knob-size: 28px;\n\n /* Internal Calculations */\n --track-top: calc((var(--container-height) - var(--track-height)) / 2);\n --knob-top: calc((var(--container-height) - var(--knob-size)) / 2);\n --knob-translate: calc(var(--container-width) - var(--knob-size));\n }\n\n :host([size="small"]) {\n --container-width: 40px;\n --container-height: 24px;\n --track-height: 14px;\n --knob-size: 20px;\n --font-size: 16px;\n }\n\n :host([size="large"]) {\n --container-width: 80px;\n --container-height: 48px;\n --track-height: 30px;\n --knob-size: 40px;\n --font-size: 24px;\n }\n\n /* Switch Base Styles */\n .switch {\n position: relative;\n display: inline-block;\n width: var(--container-width);\n height: var(--container-height);\n }\n\n .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n /* Slider (The Track) */\n .slider {\n position: absolute;\n cursor: pointer;\n top: var(--track-top);\n left: 0;\n right: 0;\n bottom: var(--track-top);\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: var(--track-height);\n }\n\n .slider:hover {\n cursor: pointer;\n }\n\n /* Handle (The Slider Portion) */\n .slider:before {\n position: absolute;\n content: "";\n height: var(--knob-size);\n width: var(--knob-size);\n left: 0;\n top: calc((var(--track-height) - var(--knob-size)) / 2);\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: var(--knob-size);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n z-index: 2;\n }\n\n .slider:hover:before {\n box-shadow:\n 0 2px 4px rgba(0, 0, 0, 0.3),\n 0 0 0 8px rgba(0, 0, 0, 0.1);\n }\n\n /* Input Checked State Styles */\n input:checked + .slider {\n background-color: var(--switch-color);\n }\n\n input:focus + .slider {\n box-shadow: 0 0 1px #2196f3;\n }\n\n input:checked + .slider:before {\n -webkit-transform: translateX(var(--knob-translate));\n -ms-transform: translateX(var(--knob-translate));\n transform: translateX(var(--knob-translate));\n }\n\n input:checked + .slider:hover:before {\n box-shadow:\n 0 2px 4px rgba(0, 0, 0, 0.3),\n 0 0 0 8px color-mix(in srgb, var(--switch-color), transparent 80%);\n }\n\n /* Disabled State Styles */\n input:disabled + .slider {\n background-color: #e0e0e0;\n cursor: not-allowed;\n }\n\n input:disabled + .slider:before {\n background-color: #f5f5f5;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n }\n\n input:disabled + .slider:hover:before {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n }\n\n input:disabled:checked + .slider {\n background-color: color-mix(in srgb, var(--switch-color), white 50%);\n opacity: 0.8;\n }\n\n /* Label Styles */\n .label {\n font-size: var(--font-size);\n font-weight: 500;\n color: var(--font-color);\n font-family: var(--label-font);\n }\n\n :host([disabled]) .label {\n color: #9e9e9e;\n }\n\n .flex-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n</style>\n\n<div class="flex-container">\n <span id="label-span" class="label"></span>\n <label class="switch">\n <input type="checkbox" aria-labelledby="label" />\n <div class="slider"></div>\n </label>\n</div>\n';
|
|
4719
|
+
var wavelength_switch_template_default = '<style>\n :host {\n display: block;\n --font-color: #333;\n --font-size: 20px;\n --font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n --switch-color: #2196f3;\n --label-font: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n\n /* Variable-based sizing */\n --container-width: 60px;\n --container-height: 34px;\n --track-height: 22px;\n --knob-size: 28px;\n\n /* Internal Calculations */\n --track-top: calc((var(--container-height) - var(--track-height)) / 2);\n --knob-top: calc((var(--container-height) - var(--knob-size)) / 2);\n --knob-translate: calc(var(--container-width) - var(--knob-size));\n }\n\n :host([size="small"]) {\n --container-width: 40px;\n --container-height: 24px;\n --track-height: 14px;\n --knob-size: 20px;\n --font-size: 16px;\n }\n\n :host([size="large"]) {\n --container-width: 80px;\n --container-height: 48px;\n --track-height: 30px;\n --knob-size: 40px;\n --font-size: 24px;\n }\n\n /* Switch Base Styles */\n .switch {\n position: relative;\n display: inline-block;\n width: var(--container-width);\n height: var(--container-height);\n }\n\n .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n /* Slider (The Track) */\n .slider {\n position: absolute;\n cursor: pointer;\n top: var(--track-top);\n left: 0;\n right: 0;\n bottom: var(--track-top);\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: var(--track-height);\n }\n\n .slider:hover {\n cursor: pointer;\n }\n\n /* Handle (The Slider Portion) */\n .slider:before {\n position: absolute;\n content: "";\n height: var(--knob-size);\n width: var(--knob-size);\n left: 0;\n top: calc((var(--track-height) - var(--knob-size)) / 2);\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: var(--knob-size);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n z-index: 2;\n }\n\n .slider:hover:before {\n box-shadow:\n 0 2px 4px rgba(0, 0, 0, 0.3),\n 0 0 0 8px rgba(0, 0, 0, 0.1);\n }\n\n /* Default \u2014 no ripple */\n input[type="range"]::-webkit-slider-thumb {\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);\n transition: box-shadow 0.2s ease;\n }\n\n /* Hover \u2014 small ripple */\n input[type="range"]:hover::-webkit-slider-thumb {\n box-shadow: 0 0 0 8px rgba(26, 111, 196, 0.15);\n }\n\n /* Active (click/hold) \u2014 larger ripple */\n input[type="range"]:active::-webkit-slider-thumb {\n box-shadow: 0 0 0 14px rgba(26, 111, 196, 0.2);\n }\n\n /* Input Checked State Styles */\n input:checked + .slider {\n background-color: var(--switch-color);\n }\n\n input:focus + .slider {\n box-shadow: 0 0 1px #2196f3;\n }\n\n input:checked + .slider:before {\n -webkit-transform: translateX(var(--knob-translate));\n -ms-transform: translateX(var(--knob-translate));\n transform: translateX(var(--knob-translate));\n }\n\n input:checked + .slider:hover:before {\n box-shadow:\n 0 2px 4px rgba(0, 0, 0, 0.3),\n 0 0 0 8px color-mix(in srgb, var(--switch-color), transparent 80%);\n }\n\n /* Disabled State Styles */\n input:disabled + .slider {\n background-color: #e0e0e0;\n cursor: not-allowed;\n }\n\n input:disabled + .slider:before {\n background-color: #f5f5f5;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n }\n\n input:disabled + .slider:hover:before {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n }\n\n input:disabled:checked + .slider {\n background-color: color-mix(in srgb, var(--switch-color), white 50%);\n opacity: 0.8;\n }\n\n /* Label Styles */\n .label {\n font-size: var(--font-size);\n font-weight: 500;\n color: var(--font-color);\n font-family: var(--label-font);\n }\n\n :host([disabled]) .label {\n color: #9e9e9e;\n }\n\n .flex-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n</style>\n\n<div class="flex-container">\n <span id="label-span" class="label"></span>\n <label class="switch">\n <input type="checkbox" aria-labelledby="label" />\n <div class="slider"></div>\n </label>\n</div>\n';
|
|
6830
4720
|
|
|
6831
4721
|
// src/web-components/wavelength-switch.ts
|
|
6832
4722
|
var WavelengthSwitch = class extends HTMLElement {
|
|
@@ -7339,6 +5229,339 @@ if (!customElements.get("wavelength-popup-menu")) {
|
|
|
7339
5229
|
customElements.define("wavelength-popup-menu", WavelengthPopUpMenu);
|
|
7340
5230
|
}
|
|
7341
5231
|
|
|
5232
|
+
// src/web-components/wavelength-slider.ts
|
|
5233
|
+
var template6 = `
|
|
5234
|
+
<style>
|
|
5235
|
+
:host {
|
|
5236
|
+
display: block;
|
|
5237
|
+
min-width: 200px;
|
|
5238
|
+
width: 100%;
|
|
5239
|
+
height: auto;
|
|
5240
|
+
|
|
5241
|
+
--selected-color: var(--track-selected-color, #1e90ff);
|
|
5242
|
+
--track-color: color-mix(in srgb, var(--selected-color), transparent 85%);
|
|
5243
|
+
--ripple-color: color-mix(in srgb, var(--selected-color), transparent 85%);
|
|
5244
|
+
--ripple-active-color: color-mix(in srgb, var(--selected-color), transparent 75%);
|
|
5245
|
+
|
|
5246
|
+
--thumb-size: 18px;
|
|
5247
|
+
--slider-width: 100%;
|
|
5248
|
+
}
|
|
5249
|
+
|
|
5250
|
+
/* \u2500\u2500 Container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5251
|
+
.container {
|
|
5252
|
+
position: relative;
|
|
5253
|
+
padding: 36px 14px 14px 14px; /* Slightly more padding */
|
|
5254
|
+
width: var(--slider-width);
|
|
5255
|
+
box-sizing: border-box;
|
|
5256
|
+
}
|
|
5257
|
+
|
|
5258
|
+
/* \u2500\u2500 Tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5259
|
+
.tooltip {
|
|
5260
|
+
position: absolute;
|
|
5261
|
+
top: 0;
|
|
5262
|
+
transform: translateX(-50%);
|
|
5263
|
+
background: var(--selected-color);
|
|
5264
|
+
color: #fff;
|
|
5265
|
+
font-size: 11px;
|
|
5266
|
+
padding: 3px 9px;
|
|
5267
|
+
border-radius: 5px;
|
|
5268
|
+
pointer-events: none;
|
|
5269
|
+
white-space: nowrap;
|
|
5270
|
+
letter-spacing: 0.06em;
|
|
5271
|
+
font-family: "Montserrat", sans-serif;
|
|
5272
|
+
z-index: 10;
|
|
5273
|
+
}
|
|
5274
|
+
/* Downward arrow on the tooltip */
|
|
5275
|
+
.tooltip::after {
|
|
5276
|
+
content: "";
|
|
5277
|
+
position: absolute;
|
|
5278
|
+
top: 100%;
|
|
5279
|
+
left: 50%;
|
|
5280
|
+
transform: translateX(-50%);
|
|
5281
|
+
border: 5px solid transparent;
|
|
5282
|
+
border-top-color: var(--selected-color);
|
|
5283
|
+
}
|
|
5284
|
+
|
|
5285
|
+
/* \u2500\u2500 Track \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5286
|
+
.track {
|
|
5287
|
+
position: relative;
|
|
5288
|
+
height: 6px;
|
|
5289
|
+
border-radius: 999px;
|
|
5290
|
+
background: var(--track-color);
|
|
5291
|
+
width: 100%;
|
|
5292
|
+
display: block;
|
|
5293
|
+
}
|
|
5294
|
+
|
|
5295
|
+
/* \u2500\u2500 Selected portion of the track \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5296
|
+
.track-selected {
|
|
5297
|
+
position: absolute;
|
|
5298
|
+
left: 0;
|
|
5299
|
+
top: 0;
|
|
5300
|
+
height: 100%;
|
|
5301
|
+
border-radius: 999px;
|
|
5302
|
+
background: var(--selected-color);
|
|
5303
|
+
pointer-events: none;
|
|
5304
|
+
display: block;
|
|
5305
|
+
}
|
|
5306
|
+
|
|
5307
|
+
/* \u2500\u2500 Marks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5308
|
+
.marks-container {
|
|
5309
|
+
position: absolute;
|
|
5310
|
+
left: 0;
|
|
5311
|
+
top: 0;
|
|
5312
|
+
width: 100%;
|
|
5313
|
+
height: 100%;
|
|
5314
|
+
pointer-events: none;
|
|
5315
|
+
z-index: 2;
|
|
5316
|
+
}
|
|
5317
|
+
.mark {
|
|
5318
|
+
position: absolute;
|
|
5319
|
+
top: 50%;
|
|
5320
|
+
transform: translate(-50%, -50%);
|
|
5321
|
+
width: 4px;
|
|
5322
|
+
height: 4px;
|
|
5323
|
+
background: #fff;
|
|
5324
|
+
border-radius: 50%;
|
|
5325
|
+
opacity: 0.6;
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
/* \u2500\u2500 Mark Labels \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5329
|
+
.marks-labels {
|
|
5330
|
+
position: relative;
|
|
5331
|
+
width: 100%;
|
|
5332
|
+
margin-top: 10px;
|
|
5333
|
+
height: 14px;
|
|
5334
|
+
pointer-events: none;
|
|
5335
|
+
}
|
|
5336
|
+
.mark-label {
|
|
5337
|
+
position: absolute;
|
|
5338
|
+
transform: translateX(-50%);
|
|
5339
|
+
font-size: 10px;
|
|
5340
|
+
color: var(--selected-color);
|
|
5341
|
+
font-family: "Montserrat", sans-serif;
|
|
5342
|
+
font-weight: 500;
|
|
5343
|
+
white-space: nowrap;
|
|
5344
|
+
opacity: 0.8;
|
|
5345
|
+
}
|
|
5346
|
+
|
|
5347
|
+
/* \u2500\u2500 Native <input> \u2014 reset and stretch over the track \u2500\u2500\u2500 */
|
|
5348
|
+
input[type="range"] {
|
|
5349
|
+
-webkit-appearance: none;
|
|
5350
|
+
appearance: none;
|
|
5351
|
+
position: absolute;
|
|
5352
|
+
left: 0;
|
|
5353
|
+
top: 50%;
|
|
5354
|
+
transform: translateY(-50%);
|
|
5355
|
+
width: 100%;
|
|
5356
|
+
height: 100%;
|
|
5357
|
+
background: transparent;
|
|
5358
|
+
cursor: pointer;
|
|
5359
|
+
margin: 0;
|
|
5360
|
+
padding: 0;
|
|
5361
|
+
z-index: 5;
|
|
5362
|
+
}
|
|
5363
|
+
|
|
5364
|
+
/* \u2500\u2500 Thumb \u2014 WebKit (Chrome, Safari, Edge) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5365
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
5366
|
+
-webkit-appearance: none;
|
|
5367
|
+
width: var(--thumb-size);
|
|
5368
|
+
height: var(--thumb-size);
|
|
5369
|
+
border-radius: 50%;
|
|
5370
|
+
background: var(--selected-color);
|
|
5371
|
+
border: 2px solid var(--selected-color);
|
|
5372
|
+
box-shadow: 0 0 0 0px var(--ripple-color);
|
|
5373
|
+
transition:
|
|
5374
|
+
box-shadow 0.2s ease,
|
|
5375
|
+
transform 0.15s ease;
|
|
5376
|
+
}
|
|
5377
|
+
input[type="range"]::-webkit-slider-thumb:hover {
|
|
5378
|
+
box-shadow: 0 0 0 8px var(--ripple-color);
|
|
5379
|
+
transform: scale(1.1);
|
|
5380
|
+
}
|
|
5381
|
+
input[type="range"]:active::-webkit-slider-thumb {
|
|
5382
|
+
box-shadow: 0 0 0 14px var(--ripple-active-color);
|
|
5383
|
+
transform: scale(1.15);
|
|
5384
|
+
}
|
|
5385
|
+
|
|
5386
|
+
/* \u2500\u2500 Thumb \u2014 Firefox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5387
|
+
input[type="range"]::-moz-range-thumb {
|
|
5388
|
+
width: var(--thumb-size);
|
|
5389
|
+
height: var(--thumb-size);
|
|
5390
|
+
border-radius: 50%;
|
|
5391
|
+
background: var(--selected-color);
|
|
5392
|
+
border: 2px solid var(--selected-color);
|
|
5393
|
+
box-shadow: 0 0 0 0px var(--ripple-color);
|
|
5394
|
+
transition: box-shadow 0.2s ease;
|
|
5395
|
+
cursor: grab;
|
|
5396
|
+
}
|
|
5397
|
+
input[type="range"]::-moz-range-thumb:hover {
|
|
5398
|
+
box-shadow: 0 0 0 8px var(--ripple-color);
|
|
5399
|
+
}
|
|
5400
|
+
input[type="range"]:active::-moz-range-thumb {
|
|
5401
|
+
box-shadow: 0 0 0 14px var(--ripple-active-color);
|
|
5402
|
+
cursor: grabbing;
|
|
5403
|
+
}
|
|
5404
|
+
input[type="range"]::-moz-range-track {
|
|
5405
|
+
background: transparent;
|
|
5406
|
+
}
|
|
5407
|
+
</style>
|
|
5408
|
+
|
|
5409
|
+
<div class="container" id="container">
|
|
5410
|
+
<span class="tooltip" id="tooltip"></span>
|
|
5411
|
+
<div class="track">
|
|
5412
|
+
<div class="marks-container" id="marks-container"></div>
|
|
5413
|
+
<span class="track-selected" id="track-selected"></span>
|
|
5414
|
+
<input type="range" id="slider" />
|
|
5415
|
+
</div>
|
|
5416
|
+
<div class="marks-labels" id="marks-labels"></div>
|
|
5417
|
+
</div>
|
|
5418
|
+
`;
|
|
5419
|
+
var WavelengthSlider = class extends HTMLElement {
|
|
5420
|
+
constructor() {
|
|
5421
|
+
super();
|
|
5422
|
+
this._cachedMarks = [];
|
|
5423
|
+
this.onInput = (e) => {
|
|
5424
|
+
const value = Number(e.target.value);
|
|
5425
|
+
const marks = this._cachedMarks;
|
|
5426
|
+
let finalValue = value;
|
|
5427
|
+
if (marks.length > 0) {
|
|
5428
|
+
const { range } = this.stats;
|
|
5429
|
+
const threshold = range * 0.01;
|
|
5430
|
+
const markValues = marks.map((m) => m.value);
|
|
5431
|
+
const nearest = markValues.reduce((prev, curr) => Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev);
|
|
5432
|
+
if (Math.abs(nearest - value) <= threshold) {
|
|
5433
|
+
finalValue = nearest;
|
|
5434
|
+
}
|
|
5435
|
+
}
|
|
5436
|
+
this.sliderEl.value = finalValue.toString();
|
|
5437
|
+
this._updateVisualState(finalValue);
|
|
5438
|
+
this.dispatchEvent(
|
|
5439
|
+
new CustomEvent("slider-change", {
|
|
5440
|
+
detail: { value: finalValue },
|
|
5441
|
+
bubbles: true,
|
|
5442
|
+
composed: true
|
|
5443
|
+
})
|
|
5444
|
+
);
|
|
5445
|
+
};
|
|
5446
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
5447
|
+
this.shadow.innerHTML = template6;
|
|
5448
|
+
}
|
|
5449
|
+
static get observedAttributes() {
|
|
5450
|
+
return ["min-val", "max-val", "step", "value", "value-displayed", "marks", "color", "width"];
|
|
5451
|
+
}
|
|
5452
|
+
connectedCallback() {
|
|
5453
|
+
this._updateCachedMarks();
|
|
5454
|
+
this.sliderEl = this.shadow.querySelector("#slider");
|
|
5455
|
+
this.tooltipEl = this.shadow.querySelector("#tooltip");
|
|
5456
|
+
this.trackSelectedEl = this.shadow.querySelector("#track-selected");
|
|
5457
|
+
this.containerEl = this.shadow.querySelector("#container");
|
|
5458
|
+
this.marksEl = this.shadow.querySelector("#marks-container");
|
|
5459
|
+
this.labelsEl = this.shadow.querySelector("#marks-labels");
|
|
5460
|
+
this.sliderEl.addEventListener("input", this.onInput);
|
|
5461
|
+
this._syncCoreAttributes();
|
|
5462
|
+
if (this.hasAttribute("value")) {
|
|
5463
|
+
this.sliderEl.value = this.getAttribute("value");
|
|
5464
|
+
}
|
|
5465
|
+
this._renderMarks();
|
|
5466
|
+
this.resizeObserver = new ResizeObserver(() => this._updateVisualState(this.value));
|
|
5467
|
+
this.resizeObserver.observe(this.containerEl);
|
|
5468
|
+
}
|
|
5469
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
5470
|
+
if (oldValue === newValue || !this.sliderEl) return;
|
|
5471
|
+
if (["min-val", "max-val", "step", "color", "width"].includes(name)) {
|
|
5472
|
+
this._syncCoreAttributes();
|
|
5473
|
+
this._renderMarks();
|
|
5474
|
+
this._updateVisualState(this.value);
|
|
5475
|
+
}
|
|
5476
|
+
if (name === "value") {
|
|
5477
|
+
if (this.sliderEl) this.sliderEl.value = newValue;
|
|
5478
|
+
this._updateVisualState(this.value);
|
|
5479
|
+
}
|
|
5480
|
+
if (name === "marks") {
|
|
5481
|
+
this._updateCachedMarks();
|
|
5482
|
+
this._renderMarks();
|
|
5483
|
+
}
|
|
5484
|
+
}
|
|
5485
|
+
disconnectedCallback() {
|
|
5486
|
+
this.sliderEl.removeEventListener("input", this.onInput);
|
|
5487
|
+
if (this.resizeObserver) this.resizeObserver.disconnect();
|
|
5488
|
+
}
|
|
5489
|
+
get stats() {
|
|
5490
|
+
const min = Number(_optionalChain([this, 'access', _113 => _113.sliderEl, 'optionalAccess', _114 => _114.min]) || this.getAttribute("min-val") || 0);
|
|
5491
|
+
const max = Number(_optionalChain([this, 'access', _115 => _115.sliderEl, 'optionalAccess', _116 => _116.max]) || this.getAttribute("max-val") || 100);
|
|
5492
|
+
const range = max - min;
|
|
5493
|
+
return { min, max, range };
|
|
5494
|
+
}
|
|
5495
|
+
_updateCachedMarks() {
|
|
5496
|
+
const attr = this.getAttribute("marks");
|
|
5497
|
+
if (!attr) {
|
|
5498
|
+
this._cachedMarks = [];
|
|
5499
|
+
return;
|
|
5500
|
+
}
|
|
5501
|
+
try {
|
|
5502
|
+
const parsed = JSON.parse(attr);
|
|
5503
|
+
this._cachedMarks = parsed.map((m) => typeof m === "number" ? { value: m, label: m.toString() } : m);
|
|
5504
|
+
} catch (e2) {
|
|
5505
|
+
this._cachedMarks = [];
|
|
5506
|
+
}
|
|
5507
|
+
}
|
|
5508
|
+
_syncCoreAttributes() {
|
|
5509
|
+
if (!this.sliderEl) return;
|
|
5510
|
+
this.sliderEl.setAttribute("min", _nullishCoalesce(this.getAttribute("min-val"), () => ( "0")));
|
|
5511
|
+
this.sliderEl.setAttribute("max", _nullishCoalesce(this.getAttribute("max-val"), () => ( "100")));
|
|
5512
|
+
this.sliderEl.setAttribute("step", _nullishCoalesce(this.getAttribute("step"), () => ( "1")));
|
|
5513
|
+
const width = this.getAttribute("width");
|
|
5514
|
+
if (width) this.style.setProperty("--slider-width", width);
|
|
5515
|
+
else this.style.removeProperty("--slider-width");
|
|
5516
|
+
const color = this.getAttribute("color");
|
|
5517
|
+
if (color) this.style.setProperty("--track-selected-color", color);
|
|
5518
|
+
else this.style.removeProperty("--track-selected-color");
|
|
5519
|
+
}
|
|
5520
|
+
_renderMarks() {
|
|
5521
|
+
if (!this.marksEl || !this.labelsEl) return;
|
|
5522
|
+
this.marksEl.innerHTML = this.labelsEl.innerHTML = "";
|
|
5523
|
+
const marks = this._cachedMarks;
|
|
5524
|
+
const { min, max, range } = this.stats;
|
|
5525
|
+
marks.forEach(({ value, label: txt }) => {
|
|
5526
|
+
if (value < min || value > max) return;
|
|
5527
|
+
const percent = range > 0 ? (value - min) / range : 0;
|
|
5528
|
+
const pos = this.calculatePosition(percent);
|
|
5529
|
+
const mark = document.createElement("div");
|
|
5530
|
+
mark.className = "mark";
|
|
5531
|
+
mark.style.left = `${pos}px`;
|
|
5532
|
+
this.marksEl.appendChild(mark);
|
|
5533
|
+
const label = document.createElement("div");
|
|
5534
|
+
label.className = "mark-label";
|
|
5535
|
+
label.style.left = `${pos}px`;
|
|
5536
|
+
label.textContent = txt;
|
|
5537
|
+
this.labelsEl.appendChild(label);
|
|
5538
|
+
});
|
|
5539
|
+
}
|
|
5540
|
+
_updateVisualState(value) {
|
|
5541
|
+
if (!this.sliderEl || !this.containerEl) return;
|
|
5542
|
+
const { min, range } = this.stats;
|
|
5543
|
+
const percent = range > 0 ? (value - min) / range : 0;
|
|
5544
|
+
const localPos = this.calculatePosition(percent);
|
|
5545
|
+
const trackOffset = this.sliderEl.parentElement.offsetLeft || 0;
|
|
5546
|
+
this.trackSelectedEl.style.width = `${percent * 100}%`;
|
|
5547
|
+
this.tooltipEl.textContent = this.getAttribute("value-displayed") || String(value);
|
|
5548
|
+
this.tooltipEl.style.left = `${trackOffset + localPos}px`;
|
|
5549
|
+
}
|
|
5550
|
+
get value() {
|
|
5551
|
+
return Number(_nullishCoalesce(_nullishCoalesce(_optionalChain([this, 'access', _117 => _117.sliderEl, 'optionalAccess', _118 => _118.value]), () => ( this.getAttribute("value"))), () => ( 0)));
|
|
5552
|
+
}
|
|
5553
|
+
set value(v) {
|
|
5554
|
+
this.setAttribute("value", String(v));
|
|
5555
|
+
}
|
|
5556
|
+
calculatePosition(percent) {
|
|
5557
|
+
const thumbHalf = 9;
|
|
5558
|
+
const trackWidth = _optionalChain([this, 'access', _119 => _119.sliderEl, 'optionalAccess', _120 => _120.offsetWidth]) || 0;
|
|
5559
|
+
return percent * trackWidth + thumbHalf - percent * (thumbHalf * 2);
|
|
5560
|
+
}
|
|
5561
|
+
};
|
|
5562
|
+
if (!customElements.get("wavelength-slider")) {
|
|
5563
|
+
customElements.define("wavelength-slider", WavelengthSlider);
|
|
5564
|
+
}
|
|
7342
5565
|
|
|
7343
5566
|
|
|
7344
5567
|
|
|
@@ -7368,29 +5591,7 @@ if (!customElements.get("wavelength-popup-menu")) {
|
|
|
7368
5591
|
|
|
7369
5592
|
|
|
7370
5593
|
|
|
7371
|
-
exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBadge = WavelengthBadge; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDialog = WavelengthDialog; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMenu = WavelengthMenu; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPagination = WavelengthPagination; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSwitch = WavelengthSwitch; exports.WavelengthTitleBar = WavelengthTitleBar; exports.WavelengthToolTip = WavelengthToolTip;
|
|
7372
|
-
/*! Bundled license information:
|
|
7373
5594
|
|
|
7374
|
-
react/cjs/react.production.min.js:
|
|
7375
|
-
(**
|
|
7376
|
-
* @license React
|
|
7377
|
-
* react.production.min.js
|
|
7378
|
-
*
|
|
7379
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7380
|
-
*
|
|
7381
|
-
* This source code is licensed under the MIT license found in the
|
|
7382
|
-
* LICENSE file in the root directory of this source tree.
|
|
7383
|
-
*)
|
|
7384
5595
|
|
|
7385
|
-
|
|
7386
|
-
(**
|
|
7387
|
-
* @license React
|
|
7388
|
-
* react.development.js
|
|
7389
|
-
*
|
|
7390
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7391
|
-
*
|
|
7392
|
-
* This source code is licensed under the MIT license found in the
|
|
7393
|
-
* LICENSE file in the root directory of this source tree.
|
|
7394
|
-
*)
|
|
7395
|
-
*/
|
|
5596
|
+
exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBadge = WavelengthBadge; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDialog = WavelengthDialog; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMenu = WavelengthMenu; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPagination = WavelengthPagination; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSwitch = WavelengthSwitch; exports.WavelengthTitleBar = WavelengthTitleBar; exports.WavelengthToolTip = WavelengthToolTip;
|
|
7396
5597
|
//# sourceMappingURL=index.cjs.map
|