@secondstaxorg/sscomp 1.2.3 → 1.2.9
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/index.es.js +699 -699
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +293 -3086
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +699 -699
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,2818 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var React$2 = require('react');
|
|
3
4
|
var styled = require('styled-components');
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
9
21
|
}
|
|
10
22
|
|
|
11
|
-
var
|
|
12
|
-
var react = {
|
|
13
|
-
get exports(){ return reactExports; },
|
|
14
|
-
set exports(v){ reactExports = v; },
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var react_production_min = {};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @license React
|
|
21
|
-
* react.production.min.js
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
var hasRequiredReact_production_min;
|
|
30
|
-
|
|
31
|
-
function requireReact_production_min () {
|
|
32
|
-
if (hasRequiredReact_production_min) return react_production_min;
|
|
33
|
-
hasRequiredReact_production_min = 1;
|
|
34
|
-
var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return "function"===typeof a?a:null}
|
|
35
|
-
var B={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B;}E.prototype.isReactComponent={};
|
|
36
|
-
E.prototype.setState=function(a,b){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.");this.updater.enqueueSetState(this,a,b,"setState");};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B;}var H=G.prototype=new F;
|
|
37
|
-
H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
|
|
38
|
-
function M(a,b,e){var d,c={},k=null,h=null;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]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f;}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return {$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
|
|
39
|
-
function N(a,b){return {$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return "object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
40
|
-
function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0;}}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(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
|
|
41
|
-
a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c);}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);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.");return h}
|
|
42
|
-
function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b;},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b;});-1===a._status&&(a._status=0,a._result=b);}if(1===a._status)return a._result.default;throw a._result;}
|
|
43
|
-
var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};react_production_min.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments);},e);},count:function(a){var b=0;S(a,function(){b++;});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};react_production_min.Component=E;react_production_min.Fragment=p;
|
|
44
|
-
react_production_min.Profiler=r;react_production_min.PureComponent=G;react_production_min.StrictMode=q;react_production_min.Suspense=w;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
|
|
45
|
-
react_production_min.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
|
|
46
|
-
for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g;}return {$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};react_production_min.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};react_production_min.createElement=M;react_production_min.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};
|
|
47
|
-
react_production_min.forwardRef=function(a){return {$$typeof:v,render:a}};react_production_min.isValidElement=O;react_production_min.lazy=function(a){return {$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};react_production_min.memo=function(a,b){return {$$typeof:x,type:a,compare:void 0===b?null:b}};react_production_min.startTransition=function(a){var b=V.transition;V.transition={};try{a();}finally{V.transition=b;}};react_production_min.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.");};
|
|
48
|
-
react_production_min.useCallback=function(a,b){return U.current.useCallback(a,b)};react_production_min.useContext=function(a){return U.current.useContext(a)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(a){return U.current.useDeferredValue(a)};react_production_min.useEffect=function(a,b){return U.current.useEffect(a,b)};react_production_min.useId=function(){return U.current.useId()};react_production_min.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};
|
|
49
|
-
react_production_min.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};react_production_min.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return U.current.useMemo(a,b)};react_production_min.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};react_production_min.useRef=function(a){return U.current.useRef(a)};react_production_min.useState=function(a){return U.current.useState(a)};react_production_min.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};
|
|
50
|
-
react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.2.0";
|
|
51
|
-
return react_production_min;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var react_developmentExports = {};
|
|
55
|
-
var react_development = {
|
|
56
|
-
get exports(){ return react_developmentExports; },
|
|
57
|
-
set exports(v){ react_developmentExports = v; },
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @license React
|
|
62
|
-
* react.development.js
|
|
63
|
-
*
|
|
64
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the MIT license found in the
|
|
67
|
-
* LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
var hasRequiredReact_development;
|
|
71
|
-
|
|
72
|
-
function requireReact_development () {
|
|
73
|
-
if (hasRequiredReact_development) return react_developmentExports;
|
|
74
|
-
hasRequiredReact_development = 1;
|
|
75
|
-
(function (module, exports) {
|
|
76
|
-
|
|
77
|
-
if (process.env.NODE_ENV !== "production") {
|
|
78
|
-
(function() {
|
|
79
|
-
|
|
80
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
81
|
-
if (
|
|
82
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
83
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
84
|
-
'function'
|
|
85
|
-
) {
|
|
86
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
87
|
-
}
|
|
88
|
-
var ReactVersion = '18.2.0';
|
|
89
|
-
|
|
90
|
-
// ATTENTION
|
|
91
|
-
// When adding new symbols to this file,
|
|
92
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
93
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
94
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
95
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
96
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
97
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
98
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
99
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
100
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
101
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
102
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
103
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
104
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
105
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
106
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
107
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
108
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
109
|
-
function getIteratorFn(maybeIterable) {
|
|
110
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
115
|
-
|
|
116
|
-
if (typeof maybeIterator === 'function') {
|
|
117
|
-
return maybeIterator;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Keeps track of the current dispatcher.
|
|
125
|
-
*/
|
|
126
|
-
var ReactCurrentDispatcher = {
|
|
127
|
-
/**
|
|
128
|
-
* @internal
|
|
129
|
-
* @type {ReactComponent}
|
|
130
|
-
*/
|
|
131
|
-
current: null
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Keeps track of the current batch's configuration such as how long an update
|
|
136
|
-
* should suspend for if it needs to.
|
|
137
|
-
*/
|
|
138
|
-
var ReactCurrentBatchConfig = {
|
|
139
|
-
transition: null
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
var ReactCurrentActQueue = {
|
|
143
|
-
current: null,
|
|
144
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
145
|
-
isBatchingLegacy: false,
|
|
146
|
-
didScheduleLegacyUpdate: false
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Keeps track of the current owner.
|
|
151
|
-
*
|
|
152
|
-
* The current owner is the component who should own any components that are
|
|
153
|
-
* currently being constructed.
|
|
154
|
-
*/
|
|
155
|
-
var ReactCurrentOwner = {
|
|
156
|
-
/**
|
|
157
|
-
* @internal
|
|
158
|
-
* @type {ReactComponent}
|
|
159
|
-
*/
|
|
160
|
-
current: null
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
var ReactDebugCurrentFrame = {};
|
|
164
|
-
var currentExtraStackFrame = null;
|
|
165
|
-
function setExtraStackFrame(stack) {
|
|
166
|
-
{
|
|
167
|
-
currentExtraStackFrame = stack;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
{
|
|
172
|
-
ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
|
173
|
-
{
|
|
174
|
-
currentExtraStackFrame = stack;
|
|
175
|
-
}
|
|
176
|
-
}; // Stack implementation injected by the current renderer.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
180
|
-
|
|
181
|
-
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
182
|
-
var stack = ''; // Add an extra top frame while an element is being validated
|
|
183
|
-
|
|
184
|
-
if (currentExtraStackFrame) {
|
|
185
|
-
stack += currentExtraStackFrame;
|
|
186
|
-
} // Delegate to the injected renderer-specific implementation
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
190
|
-
|
|
191
|
-
if (impl) {
|
|
192
|
-
stack += impl() || '';
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return stack;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// -----------------------------------------------------------------------------
|
|
200
|
-
|
|
201
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
202
|
-
var enableCacheElement = false;
|
|
203
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
204
|
-
|
|
205
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
206
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
207
|
-
// issues in DEV builds.
|
|
208
|
-
|
|
209
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
210
|
-
|
|
211
|
-
var ReactSharedInternals = {
|
|
212
|
-
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
213
|
-
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
214
|
-
ReactCurrentOwner: ReactCurrentOwner
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
{
|
|
218
|
-
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
219
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// by calls to these methods by a Babel plugin.
|
|
223
|
-
//
|
|
224
|
-
// In PROD (or in packages without access to React internals),
|
|
225
|
-
// they are left as they are instead.
|
|
226
|
-
|
|
227
|
-
function warn(format) {
|
|
228
|
-
{
|
|
229
|
-
{
|
|
230
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
231
|
-
args[_key - 1] = arguments[_key];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
printWarning('warn', format, args);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function error(format) {
|
|
239
|
-
{
|
|
240
|
-
{
|
|
241
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
242
|
-
args[_key2 - 1] = arguments[_key2];
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
printWarning('error', format, args);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function printWarning(level, format, args) {
|
|
251
|
-
// When changing this logic, you might want to also
|
|
252
|
-
// update consoleWithStackDev.www.js as well.
|
|
253
|
-
{
|
|
254
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
255
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
256
|
-
|
|
257
|
-
if (stack !== '') {
|
|
258
|
-
format += '%s';
|
|
259
|
-
args = args.concat([stack]);
|
|
260
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
var argsWithFormat = args.map(function (item) {
|
|
264
|
-
return String(item);
|
|
265
|
-
}); // Careful: RN currently depends on this prefix
|
|
266
|
-
|
|
267
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
268
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
269
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
270
|
-
|
|
271
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
var didWarnStateUpdateForUnmountedComponent = {};
|
|
276
|
-
|
|
277
|
-
function warnNoop(publicInstance, callerName) {
|
|
278
|
-
{
|
|
279
|
-
var _constructor = publicInstance.constructor;
|
|
280
|
-
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
281
|
-
var warningKey = componentName + "." + callerName;
|
|
282
|
-
|
|
283
|
-
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
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);
|
|
288
|
-
|
|
289
|
-
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* This is the abstract API for an update queue.
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
var ReactNoopUpdateQueue = {
|
|
298
|
-
/**
|
|
299
|
-
* Checks whether or not this composite component is mounted.
|
|
300
|
-
* @param {ReactClass} publicInstance The instance we want to test.
|
|
301
|
-
* @return {boolean} True if mounted, false otherwise.
|
|
302
|
-
* @protected
|
|
303
|
-
* @final
|
|
304
|
-
*/
|
|
305
|
-
isMounted: function (publicInstance) {
|
|
306
|
-
return false;
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Forces an update. This should only be invoked when it is known with
|
|
311
|
-
* certainty that we are **not** in a DOM transaction.
|
|
312
|
-
*
|
|
313
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
314
|
-
* component's state has changed but `setState` was not called.
|
|
315
|
-
*
|
|
316
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
317
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
318
|
-
*
|
|
319
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
320
|
-
* @param {?function} callback Called after component is updated.
|
|
321
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
322
|
-
* @internal
|
|
323
|
-
*/
|
|
324
|
-
enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
|
325
|
-
warnNoop(publicInstance, 'forceUpdate');
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
330
|
-
* You should treat `this.state` as immutable.
|
|
331
|
-
*
|
|
332
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
333
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
334
|
-
*
|
|
335
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
336
|
-
* @param {object} completeState Next state.
|
|
337
|
-
* @param {?function} callback Called after component is updated.
|
|
338
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
339
|
-
* @internal
|
|
340
|
-
*/
|
|
341
|
-
enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
|
342
|
-
warnNoop(publicInstance, 'replaceState');
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
|
347
|
-
* internal. This provides a merging strategy that is not available to deep
|
|
348
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
349
|
-
* during the merge.
|
|
350
|
-
*
|
|
351
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
352
|
-
* @param {object} partialState Next partial state to be merged with state.
|
|
353
|
-
* @param {?function} callback Called after component is updated.
|
|
354
|
-
* @param {?string} Name of the calling function in the public API.
|
|
355
|
-
* @internal
|
|
356
|
-
*/
|
|
357
|
-
enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
|
358
|
-
warnNoop(publicInstance, 'setState');
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
var assign = Object.assign;
|
|
363
|
-
|
|
364
|
-
var emptyObject = {};
|
|
365
|
-
|
|
366
|
-
{
|
|
367
|
-
Object.freeze(emptyObject);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Base class helpers for the updating state of a component.
|
|
371
|
-
*/
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
function Component(props, context, updater) {
|
|
375
|
-
this.props = props;
|
|
376
|
-
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
377
|
-
|
|
378
|
-
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
|
|
379
|
-
// renderer.
|
|
380
|
-
|
|
381
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
Component.prototype.isReactComponent = {};
|
|
385
|
-
/**
|
|
386
|
-
* Sets a subset of the state. Always use this to mutate
|
|
387
|
-
* state. You should treat `this.state` as immutable.
|
|
388
|
-
*
|
|
389
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
390
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
391
|
-
*
|
|
392
|
-
* There is no guarantee that calls to `setState` will run synchronously,
|
|
393
|
-
* as they may eventually be batched together. You can provide an optional
|
|
394
|
-
* callback that will be executed when the call to setState is actually
|
|
395
|
-
* completed.
|
|
396
|
-
*
|
|
397
|
-
* When a function is provided to setState, it will be called at some point in
|
|
398
|
-
* the future (not synchronously). It will be called with the up to date
|
|
399
|
-
* component arguments (state, props, context). These values can be different
|
|
400
|
-
* from this.* because your function may be called after receiveProps but before
|
|
401
|
-
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
402
|
-
* assigned to this.
|
|
403
|
-
*
|
|
404
|
-
* @param {object|function} partialState Next partial state or function to
|
|
405
|
-
* produce next partial state to be merged with current state.
|
|
406
|
-
* @param {?function} callback Called after state is updated.
|
|
407
|
-
* @final
|
|
408
|
-
* @protected
|
|
409
|
-
*/
|
|
410
|
-
|
|
411
|
-
Component.prototype.setState = function (partialState, callback) {
|
|
412
|
-
if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
|
|
413
|
-
throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
417
|
-
};
|
|
418
|
-
/**
|
|
419
|
-
* Forces an update. This should only be invoked when it is known with
|
|
420
|
-
* certainty that we are **not** in a DOM transaction.
|
|
421
|
-
*
|
|
422
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
423
|
-
* component's state has changed but `setState` was not called.
|
|
424
|
-
*
|
|
425
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
426
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
427
|
-
*
|
|
428
|
-
* @param {?function} callback Called after update is complete.
|
|
429
|
-
* @final
|
|
430
|
-
* @protected
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
Component.prototype.forceUpdate = function (callback) {
|
|
435
|
-
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
436
|
-
};
|
|
437
|
-
/**
|
|
438
|
-
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
439
|
-
* we would like to deprecate them, we're not going to move them over to this
|
|
440
|
-
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
441
|
-
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
{
|
|
445
|
-
var deprecatedAPIs = {
|
|
446
|
-
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
447
|
-
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
var defineDeprecationWarning = function (methodName, info) {
|
|
451
|
-
Object.defineProperty(Component.prototype, methodName, {
|
|
452
|
-
get: function () {
|
|
453
|
-
warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
454
|
-
|
|
455
|
-
return undefined;
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
for (var fnName in deprecatedAPIs) {
|
|
461
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
462
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function ComponentDummy() {}
|
|
468
|
-
|
|
469
|
-
ComponentDummy.prototype = Component.prototype;
|
|
470
|
-
/**
|
|
471
|
-
* Convenience component with default shallow equality check for sCU.
|
|
472
|
-
*/
|
|
473
|
-
|
|
474
|
-
function PureComponent(props, context, updater) {
|
|
475
|
-
this.props = props;
|
|
476
|
-
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
477
|
-
|
|
478
|
-
this.refs = emptyObject;
|
|
479
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
483
|
-
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
484
|
-
|
|
485
|
-
assign(pureComponentPrototype, Component.prototype);
|
|
486
|
-
pureComponentPrototype.isPureReactComponent = true;
|
|
487
|
-
|
|
488
|
-
// an immutable object with a single mutable value
|
|
489
|
-
function createRef() {
|
|
490
|
-
var refObject = {
|
|
491
|
-
current: null
|
|
492
|
-
};
|
|
493
|
-
|
|
494
|
-
{
|
|
495
|
-
Object.seal(refObject);
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
return refObject;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
502
|
-
|
|
503
|
-
function isArray(a) {
|
|
504
|
-
return isArrayImpl(a);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/*
|
|
508
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
509
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
510
|
-
*
|
|
511
|
-
* The functions in this module will throw an easier-to-understand,
|
|
512
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
513
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
514
|
-
* of the `value` object).
|
|
515
|
-
*/
|
|
516
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
517
|
-
function typeName(value) {
|
|
518
|
-
{
|
|
519
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
520
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
521
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
522
|
-
return type;
|
|
523
|
-
}
|
|
524
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
function willCoercionThrow(value) {
|
|
528
|
-
{
|
|
529
|
-
try {
|
|
530
|
-
testStringCoercion(value);
|
|
531
|
-
return false;
|
|
532
|
-
} catch (e) {
|
|
533
|
-
return true;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
function testStringCoercion(value) {
|
|
539
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
540
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
541
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
542
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
543
|
-
//
|
|
544
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
545
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
546
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
547
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
548
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
549
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
550
|
-
//
|
|
551
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
552
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
553
|
-
//
|
|
554
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
555
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
556
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
557
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
558
|
-
// In most cases, this console output also shows the component and its
|
|
559
|
-
// ancestor components where the exception happened.
|
|
560
|
-
//
|
|
561
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
562
|
-
return '' + value;
|
|
563
|
-
}
|
|
564
|
-
function checkKeyStringCoercion(value) {
|
|
565
|
-
{
|
|
566
|
-
if (willCoercionThrow(value)) {
|
|
567
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
568
|
-
|
|
569
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
575
|
-
var displayName = outerType.displayName;
|
|
576
|
-
|
|
577
|
-
if (displayName) {
|
|
578
|
-
return displayName;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
582
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
583
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
function getContextName(type) {
|
|
587
|
-
return type.displayName || 'Context';
|
|
588
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
function getComponentNameFromType(type) {
|
|
592
|
-
if (type == null) {
|
|
593
|
-
// Host root, text node or just invalid type.
|
|
594
|
-
return null;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
{
|
|
598
|
-
if (typeof type.tag === 'number') {
|
|
599
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
if (typeof type === 'function') {
|
|
604
|
-
return type.displayName || type.name || null;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
if (typeof type === 'string') {
|
|
608
|
-
return type;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
switch (type) {
|
|
612
|
-
case REACT_FRAGMENT_TYPE:
|
|
613
|
-
return 'Fragment';
|
|
614
|
-
|
|
615
|
-
case REACT_PORTAL_TYPE:
|
|
616
|
-
return 'Portal';
|
|
617
|
-
|
|
618
|
-
case REACT_PROFILER_TYPE:
|
|
619
|
-
return 'Profiler';
|
|
620
|
-
|
|
621
|
-
case REACT_STRICT_MODE_TYPE:
|
|
622
|
-
return 'StrictMode';
|
|
623
|
-
|
|
624
|
-
case REACT_SUSPENSE_TYPE:
|
|
625
|
-
return 'Suspense';
|
|
626
|
-
|
|
627
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
628
|
-
return 'SuspenseList';
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
if (typeof type === 'object') {
|
|
633
|
-
switch (type.$$typeof) {
|
|
634
|
-
case REACT_CONTEXT_TYPE:
|
|
635
|
-
var context = type;
|
|
636
|
-
return getContextName(context) + '.Consumer';
|
|
637
|
-
|
|
638
|
-
case REACT_PROVIDER_TYPE:
|
|
639
|
-
var provider = type;
|
|
640
|
-
return getContextName(provider._context) + '.Provider';
|
|
641
|
-
|
|
642
|
-
case REACT_FORWARD_REF_TYPE:
|
|
643
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
644
|
-
|
|
645
|
-
case REACT_MEMO_TYPE:
|
|
646
|
-
var outerName = type.displayName || null;
|
|
647
|
-
|
|
648
|
-
if (outerName !== null) {
|
|
649
|
-
return outerName;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
653
|
-
|
|
654
|
-
case REACT_LAZY_TYPE:
|
|
655
|
-
{
|
|
656
|
-
var lazyComponent = type;
|
|
657
|
-
var payload = lazyComponent._payload;
|
|
658
|
-
var init = lazyComponent._init;
|
|
659
|
-
|
|
660
|
-
try {
|
|
661
|
-
return getComponentNameFromType(init(payload));
|
|
662
|
-
} catch (x) {
|
|
663
|
-
return null;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
// eslint-disable-next-line no-fallthrough
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
return null;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
675
|
-
|
|
676
|
-
var RESERVED_PROPS = {
|
|
677
|
-
key: true,
|
|
678
|
-
ref: true,
|
|
679
|
-
__self: true,
|
|
680
|
-
__source: true
|
|
681
|
-
};
|
|
682
|
-
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
683
|
-
|
|
684
|
-
{
|
|
685
|
-
didWarnAboutStringRefs = {};
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
function hasValidRef(config) {
|
|
689
|
-
{
|
|
690
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
691
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
692
|
-
|
|
693
|
-
if (getter && getter.isReactWarning) {
|
|
694
|
-
return false;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
return config.ref !== undefined;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
function hasValidKey(config) {
|
|
703
|
-
{
|
|
704
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
705
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
706
|
-
|
|
707
|
-
if (getter && getter.isReactWarning) {
|
|
708
|
-
return false;
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
return config.key !== undefined;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
717
|
-
var warnAboutAccessingKey = function () {
|
|
718
|
-
{
|
|
719
|
-
if (!specialPropKeyWarningShown) {
|
|
720
|
-
specialPropKeyWarningShown = true;
|
|
721
|
-
|
|
722
|
-
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);
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
|
|
727
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
728
|
-
Object.defineProperty(props, 'key', {
|
|
729
|
-
get: warnAboutAccessingKey,
|
|
730
|
-
configurable: true
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
735
|
-
var warnAboutAccessingRef = function () {
|
|
736
|
-
{
|
|
737
|
-
if (!specialPropRefWarningShown) {
|
|
738
|
-
specialPropRefWarningShown = true;
|
|
739
|
-
|
|
740
|
-
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);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
|
|
745
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
746
|
-
Object.defineProperty(props, 'ref', {
|
|
747
|
-
get: warnAboutAccessingRef,
|
|
748
|
-
configurable: true
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
753
|
-
{
|
|
754
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
755
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
756
|
-
|
|
757
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
758
|
-
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);
|
|
759
|
-
|
|
760
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
/**
|
|
766
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
767
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
768
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
769
|
-
* if something is a React Element.
|
|
770
|
-
*
|
|
771
|
-
* @param {*} type
|
|
772
|
-
* @param {*} props
|
|
773
|
-
* @param {*} key
|
|
774
|
-
* @param {string|object} ref
|
|
775
|
-
* @param {*} owner
|
|
776
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
777
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
778
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
779
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
780
|
-
* change in behavior.
|
|
781
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
782
|
-
* indicating filename, line number, and/or other information.
|
|
783
|
-
* @internal
|
|
784
|
-
*/
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
788
|
-
var element = {
|
|
789
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
790
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
791
|
-
// Built-in properties that belong on the element
|
|
792
|
-
type: type,
|
|
793
|
-
key: key,
|
|
794
|
-
ref: ref,
|
|
795
|
-
props: props,
|
|
796
|
-
// Record the component responsible for creating this element.
|
|
797
|
-
_owner: owner
|
|
798
|
-
};
|
|
799
|
-
|
|
800
|
-
{
|
|
801
|
-
// The validation flag is currently mutative. We put it on
|
|
802
|
-
// an external backing store so that we can freeze the whole object.
|
|
803
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
804
|
-
// commonly used development environments.
|
|
805
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
806
|
-
// the validation flag non-enumerable (where possible, which should
|
|
807
|
-
// include every environment we run tests in), so the test framework
|
|
808
|
-
// ignores it.
|
|
809
|
-
|
|
810
|
-
Object.defineProperty(element._store, 'validated', {
|
|
811
|
-
configurable: false,
|
|
812
|
-
enumerable: false,
|
|
813
|
-
writable: true,
|
|
814
|
-
value: false
|
|
815
|
-
}); // self and source are DEV only properties.
|
|
816
|
-
|
|
817
|
-
Object.defineProperty(element, '_self', {
|
|
818
|
-
configurable: false,
|
|
819
|
-
enumerable: false,
|
|
820
|
-
writable: false,
|
|
821
|
-
value: self
|
|
822
|
-
}); // Two elements created in two different places should be considered
|
|
823
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
824
|
-
|
|
825
|
-
Object.defineProperty(element, '_source', {
|
|
826
|
-
configurable: false,
|
|
827
|
-
enumerable: false,
|
|
828
|
-
writable: false,
|
|
829
|
-
value: source
|
|
830
|
-
});
|
|
831
|
-
|
|
832
|
-
if (Object.freeze) {
|
|
833
|
-
Object.freeze(element.props);
|
|
834
|
-
Object.freeze(element);
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
return element;
|
|
839
|
-
};
|
|
840
|
-
/**
|
|
841
|
-
* Create and return a new ReactElement of the given type.
|
|
842
|
-
* See https://reactjs.org/docs/react-api.html#createelement
|
|
843
|
-
*/
|
|
844
|
-
|
|
845
|
-
function createElement(type, config, children) {
|
|
846
|
-
var propName; // Reserved names are extracted
|
|
847
|
-
|
|
848
|
-
var props = {};
|
|
849
|
-
var key = null;
|
|
850
|
-
var ref = null;
|
|
851
|
-
var self = null;
|
|
852
|
-
var source = null;
|
|
853
|
-
|
|
854
|
-
if (config != null) {
|
|
855
|
-
if (hasValidRef(config)) {
|
|
856
|
-
ref = config.ref;
|
|
857
|
-
|
|
858
|
-
{
|
|
859
|
-
warnIfStringRefCannotBeAutoConverted(config);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
if (hasValidKey(config)) {
|
|
864
|
-
{
|
|
865
|
-
checkKeyStringCoercion(config.key);
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
key = '' + config.key;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
self = config.__self === undefined ? null : config.__self;
|
|
872
|
-
source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
|
|
873
|
-
|
|
874
|
-
for (propName in config) {
|
|
875
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
876
|
-
props[propName] = config[propName];
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
} // Children can be more than one argument, and those are transferred onto
|
|
880
|
-
// the newly allocated props object.
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
var childrenLength = arguments.length - 2;
|
|
884
|
-
|
|
885
|
-
if (childrenLength === 1) {
|
|
886
|
-
props.children = children;
|
|
887
|
-
} else if (childrenLength > 1) {
|
|
888
|
-
var childArray = Array(childrenLength);
|
|
889
|
-
|
|
890
|
-
for (var i = 0; i < childrenLength; i++) {
|
|
891
|
-
childArray[i] = arguments[i + 2];
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
{
|
|
895
|
-
if (Object.freeze) {
|
|
896
|
-
Object.freeze(childArray);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
props.children = childArray;
|
|
901
|
-
} // Resolve default props
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
if (type && type.defaultProps) {
|
|
905
|
-
var defaultProps = type.defaultProps;
|
|
906
|
-
|
|
907
|
-
for (propName in defaultProps) {
|
|
908
|
-
if (props[propName] === undefined) {
|
|
909
|
-
props[propName] = defaultProps[propName];
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
{
|
|
915
|
-
if (key || ref) {
|
|
916
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
917
|
-
|
|
918
|
-
if (key) {
|
|
919
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
if (ref) {
|
|
923
|
-
defineRefPropWarningGetter(props, displayName);
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
929
|
-
}
|
|
930
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
|
931
|
-
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
932
|
-
return newElement;
|
|
933
|
-
}
|
|
934
|
-
/**
|
|
935
|
-
* Clone and return a new ReactElement using element as the starting point.
|
|
936
|
-
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
937
|
-
*/
|
|
938
|
-
|
|
939
|
-
function cloneElement(element, config, children) {
|
|
940
|
-
if (element === null || element === undefined) {
|
|
941
|
-
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
var propName; // Original props are copied
|
|
945
|
-
|
|
946
|
-
var props = assign({}, element.props); // Reserved names are extracted
|
|
947
|
-
|
|
948
|
-
var key = element.key;
|
|
949
|
-
var ref = element.ref; // Self is preserved since the owner is preserved.
|
|
950
|
-
|
|
951
|
-
var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
|
|
952
|
-
// transpiler, and the original source is probably a better indicator of the
|
|
953
|
-
// true owner.
|
|
954
|
-
|
|
955
|
-
var source = element._source; // Owner will be preserved, unless ref is overridden
|
|
956
|
-
|
|
957
|
-
var owner = element._owner;
|
|
958
|
-
|
|
959
|
-
if (config != null) {
|
|
960
|
-
if (hasValidRef(config)) {
|
|
961
|
-
// Silently steal the ref from the parent.
|
|
962
|
-
ref = config.ref;
|
|
963
|
-
owner = ReactCurrentOwner.current;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
if (hasValidKey(config)) {
|
|
967
|
-
{
|
|
968
|
-
checkKeyStringCoercion(config.key);
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
key = '' + config.key;
|
|
972
|
-
} // Remaining properties override existing props
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
var defaultProps;
|
|
976
|
-
|
|
977
|
-
if (element.type && element.type.defaultProps) {
|
|
978
|
-
defaultProps = element.type.defaultProps;
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
for (propName in config) {
|
|
982
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
983
|
-
if (config[propName] === undefined && defaultProps !== undefined) {
|
|
984
|
-
// Resolve default props
|
|
985
|
-
props[propName] = defaultProps[propName];
|
|
986
|
-
} else {
|
|
987
|
-
props[propName] = config[propName];
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
} // Children can be more than one argument, and those are transferred onto
|
|
992
|
-
// the newly allocated props object.
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
var childrenLength = arguments.length - 2;
|
|
996
|
-
|
|
997
|
-
if (childrenLength === 1) {
|
|
998
|
-
props.children = children;
|
|
999
|
-
} else if (childrenLength > 1) {
|
|
1000
|
-
var childArray = Array(childrenLength);
|
|
1001
|
-
|
|
1002
|
-
for (var i = 0; i < childrenLength; i++) {
|
|
1003
|
-
childArray[i] = arguments[i + 2];
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
props.children = childArray;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
1010
|
-
}
|
|
1011
|
-
/**
|
|
1012
|
-
* Verifies the object is a ReactElement.
|
|
1013
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1014
|
-
* @param {?object} object
|
|
1015
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1016
|
-
* @final
|
|
1017
|
-
*/
|
|
1018
|
-
|
|
1019
|
-
function isValidElement(object) {
|
|
1020
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
var SEPARATOR = '.';
|
|
1024
|
-
var SUBSEPARATOR = ':';
|
|
1025
|
-
/**
|
|
1026
|
-
* Escape and wrap key so it is safe to use as a reactid
|
|
1027
|
-
*
|
|
1028
|
-
* @param {string} key to be escaped.
|
|
1029
|
-
* @return {string} the escaped key.
|
|
1030
|
-
*/
|
|
1031
|
-
|
|
1032
|
-
function escape(key) {
|
|
1033
|
-
var escapeRegex = /[=:]/g;
|
|
1034
|
-
var escaperLookup = {
|
|
1035
|
-
'=': '=0',
|
|
1036
|
-
':': '=2'
|
|
1037
|
-
};
|
|
1038
|
-
var escapedString = key.replace(escapeRegex, function (match) {
|
|
1039
|
-
return escaperLookup[match];
|
|
1040
|
-
});
|
|
1041
|
-
return '$' + escapedString;
|
|
1042
|
-
}
|
|
1043
|
-
/**
|
|
1044
|
-
* TODO: Test that a single child and an array with one item have the same key
|
|
1045
|
-
* pattern.
|
|
1046
|
-
*/
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
var didWarnAboutMaps = false;
|
|
1050
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
1051
|
-
|
|
1052
|
-
function escapeUserProvidedKey(text) {
|
|
1053
|
-
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* Generate a key string that identifies a element within a set.
|
|
1057
|
-
*
|
|
1058
|
-
* @param {*} element A element that could contain a manual key.
|
|
1059
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
|
1060
|
-
* @return {string}
|
|
1061
|
-
*/
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
function getElementKey(element, index) {
|
|
1065
|
-
// Do some typechecking here since we call this blindly. We want to ensure
|
|
1066
|
-
// that we don't block potential future ES APIs.
|
|
1067
|
-
if (typeof element === 'object' && element !== null && element.key != null) {
|
|
1068
|
-
// Explicit key
|
|
1069
|
-
{
|
|
1070
|
-
checkKeyStringCoercion(element.key);
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
return escape('' + element.key);
|
|
1074
|
-
} // Implicit key determined by the index in the set
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
return index.toString(36);
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
1081
|
-
var type = typeof children;
|
|
1082
|
-
|
|
1083
|
-
if (type === 'undefined' || type === 'boolean') {
|
|
1084
|
-
// All of the above are perceived as null.
|
|
1085
|
-
children = null;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
var invokeCallback = false;
|
|
1089
|
-
|
|
1090
|
-
if (children === null) {
|
|
1091
|
-
invokeCallback = true;
|
|
1092
|
-
} else {
|
|
1093
|
-
switch (type) {
|
|
1094
|
-
case 'string':
|
|
1095
|
-
case 'number':
|
|
1096
|
-
invokeCallback = true;
|
|
1097
|
-
break;
|
|
1098
|
-
|
|
1099
|
-
case 'object':
|
|
1100
|
-
switch (children.$$typeof) {
|
|
1101
|
-
case REACT_ELEMENT_TYPE:
|
|
1102
|
-
case REACT_PORTAL_TYPE:
|
|
1103
|
-
invokeCallback = true;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
if (invokeCallback) {
|
|
1110
|
-
var _child = children;
|
|
1111
|
-
var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
|
|
1112
|
-
// so that it's consistent if the number of children grows:
|
|
1113
|
-
|
|
1114
|
-
var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
1115
|
-
|
|
1116
|
-
if (isArray(mappedChild)) {
|
|
1117
|
-
var escapedChildKey = '';
|
|
1118
|
-
|
|
1119
|
-
if (childKey != null) {
|
|
1120
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
|
|
1124
|
-
return c;
|
|
1125
|
-
});
|
|
1126
|
-
} else if (mappedChild != null) {
|
|
1127
|
-
if (isValidElement(mappedChild)) {
|
|
1128
|
-
{
|
|
1129
|
-
// The `if` statement here prevents auto-disabling of the safe
|
|
1130
|
-
// coercion ESLint rule, so we must manually disable it below.
|
|
1131
|
-
// $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1132
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
1133
|
-
checkKeyStringCoercion(mappedChild.key);
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1138
|
-
// traverseAllChildren used to do for objects as children
|
|
1139
|
-
escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1140
|
-
mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
1141
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1142
|
-
escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
array.push(mappedChild);
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
return 1;
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
var child;
|
|
1152
|
-
var nextName;
|
|
1153
|
-
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
1154
|
-
|
|
1155
|
-
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1156
|
-
|
|
1157
|
-
if (isArray(children)) {
|
|
1158
|
-
for (var i = 0; i < children.length; i++) {
|
|
1159
|
-
child = children[i];
|
|
1160
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
|
1161
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1162
|
-
}
|
|
1163
|
-
} else {
|
|
1164
|
-
var iteratorFn = getIteratorFn(children);
|
|
1165
|
-
|
|
1166
|
-
if (typeof iteratorFn === 'function') {
|
|
1167
|
-
var iterableChildren = children;
|
|
1168
|
-
|
|
1169
|
-
{
|
|
1170
|
-
// Warn about using Maps as children
|
|
1171
|
-
if (iteratorFn === iterableChildren.entries) {
|
|
1172
|
-
if (!didWarnAboutMaps) {
|
|
1173
|
-
warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
didWarnAboutMaps = true;
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
var iterator = iteratorFn.call(iterableChildren);
|
|
1181
|
-
var step;
|
|
1182
|
-
var ii = 0;
|
|
1183
|
-
|
|
1184
|
-
while (!(step = iterator.next()).done) {
|
|
1185
|
-
child = step.value;
|
|
1186
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1187
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1188
|
-
}
|
|
1189
|
-
} else if (type === 'object') {
|
|
1190
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1191
|
-
var childrenString = String(children);
|
|
1192
|
-
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.');
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
return subtreeCount;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* Maps children that are typically specified as `props.children`.
|
|
1201
|
-
*
|
|
1202
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
1203
|
-
*
|
|
1204
|
-
* The provided mapFunction(child, index) will be called for each
|
|
1205
|
-
* leaf child.
|
|
1206
|
-
*
|
|
1207
|
-
* @param {?*} children Children tree container.
|
|
1208
|
-
* @param {function(*, int)} func The map function.
|
|
1209
|
-
* @param {*} context Context for mapFunction.
|
|
1210
|
-
* @return {object} Object containing the ordered map of results.
|
|
1211
|
-
*/
|
|
1212
|
-
function mapChildren(children, func, context) {
|
|
1213
|
-
if (children == null) {
|
|
1214
|
-
return children;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
var result = [];
|
|
1218
|
-
var count = 0;
|
|
1219
|
-
mapIntoArray(children, result, '', '', function (child) {
|
|
1220
|
-
return func.call(context, child, count++);
|
|
1221
|
-
});
|
|
1222
|
-
return result;
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Count the number of children that are typically specified as
|
|
1226
|
-
* `props.children`.
|
|
1227
|
-
*
|
|
1228
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
|
1229
|
-
*
|
|
1230
|
-
* @param {?*} children Children tree container.
|
|
1231
|
-
* @return {number} The number of children.
|
|
1232
|
-
*/
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
function countChildren(children) {
|
|
1236
|
-
var n = 0;
|
|
1237
|
-
mapChildren(children, function () {
|
|
1238
|
-
n++; // Don't return anything
|
|
1239
|
-
});
|
|
1240
|
-
return n;
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
/**
|
|
1244
|
-
* Iterates through children that are typically specified as `props.children`.
|
|
1245
|
-
*
|
|
1246
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
1247
|
-
*
|
|
1248
|
-
* The provided forEachFunc(child, index) will be called for each
|
|
1249
|
-
* leaf child.
|
|
1250
|
-
*
|
|
1251
|
-
* @param {?*} children Children tree container.
|
|
1252
|
-
* @param {function(*, int)} forEachFunc
|
|
1253
|
-
* @param {*} forEachContext Context for forEachContext.
|
|
1254
|
-
*/
|
|
1255
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1256
|
-
mapChildren(children, function () {
|
|
1257
|
-
forEachFunc.apply(this, arguments); // Don't return anything.
|
|
1258
|
-
}, forEachContext);
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Flatten a children object (typically specified as `props.children`) and
|
|
1262
|
-
* return an array with appropriately re-keyed children.
|
|
1263
|
-
*
|
|
1264
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
|
1265
|
-
*/
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
function toArray(children) {
|
|
1269
|
-
return mapChildren(children, function (child) {
|
|
1270
|
-
return child;
|
|
1271
|
-
}) || [];
|
|
1272
|
-
}
|
|
1273
|
-
/**
|
|
1274
|
-
* Returns the first child in a collection of children and verifies that there
|
|
1275
|
-
* is only one child in the collection.
|
|
1276
|
-
*
|
|
1277
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
|
1278
|
-
*
|
|
1279
|
-
* The current implementation of this function assumes that a single child gets
|
|
1280
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
|
1281
|
-
* abstract away the particular structure of children.
|
|
1282
|
-
*
|
|
1283
|
-
* @param {?object} children Child collection structure.
|
|
1284
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
|
1285
|
-
* structure.
|
|
1286
|
-
*/
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
function onlyChild(children) {
|
|
1290
|
-
if (!isValidElement(children)) {
|
|
1291
|
-
throw new Error('React.Children.only expected to receive a single React element child.');
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
return children;
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
function createContext(defaultValue) {
|
|
1298
|
-
// TODO: Second argument used to be an optional `calculateChangedBits`
|
|
1299
|
-
// function. Warn to reserve for future use?
|
|
1300
|
-
var context = {
|
|
1301
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
1302
|
-
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1303
|
-
// some renderers as primary and others as secondary. We only expect
|
|
1304
|
-
// there to be two concurrent renderers at most: React Native (primary) and
|
|
1305
|
-
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
1306
|
-
// Secondary renderers store their context values on separate fields.
|
|
1307
|
-
_currentValue: defaultValue,
|
|
1308
|
-
_currentValue2: defaultValue,
|
|
1309
|
-
// Used to track how many concurrent renderers this context currently
|
|
1310
|
-
// supports within in a single renderer. Such as parallel server rendering.
|
|
1311
|
-
_threadCount: 0,
|
|
1312
|
-
// These are circular
|
|
1313
|
-
Provider: null,
|
|
1314
|
-
Consumer: null,
|
|
1315
|
-
// Add these to use same hidden class in VM as ServerContext
|
|
1316
|
-
_defaultValue: null,
|
|
1317
|
-
_globalName: null
|
|
1318
|
-
};
|
|
1319
|
-
context.Provider = {
|
|
1320
|
-
$$typeof: REACT_PROVIDER_TYPE,
|
|
1321
|
-
_context: context
|
|
1322
|
-
};
|
|
1323
|
-
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1324
|
-
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1325
|
-
var hasWarnedAboutDisplayNameOnConsumer = false;
|
|
1326
|
-
|
|
1327
|
-
{
|
|
1328
|
-
// A separate object, but proxies back to the original context object for
|
|
1329
|
-
// backwards compatibility. It has a different $$typeof, so we can properly
|
|
1330
|
-
// warn for the incorrect usage of Context as a Consumer.
|
|
1331
|
-
var Consumer = {
|
|
1332
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
1333
|
-
_context: context
|
|
1334
|
-
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1335
|
-
|
|
1336
|
-
Object.defineProperties(Consumer, {
|
|
1337
|
-
Provider: {
|
|
1338
|
-
get: function () {
|
|
1339
|
-
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
1340
|
-
hasWarnedAboutUsingConsumerProvider = true;
|
|
1341
|
-
|
|
1342
|
-
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?');
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
return context.Provider;
|
|
1346
|
-
},
|
|
1347
|
-
set: function (_Provider) {
|
|
1348
|
-
context.Provider = _Provider;
|
|
1349
|
-
}
|
|
1350
|
-
},
|
|
1351
|
-
_currentValue: {
|
|
1352
|
-
get: function () {
|
|
1353
|
-
return context._currentValue;
|
|
1354
|
-
},
|
|
1355
|
-
set: function (_currentValue) {
|
|
1356
|
-
context._currentValue = _currentValue;
|
|
1357
|
-
}
|
|
1358
|
-
},
|
|
1359
|
-
_currentValue2: {
|
|
1360
|
-
get: function () {
|
|
1361
|
-
return context._currentValue2;
|
|
1362
|
-
},
|
|
1363
|
-
set: function (_currentValue2) {
|
|
1364
|
-
context._currentValue2 = _currentValue2;
|
|
1365
|
-
}
|
|
1366
|
-
},
|
|
1367
|
-
_threadCount: {
|
|
1368
|
-
get: function () {
|
|
1369
|
-
return context._threadCount;
|
|
1370
|
-
},
|
|
1371
|
-
set: function (_threadCount) {
|
|
1372
|
-
context._threadCount = _threadCount;
|
|
1373
|
-
}
|
|
1374
|
-
},
|
|
1375
|
-
Consumer: {
|
|
1376
|
-
get: function () {
|
|
1377
|
-
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
1378
|
-
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1379
|
-
|
|
1380
|
-
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?');
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
return context.Consumer;
|
|
1384
|
-
}
|
|
1385
|
-
},
|
|
1386
|
-
displayName: {
|
|
1387
|
-
get: function () {
|
|
1388
|
-
return context.displayName;
|
|
1389
|
-
},
|
|
1390
|
-
set: function (displayName) {
|
|
1391
|
-
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
1392
|
-
warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
1393
|
-
|
|
1394
|
-
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
1399
|
-
|
|
1400
|
-
context.Consumer = Consumer;
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
{
|
|
1404
|
-
context._currentRenderer = null;
|
|
1405
|
-
context._currentRenderer2 = null;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
return context;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
var Uninitialized = -1;
|
|
1412
|
-
var Pending = 0;
|
|
1413
|
-
var Resolved = 1;
|
|
1414
|
-
var Rejected = 2;
|
|
1415
|
-
|
|
1416
|
-
function lazyInitializer(payload) {
|
|
1417
|
-
if (payload._status === Uninitialized) {
|
|
1418
|
-
var ctor = payload._result;
|
|
1419
|
-
var thenable = ctor(); // Transition to the next state.
|
|
1420
|
-
// This might throw either because it's missing or throws. If so, we treat it
|
|
1421
|
-
// as still uninitialized and try again next time. Which is the same as what
|
|
1422
|
-
// happens if the ctor or any wrappers processing the ctor throws. This might
|
|
1423
|
-
// end up fixing it if the resolution was a concurrency bug.
|
|
1424
|
-
|
|
1425
|
-
thenable.then(function (moduleObject) {
|
|
1426
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1427
|
-
// Transition to the next state.
|
|
1428
|
-
var resolved = payload;
|
|
1429
|
-
resolved._status = Resolved;
|
|
1430
|
-
resolved._result = moduleObject;
|
|
1431
|
-
}
|
|
1432
|
-
}, function (error) {
|
|
1433
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1434
|
-
// Transition to the next state.
|
|
1435
|
-
var rejected = payload;
|
|
1436
|
-
rejected._status = Rejected;
|
|
1437
|
-
rejected._result = error;
|
|
1438
|
-
}
|
|
1439
|
-
});
|
|
1440
|
-
|
|
1441
|
-
if (payload._status === Uninitialized) {
|
|
1442
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
|
1443
|
-
// to resolve. Set it as pending in the meantime.
|
|
1444
|
-
var pending = payload;
|
|
1445
|
-
pending._status = Pending;
|
|
1446
|
-
pending._result = thenable;
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
if (payload._status === Resolved) {
|
|
1451
|
-
var moduleObject = payload._result;
|
|
1452
|
-
|
|
1453
|
-
{
|
|
1454
|
-
if (moduleObject === undefined) {
|
|
1455
|
-
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1456
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
{
|
|
1461
|
-
if (!('default' in moduleObject)) {
|
|
1462
|
-
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1463
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
return moduleObject.default;
|
|
1468
|
-
} else {
|
|
1469
|
-
throw payload._result;
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
function lazy(ctor) {
|
|
1474
|
-
var payload = {
|
|
1475
|
-
// We use these fields to store the result.
|
|
1476
|
-
_status: Uninitialized,
|
|
1477
|
-
_result: ctor
|
|
1478
|
-
};
|
|
1479
|
-
var lazyType = {
|
|
1480
|
-
$$typeof: REACT_LAZY_TYPE,
|
|
1481
|
-
_payload: payload,
|
|
1482
|
-
_init: lazyInitializer
|
|
1483
|
-
};
|
|
1484
|
-
|
|
1485
|
-
{
|
|
1486
|
-
// In production, this would just set it on the object.
|
|
1487
|
-
var defaultProps;
|
|
1488
|
-
var propTypes; // $FlowFixMe
|
|
1489
|
-
|
|
1490
|
-
Object.defineProperties(lazyType, {
|
|
1491
|
-
defaultProps: {
|
|
1492
|
-
configurable: true,
|
|
1493
|
-
get: function () {
|
|
1494
|
-
return defaultProps;
|
|
1495
|
-
},
|
|
1496
|
-
set: function (newDefaultProps) {
|
|
1497
|
-
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.');
|
|
1498
|
-
|
|
1499
|
-
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
1500
|
-
// $FlowFixMe
|
|
1501
|
-
|
|
1502
|
-
Object.defineProperty(lazyType, 'defaultProps', {
|
|
1503
|
-
enumerable: true
|
|
1504
|
-
});
|
|
1505
|
-
}
|
|
1506
|
-
},
|
|
1507
|
-
propTypes: {
|
|
1508
|
-
configurable: true,
|
|
1509
|
-
get: function () {
|
|
1510
|
-
return propTypes;
|
|
1511
|
-
},
|
|
1512
|
-
set: function (newPropTypes) {
|
|
1513
|
-
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.');
|
|
1514
|
-
|
|
1515
|
-
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1516
|
-
// $FlowFixMe
|
|
1517
|
-
|
|
1518
|
-
Object.defineProperty(lazyType, 'propTypes', {
|
|
1519
|
-
enumerable: true
|
|
1520
|
-
});
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
});
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
return lazyType;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
function forwardRef(render) {
|
|
1530
|
-
{
|
|
1531
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1532
|
-
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
1533
|
-
} else if (typeof render !== 'function') {
|
|
1534
|
-
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1535
|
-
} else {
|
|
1536
|
-
if (render.length !== 0 && render.length !== 2) {
|
|
1537
|
-
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.');
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
if (render != null) {
|
|
1542
|
-
if (render.defaultProps != null || render.propTypes != null) {
|
|
1543
|
-
error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
var elementType = {
|
|
1549
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1550
|
-
render: render
|
|
1551
|
-
};
|
|
1552
|
-
|
|
1553
|
-
{
|
|
1554
|
-
var ownName;
|
|
1555
|
-
Object.defineProperty(elementType, 'displayName', {
|
|
1556
|
-
enumerable: false,
|
|
1557
|
-
configurable: true,
|
|
1558
|
-
get: function () {
|
|
1559
|
-
return ownName;
|
|
1560
|
-
},
|
|
1561
|
-
set: function (name) {
|
|
1562
|
-
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1563
|
-
// because the component may be used elsewhere.
|
|
1564
|
-
// But it's nice for anonymous functions to inherit the name,
|
|
1565
|
-
// so that our component-stack generation logic will display their frames.
|
|
1566
|
-
// An anonymous function generally suggests a pattern like:
|
|
1567
|
-
// React.forwardRef((props, ref) => {...});
|
|
1568
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1569
|
-
|
|
1570
|
-
if (!render.name && !render.displayName) {
|
|
1571
|
-
render.displayName = name;
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
});
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
return elementType;
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
var REACT_MODULE_REFERENCE;
|
|
1581
|
-
|
|
1582
|
-
{
|
|
1583
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
function isValidElementType(type) {
|
|
1587
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
1588
|
-
return true;
|
|
1589
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
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 ) {
|
|
1593
|
-
return true;
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
if (typeof type === 'object' && type !== null) {
|
|
1597
|
-
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
|
|
1598
|
-
// types supported by any Flight configuration anywhere since
|
|
1599
|
-
// we don't know which Flight build this will end up being used
|
|
1600
|
-
// with.
|
|
1601
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
1602
|
-
return true;
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
return false;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
function memo(type, compare) {
|
|
1610
|
-
{
|
|
1611
|
-
if (!isValidElementType(type)) {
|
|
1612
|
-
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
var elementType = {
|
|
1617
|
-
$$typeof: REACT_MEMO_TYPE,
|
|
1618
|
-
type: type,
|
|
1619
|
-
compare: compare === undefined ? null : compare
|
|
1620
|
-
};
|
|
1621
|
-
|
|
1622
|
-
{
|
|
1623
|
-
var ownName;
|
|
1624
|
-
Object.defineProperty(elementType, 'displayName', {
|
|
1625
|
-
enumerable: false,
|
|
1626
|
-
configurable: true,
|
|
1627
|
-
get: function () {
|
|
1628
|
-
return ownName;
|
|
1629
|
-
},
|
|
1630
|
-
set: function (name) {
|
|
1631
|
-
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1632
|
-
// because the component may be used elsewhere.
|
|
1633
|
-
// But it's nice for anonymous functions to inherit the name,
|
|
1634
|
-
// so that our component-stack generation logic will display their frames.
|
|
1635
|
-
// An anonymous function generally suggests a pattern like:
|
|
1636
|
-
// React.memo((props) => {...});
|
|
1637
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1638
|
-
|
|
1639
|
-
if (!type.name && !type.displayName) {
|
|
1640
|
-
type.displayName = name;
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
});
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
return elementType;
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
function resolveDispatcher() {
|
|
1650
|
-
var dispatcher = ReactCurrentDispatcher.current;
|
|
1651
|
-
|
|
1652
|
-
{
|
|
1653
|
-
if (dispatcher === null) {
|
|
1654
|
-
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:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
|
1655
|
-
}
|
|
1656
|
-
} // Will result in a null access error if accessed outside render phase. We
|
|
1657
|
-
// intentionally don't throw our own error because this is in a hot path.
|
|
1658
|
-
// Also helps ensure this is inlined.
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
return dispatcher;
|
|
1662
|
-
}
|
|
1663
|
-
function useContext(Context) {
|
|
1664
|
-
var dispatcher = resolveDispatcher();
|
|
1665
|
-
|
|
1666
|
-
{
|
|
1667
|
-
// TODO: add a more generic warning for invalid values.
|
|
1668
|
-
if (Context._context !== undefined) {
|
|
1669
|
-
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1670
|
-
// and nobody should be using this in existing code.
|
|
1671
|
-
|
|
1672
|
-
if (realContext.Consumer === Context) {
|
|
1673
|
-
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?');
|
|
1674
|
-
} else if (realContext.Provider === Context) {
|
|
1675
|
-
error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
return dispatcher.useContext(Context);
|
|
1681
|
-
}
|
|
1682
|
-
function useState(initialState) {
|
|
1683
|
-
var dispatcher = resolveDispatcher();
|
|
1684
|
-
return dispatcher.useState(initialState);
|
|
1685
|
-
}
|
|
1686
|
-
function useReducer(reducer, initialArg, init) {
|
|
1687
|
-
var dispatcher = resolveDispatcher();
|
|
1688
|
-
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1689
|
-
}
|
|
1690
|
-
function useRef(initialValue) {
|
|
1691
|
-
var dispatcher = resolveDispatcher();
|
|
1692
|
-
return dispatcher.useRef(initialValue);
|
|
1693
|
-
}
|
|
1694
|
-
function useEffect(create, deps) {
|
|
1695
|
-
var dispatcher = resolveDispatcher();
|
|
1696
|
-
return dispatcher.useEffect(create, deps);
|
|
1697
|
-
}
|
|
1698
|
-
function useInsertionEffect(create, deps) {
|
|
1699
|
-
var dispatcher = resolveDispatcher();
|
|
1700
|
-
return dispatcher.useInsertionEffect(create, deps);
|
|
1701
|
-
}
|
|
1702
|
-
function useLayoutEffect(create, deps) {
|
|
1703
|
-
var dispatcher = resolveDispatcher();
|
|
1704
|
-
return dispatcher.useLayoutEffect(create, deps);
|
|
1705
|
-
}
|
|
1706
|
-
function useCallback(callback, deps) {
|
|
1707
|
-
var dispatcher = resolveDispatcher();
|
|
1708
|
-
return dispatcher.useCallback(callback, deps);
|
|
1709
|
-
}
|
|
1710
|
-
function useMemo(create, deps) {
|
|
1711
|
-
var dispatcher = resolveDispatcher();
|
|
1712
|
-
return dispatcher.useMemo(create, deps);
|
|
1713
|
-
}
|
|
1714
|
-
function useImperativeHandle(ref, create, deps) {
|
|
1715
|
-
var dispatcher = resolveDispatcher();
|
|
1716
|
-
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1717
|
-
}
|
|
1718
|
-
function useDebugValue(value, formatterFn) {
|
|
1719
|
-
{
|
|
1720
|
-
var dispatcher = resolveDispatcher();
|
|
1721
|
-
return dispatcher.useDebugValue(value, formatterFn);
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
function useTransition() {
|
|
1725
|
-
var dispatcher = resolveDispatcher();
|
|
1726
|
-
return dispatcher.useTransition();
|
|
1727
|
-
}
|
|
1728
|
-
function useDeferredValue(value) {
|
|
1729
|
-
var dispatcher = resolveDispatcher();
|
|
1730
|
-
return dispatcher.useDeferredValue(value);
|
|
1731
|
-
}
|
|
1732
|
-
function useId() {
|
|
1733
|
-
var dispatcher = resolveDispatcher();
|
|
1734
|
-
return dispatcher.useId();
|
|
1735
|
-
}
|
|
1736
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1737
|
-
var dispatcher = resolveDispatcher();
|
|
1738
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1742
|
-
// replaying on render function. This currently only patches the object
|
|
1743
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
1744
|
-
// We could also eagerly patch the method.
|
|
1745
|
-
var disabledDepth = 0;
|
|
1746
|
-
var prevLog;
|
|
1747
|
-
var prevInfo;
|
|
1748
|
-
var prevWarn;
|
|
1749
|
-
var prevError;
|
|
1750
|
-
var prevGroup;
|
|
1751
|
-
var prevGroupCollapsed;
|
|
1752
|
-
var prevGroupEnd;
|
|
1753
|
-
|
|
1754
|
-
function disabledLog() {}
|
|
1755
|
-
|
|
1756
|
-
disabledLog.__reactDisabledLog = true;
|
|
1757
|
-
function disableLogs() {
|
|
1758
|
-
{
|
|
1759
|
-
if (disabledDepth === 0) {
|
|
1760
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
1761
|
-
prevLog = console.log;
|
|
1762
|
-
prevInfo = console.info;
|
|
1763
|
-
prevWarn = console.warn;
|
|
1764
|
-
prevError = console.error;
|
|
1765
|
-
prevGroup = console.group;
|
|
1766
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
1767
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
1768
|
-
|
|
1769
|
-
var props = {
|
|
1770
|
-
configurable: true,
|
|
1771
|
-
enumerable: true,
|
|
1772
|
-
value: disabledLog,
|
|
1773
|
-
writable: true
|
|
1774
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1775
|
-
|
|
1776
|
-
Object.defineProperties(console, {
|
|
1777
|
-
info: props,
|
|
1778
|
-
log: props,
|
|
1779
|
-
warn: props,
|
|
1780
|
-
error: props,
|
|
1781
|
-
group: props,
|
|
1782
|
-
groupCollapsed: props,
|
|
1783
|
-
groupEnd: props
|
|
1784
|
-
});
|
|
1785
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
disabledDepth++;
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
function reenableLogs() {
|
|
1792
|
-
{
|
|
1793
|
-
disabledDepth--;
|
|
1794
|
-
|
|
1795
|
-
if (disabledDepth === 0) {
|
|
1796
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
1797
|
-
var props = {
|
|
1798
|
-
configurable: true,
|
|
1799
|
-
enumerable: true,
|
|
1800
|
-
writable: true
|
|
1801
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1802
|
-
|
|
1803
|
-
Object.defineProperties(console, {
|
|
1804
|
-
log: assign({}, props, {
|
|
1805
|
-
value: prevLog
|
|
1806
|
-
}),
|
|
1807
|
-
info: assign({}, props, {
|
|
1808
|
-
value: prevInfo
|
|
1809
|
-
}),
|
|
1810
|
-
warn: assign({}, props, {
|
|
1811
|
-
value: prevWarn
|
|
1812
|
-
}),
|
|
1813
|
-
error: assign({}, props, {
|
|
1814
|
-
value: prevError
|
|
1815
|
-
}),
|
|
1816
|
-
group: assign({}, props, {
|
|
1817
|
-
value: prevGroup
|
|
1818
|
-
}),
|
|
1819
|
-
groupCollapsed: assign({}, props, {
|
|
1820
|
-
value: prevGroupCollapsed
|
|
1821
|
-
}),
|
|
1822
|
-
groupEnd: assign({}, props, {
|
|
1823
|
-
value: prevGroupEnd
|
|
1824
|
-
})
|
|
1825
|
-
});
|
|
1826
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
if (disabledDepth < 0) {
|
|
1830
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1836
|
-
var prefix;
|
|
1837
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1838
|
-
{
|
|
1839
|
-
if (prefix === undefined) {
|
|
1840
|
-
// Extract the VM specific prefix used by each line.
|
|
1841
|
-
try {
|
|
1842
|
-
throw Error();
|
|
1843
|
-
} catch (x) {
|
|
1844
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1845
|
-
prefix = match && match[1] || '';
|
|
1846
|
-
}
|
|
1847
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
return '\n' + prefix + name;
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
var reentry = false;
|
|
1854
|
-
var componentFrameCache;
|
|
1855
|
-
|
|
1856
|
-
{
|
|
1857
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
1858
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
1862
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1863
|
-
if ( !fn || reentry) {
|
|
1864
|
-
return '';
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
{
|
|
1868
|
-
var frame = componentFrameCache.get(fn);
|
|
1869
|
-
|
|
1870
|
-
if (frame !== undefined) {
|
|
1871
|
-
return frame;
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
var control;
|
|
1876
|
-
reentry = true;
|
|
1877
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
1878
|
-
|
|
1879
|
-
Error.prepareStackTrace = undefined;
|
|
1880
|
-
var previousDispatcher;
|
|
1881
|
-
|
|
1882
|
-
{
|
|
1883
|
-
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
1884
|
-
// for warnings.
|
|
1885
|
-
|
|
1886
|
-
ReactCurrentDispatcher$1.current = null;
|
|
1887
|
-
disableLogs();
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
try {
|
|
1891
|
-
// This should throw.
|
|
1892
|
-
if (construct) {
|
|
1893
|
-
// Something should be setting the props in the constructor.
|
|
1894
|
-
var Fake = function () {
|
|
1895
|
-
throw Error();
|
|
1896
|
-
}; // $FlowFixMe
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
1900
|
-
set: function () {
|
|
1901
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
1902
|
-
// because that won't throw in a non-strict mode function.
|
|
1903
|
-
throw Error();
|
|
1904
|
-
}
|
|
1905
|
-
});
|
|
1906
|
-
|
|
1907
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
1908
|
-
// We construct a different control for this case to include any extra
|
|
1909
|
-
// frames added by the construct call.
|
|
1910
|
-
try {
|
|
1911
|
-
Reflect.construct(Fake, []);
|
|
1912
|
-
} catch (x) {
|
|
1913
|
-
control = x;
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
Reflect.construct(fn, [], Fake);
|
|
1917
|
-
} else {
|
|
1918
|
-
try {
|
|
1919
|
-
Fake.call();
|
|
1920
|
-
} catch (x) {
|
|
1921
|
-
control = x;
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
fn.call(Fake.prototype);
|
|
1925
|
-
}
|
|
1926
|
-
} else {
|
|
1927
|
-
try {
|
|
1928
|
-
throw Error();
|
|
1929
|
-
} catch (x) {
|
|
1930
|
-
control = x;
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
fn();
|
|
1934
|
-
}
|
|
1935
|
-
} catch (sample) {
|
|
1936
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
1937
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
1938
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
1939
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
1940
|
-
var sampleLines = sample.stack.split('\n');
|
|
1941
|
-
var controlLines = control.stack.split('\n');
|
|
1942
|
-
var s = sampleLines.length - 1;
|
|
1943
|
-
var c = controlLines.length - 1;
|
|
1944
|
-
|
|
1945
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1946
|
-
// We expect at least one stack frame to be shared.
|
|
1947
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
1948
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
1949
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
1950
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
1951
|
-
// the sample somewhere in the control.
|
|
1952
|
-
c--;
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1956
|
-
// Next we find the first one that isn't the same which should be the
|
|
1957
|
-
// frame that called our sample function and the control.
|
|
1958
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
1959
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
1960
|
-
// If we're about to return the first line, and the control is also on the same
|
|
1961
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
1962
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
1963
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
1964
|
-
if (s !== 1 || c !== 1) {
|
|
1965
|
-
do {
|
|
1966
|
-
s--;
|
|
1967
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
1968
|
-
// The next one that isn't the same should be our match though.
|
|
1969
|
-
|
|
1970
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1971
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1972
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
1973
|
-
// but we have a user-provided "displayName"
|
|
1974
|
-
// splice it in to make the stack more readable.
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
1978
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
{
|
|
1982
|
-
if (typeof fn === 'function') {
|
|
1983
|
-
componentFrameCache.set(fn, _frame);
|
|
1984
|
-
}
|
|
1985
|
-
} // Return the line we found.
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
return _frame;
|
|
1989
|
-
}
|
|
1990
|
-
} while (s >= 1 && c >= 0);
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
break;
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
} finally {
|
|
1998
|
-
reentry = false;
|
|
1999
|
-
|
|
2000
|
-
{
|
|
2001
|
-
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
2002
|
-
reenableLogs();
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
2006
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
2010
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
2011
|
-
|
|
2012
|
-
{
|
|
2013
|
-
if (typeof fn === 'function') {
|
|
2014
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
return syntheticFrame;
|
|
2019
|
-
}
|
|
2020
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
2021
|
-
{
|
|
2022
|
-
return describeNativeComponentFrame(fn, false);
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
function shouldConstruct(Component) {
|
|
2027
|
-
var prototype = Component.prototype;
|
|
2028
|
-
return !!(prototype && prototype.isReactComponent);
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
2032
|
-
|
|
2033
|
-
if (type == null) {
|
|
2034
|
-
return '';
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
if (typeof type === 'function') {
|
|
2038
|
-
{
|
|
2039
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
if (typeof type === 'string') {
|
|
2044
|
-
return describeBuiltInComponentFrame(type);
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
switch (type) {
|
|
2048
|
-
case REACT_SUSPENSE_TYPE:
|
|
2049
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
2050
|
-
|
|
2051
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2052
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
if (typeof type === 'object') {
|
|
2056
|
-
switch (type.$$typeof) {
|
|
2057
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2058
|
-
return describeFunctionComponentFrame(type.render);
|
|
2059
|
-
|
|
2060
|
-
case REACT_MEMO_TYPE:
|
|
2061
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
2062
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2063
|
-
|
|
2064
|
-
case REACT_LAZY_TYPE:
|
|
2065
|
-
{
|
|
2066
|
-
var lazyComponent = type;
|
|
2067
|
-
var payload = lazyComponent._payload;
|
|
2068
|
-
var init = lazyComponent._init;
|
|
2069
|
-
|
|
2070
|
-
try {
|
|
2071
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
2072
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
2073
|
-
} catch (x) {}
|
|
2074
|
-
}
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
return '';
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
var loggedTypeFailures = {};
|
|
2082
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2083
|
-
|
|
2084
|
-
function setCurrentlyValidatingElement(element) {
|
|
2085
|
-
{
|
|
2086
|
-
if (element) {
|
|
2087
|
-
var owner = element._owner;
|
|
2088
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2089
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
2090
|
-
} else {
|
|
2091
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
2092
|
-
}
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
|
|
2096
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2097
|
-
{
|
|
2098
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
2099
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
2100
|
-
|
|
2101
|
-
for (var typeSpecName in typeSpecs) {
|
|
2102
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
2103
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
2104
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
2105
|
-
// After these have been cleaned up, we'll let them throw.
|
|
2106
|
-
|
|
2107
|
-
try {
|
|
2108
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
2109
|
-
// behavior as without this statement except with a better message.
|
|
2110
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2111
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
2112
|
-
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`.');
|
|
2113
|
-
err.name = 'Invariant Violation';
|
|
2114
|
-
throw err;
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
2118
|
-
} catch (ex) {
|
|
2119
|
-
error$1 = ex;
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
2123
|
-
setCurrentlyValidatingElement(element);
|
|
2124
|
-
|
|
2125
|
-
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);
|
|
2126
|
-
|
|
2127
|
-
setCurrentlyValidatingElement(null);
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
2131
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
2132
|
-
// same error.
|
|
2133
|
-
loggedTypeFailures[error$1.message] = true;
|
|
2134
|
-
setCurrentlyValidatingElement(element);
|
|
2135
|
-
|
|
2136
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
2137
|
-
|
|
2138
|
-
setCurrentlyValidatingElement(null);
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
2146
|
-
{
|
|
2147
|
-
if (element) {
|
|
2148
|
-
var owner = element._owner;
|
|
2149
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2150
|
-
setExtraStackFrame(stack);
|
|
2151
|
-
} else {
|
|
2152
|
-
setExtraStackFrame(null);
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
var propTypesMisspellWarningShown;
|
|
2158
|
-
|
|
2159
|
-
{
|
|
2160
|
-
propTypesMisspellWarningShown = false;
|
|
2161
|
-
}
|
|
2162
|
-
|
|
2163
|
-
function getDeclarationErrorAddendum() {
|
|
2164
|
-
if (ReactCurrentOwner.current) {
|
|
2165
|
-
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
2166
|
-
|
|
2167
|
-
if (name) {
|
|
2168
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
2169
|
-
}
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
return '';
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
function getSourceInfoErrorAddendum(source) {
|
|
2176
|
-
if (source !== undefined) {
|
|
2177
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
2178
|
-
var lineNumber = source.lineNumber;
|
|
2179
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
return '';
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
2186
|
-
if (elementProps !== null && elementProps !== undefined) {
|
|
2187
|
-
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
return '';
|
|
2191
|
-
}
|
|
2192
|
-
/**
|
|
2193
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
2194
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
2195
|
-
* updates.
|
|
2196
|
-
*/
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
var ownerHasKeyUseWarning = {};
|
|
2200
|
-
|
|
2201
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
2202
|
-
var info = getDeclarationErrorAddendum();
|
|
2203
|
-
|
|
2204
|
-
if (!info) {
|
|
2205
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
2206
|
-
|
|
2207
|
-
if (parentName) {
|
|
2208
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
|
|
2212
|
-
return info;
|
|
2213
|
-
}
|
|
2214
|
-
/**
|
|
2215
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
2216
|
-
* This element is in an array. The array could grow and shrink or be
|
|
2217
|
-
* reordered. All children that haven't already been validated are required to
|
|
2218
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
2219
|
-
* will only be shown once.
|
|
2220
|
-
*
|
|
2221
|
-
* @internal
|
|
2222
|
-
* @param {ReactElement} element Element that requires a key.
|
|
2223
|
-
* @param {*} parentType element's parent's type.
|
|
2224
|
-
*/
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
function validateExplicitKey(element, parentType) {
|
|
2228
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
2229
|
-
return;
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
element._store.validated = true;
|
|
2233
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
2234
|
-
|
|
2235
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
2236
|
-
return;
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
2240
|
-
// property, it may be the creator of the child that's responsible for
|
|
2241
|
-
// assigning it a key.
|
|
2242
|
-
|
|
2243
|
-
var childOwner = '';
|
|
2244
|
-
|
|
2245
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
2246
|
-
// Give the component that originally created this child.
|
|
2247
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
{
|
|
2251
|
-
setCurrentlyValidatingElement$1(element);
|
|
2252
|
-
|
|
2253
|
-
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);
|
|
2254
|
-
|
|
2255
|
-
setCurrentlyValidatingElement$1(null);
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
/**
|
|
2259
|
-
* Ensure that every element either is passed in a static location, in an
|
|
2260
|
-
* array with an explicit keys property defined, or in an object literal
|
|
2261
|
-
* with valid key property.
|
|
2262
|
-
*
|
|
2263
|
-
* @internal
|
|
2264
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
2265
|
-
* @param {*} parentType node's parent's type.
|
|
2266
|
-
*/
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
function validateChildKeys(node, parentType) {
|
|
2270
|
-
if (typeof node !== 'object') {
|
|
2271
|
-
return;
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
if (isArray(node)) {
|
|
2275
|
-
for (var i = 0; i < node.length; i++) {
|
|
2276
|
-
var child = node[i];
|
|
2277
|
-
|
|
2278
|
-
if (isValidElement(child)) {
|
|
2279
|
-
validateExplicitKey(child, parentType);
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
|
-
} else if (isValidElement(node)) {
|
|
2283
|
-
// This element was passed in a valid location.
|
|
2284
|
-
if (node._store) {
|
|
2285
|
-
node._store.validated = true;
|
|
2286
|
-
}
|
|
2287
|
-
} else if (node) {
|
|
2288
|
-
var iteratorFn = getIteratorFn(node);
|
|
2289
|
-
|
|
2290
|
-
if (typeof iteratorFn === 'function') {
|
|
2291
|
-
// Entry iterators used to provide implicit keys,
|
|
2292
|
-
// but now we print a separate warning for them later.
|
|
2293
|
-
if (iteratorFn !== node.entries) {
|
|
2294
|
-
var iterator = iteratorFn.call(node);
|
|
2295
|
-
var step;
|
|
2296
|
-
|
|
2297
|
-
while (!(step = iterator.next()).done) {
|
|
2298
|
-
if (isValidElement(step.value)) {
|
|
2299
|
-
validateExplicitKey(step.value, parentType);
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
|
-
/**
|
|
2307
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
2308
|
-
* provided by the type.
|
|
2309
|
-
*
|
|
2310
|
-
* @param {ReactElement} element
|
|
2311
|
-
*/
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
function validatePropTypes(element) {
|
|
2315
|
-
{
|
|
2316
|
-
var type = element.type;
|
|
2317
|
-
|
|
2318
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
2319
|
-
return;
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
var propTypes;
|
|
2323
|
-
|
|
2324
|
-
if (typeof type === 'function') {
|
|
2325
|
-
propTypes = type.propTypes;
|
|
2326
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
2327
|
-
// Inner props are checked in the reconciler.
|
|
2328
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
2329
|
-
propTypes = type.propTypes;
|
|
2330
|
-
} else {
|
|
2331
|
-
return;
|
|
2332
|
-
}
|
|
2333
|
-
|
|
2334
|
-
if (propTypes) {
|
|
2335
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
2336
|
-
var name = getComponentNameFromType(type);
|
|
2337
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2338
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2339
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
2340
|
-
|
|
2341
|
-
var _name = getComponentNameFromType(type);
|
|
2342
|
-
|
|
2343
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
2344
|
-
}
|
|
2345
|
-
|
|
2346
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
2347
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
/**
|
|
2352
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
2353
|
-
* @param {ReactElement} fragment
|
|
2354
|
-
*/
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
function validateFragmentProps(fragment) {
|
|
2358
|
-
{
|
|
2359
|
-
var keys = Object.keys(fragment.props);
|
|
2360
|
-
|
|
2361
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2362
|
-
var key = keys[i];
|
|
2363
|
-
|
|
2364
|
-
if (key !== 'children' && key !== 'key') {
|
|
2365
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
2366
|
-
|
|
2367
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
2368
|
-
|
|
2369
|
-
setCurrentlyValidatingElement$1(null);
|
|
2370
|
-
break;
|
|
2371
|
-
}
|
|
2372
|
-
}
|
|
2373
|
-
|
|
2374
|
-
if (fragment.ref !== null) {
|
|
2375
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
2376
|
-
|
|
2377
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
2378
|
-
|
|
2379
|
-
setCurrentlyValidatingElement$1(null);
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
function createElementWithValidation(type, props, children) {
|
|
2384
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2385
|
-
// succeed and there will likely be errors in render.
|
|
2386
|
-
|
|
2387
|
-
if (!validType) {
|
|
2388
|
-
var info = '';
|
|
2389
|
-
|
|
2390
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2391
|
-
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.";
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
2395
|
-
|
|
2396
|
-
if (sourceInfo) {
|
|
2397
|
-
info += sourceInfo;
|
|
2398
|
-
} else {
|
|
2399
|
-
info += getDeclarationErrorAddendum();
|
|
2400
|
-
}
|
|
2401
|
-
|
|
2402
|
-
var typeString;
|
|
2403
|
-
|
|
2404
|
-
if (type === null) {
|
|
2405
|
-
typeString = 'null';
|
|
2406
|
-
} else if (isArray(type)) {
|
|
2407
|
-
typeString = 'array';
|
|
2408
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2409
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
2410
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2411
|
-
} else {
|
|
2412
|
-
typeString = typeof type;
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
{
|
|
2416
|
-
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);
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
2421
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
2422
|
-
|
|
2423
|
-
if (element == null) {
|
|
2424
|
-
return element;
|
|
2425
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
2426
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
2427
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
2428
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
2429
|
-
// fixed, the key warnings will appear.)
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
if (validType) {
|
|
2433
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
2434
|
-
validateChildKeys(arguments[i], type);
|
|
2435
|
-
}
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
2439
|
-
validateFragmentProps(element);
|
|
2440
|
-
} else {
|
|
2441
|
-
validatePropTypes(element);
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
return element;
|
|
2445
|
-
}
|
|
2446
|
-
var didWarnAboutDeprecatedCreateFactory = false;
|
|
2447
|
-
function createFactoryWithValidation(type) {
|
|
2448
|
-
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
2449
|
-
validatedFactory.type = type;
|
|
2450
|
-
|
|
2451
|
-
{
|
|
2452
|
-
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
2453
|
-
didWarnAboutDeprecatedCreateFactory = true;
|
|
2454
|
-
|
|
2455
|
-
warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
|
2456
|
-
} // Legacy hook: remove it
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
Object.defineProperty(validatedFactory, 'type', {
|
|
2460
|
-
enumerable: false,
|
|
2461
|
-
get: function () {
|
|
2462
|
-
warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
2463
|
-
|
|
2464
|
-
Object.defineProperty(this, 'type', {
|
|
2465
|
-
value: type
|
|
2466
|
-
});
|
|
2467
|
-
return type;
|
|
2468
|
-
}
|
|
2469
|
-
});
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
return validatedFactory;
|
|
2473
|
-
}
|
|
2474
|
-
function cloneElementWithValidation(element, props, children) {
|
|
2475
|
-
var newElement = cloneElement.apply(this, arguments);
|
|
2476
|
-
|
|
2477
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
2478
|
-
validateChildKeys(arguments[i], newElement.type);
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
validatePropTypes(newElement);
|
|
2482
|
-
return newElement;
|
|
2483
|
-
}
|
|
2484
|
-
|
|
2485
|
-
function startTransition(scope, options) {
|
|
2486
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
2487
|
-
ReactCurrentBatchConfig.transition = {};
|
|
2488
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
2489
|
-
|
|
2490
|
-
{
|
|
2491
|
-
ReactCurrentBatchConfig.transition._updatedFibers = new Set();
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2494
|
-
try {
|
|
2495
|
-
scope();
|
|
2496
|
-
} finally {
|
|
2497
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
|
2498
|
-
|
|
2499
|
-
{
|
|
2500
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
2501
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
2502
|
-
|
|
2503
|
-
if (updatedFibersCount > 10) {
|
|
2504
|
-
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.');
|
|
2505
|
-
}
|
|
2506
|
-
|
|
2507
|
-
currentTransition._updatedFibers.clear();
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
}
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2513
|
-
var didWarnAboutMessageChannel = false;
|
|
2514
|
-
var enqueueTaskImpl = null;
|
|
2515
|
-
function enqueueTask(task) {
|
|
2516
|
-
if (enqueueTaskImpl === null) {
|
|
2517
|
-
try {
|
|
2518
|
-
// read require off the module object to get around the bundlers.
|
|
2519
|
-
// we don't want them to detect a require and bundle a Node polyfill.
|
|
2520
|
-
var requireString = ('require' + Math.random()).slice(0, 7);
|
|
2521
|
-
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
|
|
2522
|
-
// version of setImmediate, bypassing fake timers if any.
|
|
2523
|
-
|
|
2524
|
-
enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
|
2525
|
-
} catch (_err) {
|
|
2526
|
-
// we're in a browser
|
|
2527
|
-
// we can't use regular timers because they may still be faked
|
|
2528
|
-
// so we try MessageChannel+postMessage instead
|
|
2529
|
-
enqueueTaskImpl = function (callback) {
|
|
2530
|
-
{
|
|
2531
|
-
if (didWarnAboutMessageChannel === false) {
|
|
2532
|
-
didWarnAboutMessageChannel = true;
|
|
2533
|
-
|
|
2534
|
-
if (typeof MessageChannel === 'undefined') {
|
|
2535
|
-
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.');
|
|
2536
|
-
}
|
|
2537
|
-
}
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
var channel = new MessageChannel();
|
|
2541
|
-
channel.port1.onmessage = callback;
|
|
2542
|
-
channel.port2.postMessage(undefined);
|
|
2543
|
-
};
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
|
-
return enqueueTaskImpl(task);
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
var actScopeDepth = 0;
|
|
2551
|
-
var didWarnNoAwaitAct = false;
|
|
2552
|
-
function act(callback) {
|
|
2553
|
-
{
|
|
2554
|
-
// `act` calls can be nested, so we track the depth. This represents the
|
|
2555
|
-
// number of `act` scopes on the stack.
|
|
2556
|
-
var prevActScopeDepth = actScopeDepth;
|
|
2557
|
-
actScopeDepth++;
|
|
2558
|
-
|
|
2559
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2560
|
-
// This is the outermost `act` scope. Initialize the queue. The reconciler
|
|
2561
|
-
// will detect the queue and use it instead of Scheduler.
|
|
2562
|
-
ReactCurrentActQueue.current = [];
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
2566
|
-
var result;
|
|
2567
|
-
|
|
2568
|
-
try {
|
|
2569
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
|
|
2570
|
-
// set to `true` while the given callback is executed, not for updates
|
|
2571
|
-
// triggered during an async event, because this is how the legacy
|
|
2572
|
-
// implementation of `act` behaved.
|
|
2573
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
2574
|
-
result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
|
|
2575
|
-
// which flushed updates immediately after the scope function exits, even
|
|
2576
|
-
// if it's an async function.
|
|
2577
|
-
|
|
2578
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
2579
|
-
var queue = ReactCurrentActQueue.current;
|
|
2580
|
-
|
|
2581
|
-
if (queue !== null) {
|
|
2582
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
2583
|
-
flushActQueue(queue);
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
|
-
} catch (error) {
|
|
2587
|
-
popActScope(prevActScopeDepth);
|
|
2588
|
-
throw error;
|
|
2589
|
-
} finally {
|
|
2590
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
|
-
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
|
2594
|
-
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
|
2595
|
-
// for it to resolve before exiting the current scope.
|
|
2596
|
-
|
|
2597
|
-
var wasAwaited = false;
|
|
2598
|
-
var thenable = {
|
|
2599
|
-
then: function (resolve, reject) {
|
|
2600
|
-
wasAwaited = true;
|
|
2601
|
-
thenableResult.then(function (returnValue) {
|
|
2602
|
-
popActScope(prevActScopeDepth);
|
|
2603
|
-
|
|
2604
|
-
if (actScopeDepth === 0) {
|
|
2605
|
-
// We've exited the outermost act scope. Recursively flush the
|
|
2606
|
-
// queue until there's no remaining work.
|
|
2607
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2608
|
-
} else {
|
|
2609
|
-
resolve(returnValue);
|
|
2610
|
-
}
|
|
2611
|
-
}, function (error) {
|
|
2612
|
-
// The callback threw an error.
|
|
2613
|
-
popActScope(prevActScopeDepth);
|
|
2614
|
-
reject(error);
|
|
2615
|
-
});
|
|
2616
|
-
}
|
|
2617
|
-
};
|
|
2618
|
-
|
|
2619
|
-
{
|
|
2620
|
-
if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
|
2621
|
-
// eslint-disable-next-line no-undef
|
|
2622
|
-
Promise.resolve().then(function () {}).then(function () {
|
|
2623
|
-
if (!wasAwaited) {
|
|
2624
|
-
didWarnNoAwaitAct = true;
|
|
2625
|
-
|
|
2626
|
-
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 () => ...);');
|
|
2627
|
-
}
|
|
2628
|
-
});
|
|
2629
|
-
}
|
|
2630
|
-
}
|
|
2631
|
-
|
|
2632
|
-
return thenable;
|
|
2633
|
-
} else {
|
|
2634
|
-
var returnValue = result; // The callback is not an async function. Exit the current scope
|
|
2635
|
-
// immediately, without awaiting.
|
|
2636
|
-
|
|
2637
|
-
popActScope(prevActScopeDepth);
|
|
2638
|
-
|
|
2639
|
-
if (actScopeDepth === 0) {
|
|
2640
|
-
// Exiting the outermost act scope. Flush the queue.
|
|
2641
|
-
var _queue = ReactCurrentActQueue.current;
|
|
2642
|
-
|
|
2643
|
-
if (_queue !== null) {
|
|
2644
|
-
flushActQueue(_queue);
|
|
2645
|
-
ReactCurrentActQueue.current = null;
|
|
2646
|
-
} // Return a thenable. If the user awaits it, we'll flush again in
|
|
2647
|
-
// case additional work was scheduled by a microtask.
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
var _thenable = {
|
|
2651
|
-
then: function (resolve, reject) {
|
|
2652
|
-
// Confirm we haven't re-entered another `act` scope, in case
|
|
2653
|
-
// the user does something weird like await the thenable
|
|
2654
|
-
// multiple times.
|
|
2655
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2656
|
-
// Recursively flush the queue until there's no remaining work.
|
|
2657
|
-
ReactCurrentActQueue.current = [];
|
|
2658
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2659
|
-
} else {
|
|
2660
|
-
resolve(returnValue);
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
};
|
|
2664
|
-
return _thenable;
|
|
2665
|
-
} else {
|
|
2666
|
-
// Since we're inside a nested `act` scope, the returned thenable
|
|
2667
|
-
// immediately resolves. The outer scope will flush the queue.
|
|
2668
|
-
var _thenable2 = {
|
|
2669
|
-
then: function (resolve, reject) {
|
|
2670
|
-
resolve(returnValue);
|
|
2671
|
-
}
|
|
2672
|
-
};
|
|
2673
|
-
return _thenable2;
|
|
2674
|
-
}
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2679
|
-
function popActScope(prevActScopeDepth) {
|
|
2680
|
-
{
|
|
2681
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
2682
|
-
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
actScopeDepth = prevActScopeDepth;
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
|
|
2689
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2690
|
-
{
|
|
2691
|
-
var queue = ReactCurrentActQueue.current;
|
|
2692
|
-
|
|
2693
|
-
if (queue !== null) {
|
|
2694
|
-
try {
|
|
2695
|
-
flushActQueue(queue);
|
|
2696
|
-
enqueueTask(function () {
|
|
2697
|
-
if (queue.length === 0) {
|
|
2698
|
-
// No additional work was scheduled. Finish.
|
|
2699
|
-
ReactCurrentActQueue.current = null;
|
|
2700
|
-
resolve(returnValue);
|
|
2701
|
-
} else {
|
|
2702
|
-
// Keep flushing work until there's none left.
|
|
2703
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2704
|
-
}
|
|
2705
|
-
});
|
|
2706
|
-
} catch (error) {
|
|
2707
|
-
reject(error);
|
|
2708
|
-
}
|
|
2709
|
-
} else {
|
|
2710
|
-
resolve(returnValue);
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
var isFlushing = false;
|
|
2716
|
-
|
|
2717
|
-
function flushActQueue(queue) {
|
|
2718
|
-
{
|
|
2719
|
-
if (!isFlushing) {
|
|
2720
|
-
// Prevent re-entrance.
|
|
2721
|
-
isFlushing = true;
|
|
2722
|
-
var i = 0;
|
|
2723
|
-
|
|
2724
|
-
try {
|
|
2725
|
-
for (; i < queue.length; i++) {
|
|
2726
|
-
var callback = queue[i];
|
|
2727
|
-
|
|
2728
|
-
do {
|
|
2729
|
-
callback = callback(true);
|
|
2730
|
-
} while (callback !== null);
|
|
2731
|
-
}
|
|
2732
|
-
|
|
2733
|
-
queue.length = 0;
|
|
2734
|
-
} catch (error) {
|
|
2735
|
-
// If something throws, leave the remaining callbacks on the queue.
|
|
2736
|
-
queue = queue.slice(i + 1);
|
|
2737
|
-
throw error;
|
|
2738
|
-
} finally {
|
|
2739
|
-
isFlushing = false;
|
|
2740
|
-
}
|
|
2741
|
-
}
|
|
2742
|
-
}
|
|
2743
|
-
}
|
|
2744
|
-
|
|
2745
|
-
var createElement$1 = createElementWithValidation ;
|
|
2746
|
-
var cloneElement$1 = cloneElementWithValidation ;
|
|
2747
|
-
var createFactory = createFactoryWithValidation ;
|
|
2748
|
-
var Children = {
|
|
2749
|
-
map: mapChildren,
|
|
2750
|
-
forEach: forEachChildren,
|
|
2751
|
-
count: countChildren,
|
|
2752
|
-
toArray: toArray,
|
|
2753
|
-
only: onlyChild
|
|
2754
|
-
};
|
|
2755
|
-
|
|
2756
|
-
exports.Children = Children;
|
|
2757
|
-
exports.Component = Component;
|
|
2758
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2759
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2760
|
-
exports.PureComponent = PureComponent;
|
|
2761
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2762
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2763
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2764
|
-
exports.cloneElement = cloneElement$1;
|
|
2765
|
-
exports.createContext = createContext;
|
|
2766
|
-
exports.createElement = createElement$1;
|
|
2767
|
-
exports.createFactory = createFactory;
|
|
2768
|
-
exports.createRef = createRef;
|
|
2769
|
-
exports.forwardRef = forwardRef;
|
|
2770
|
-
exports.isValidElement = isValidElement;
|
|
2771
|
-
exports.lazy = lazy;
|
|
2772
|
-
exports.memo = memo;
|
|
2773
|
-
exports.startTransition = startTransition;
|
|
2774
|
-
exports.unstable_act = act;
|
|
2775
|
-
exports.useCallback = useCallback;
|
|
2776
|
-
exports.useContext = useContext;
|
|
2777
|
-
exports.useDebugValue = useDebugValue;
|
|
2778
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2779
|
-
exports.useEffect = useEffect;
|
|
2780
|
-
exports.useId = useId;
|
|
2781
|
-
exports.useImperativeHandle = useImperativeHandle;
|
|
2782
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
2783
|
-
exports.useLayoutEffect = useLayoutEffect;
|
|
2784
|
-
exports.useMemo = useMemo;
|
|
2785
|
-
exports.useReducer = useReducer;
|
|
2786
|
-
exports.useRef = useRef;
|
|
2787
|
-
exports.useState = useState;
|
|
2788
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2789
|
-
exports.useTransition = useTransition;
|
|
2790
|
-
exports.version = ReactVersion;
|
|
2791
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
2792
|
-
if (
|
|
2793
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
2794
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
2795
|
-
'function'
|
|
2796
|
-
) {
|
|
2797
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2798
|
-
}
|
|
2799
|
-
|
|
2800
|
-
})();
|
|
2801
|
-
}
|
|
2802
|
-
} (react_development, react_developmentExports));
|
|
2803
|
-
return react_developmentExports;
|
|
2804
|
-
}
|
|
2805
|
-
|
|
2806
|
-
(function (module) {
|
|
2807
|
-
|
|
2808
|
-
if (process.env.NODE_ENV === 'production') {
|
|
2809
|
-
module.exports = requireReact_production_min();
|
|
2810
|
-
} else {
|
|
2811
|
-
module.exports = requireReact_development();
|
|
2812
|
-
}
|
|
2813
|
-
} (react));
|
|
2814
|
-
|
|
2815
|
-
var React$2 = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$2);
|
|
2816
24
|
|
|
2817
25
|
const theme = {
|
|
2818
26
|
colors: {
|
|
@@ -3369,7 +577,7 @@ const _jsxFileName$W = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
3369
577
|
|
|
3370
578
|
const Pagination = (props) => {
|
|
3371
579
|
const {itemsPerPage,totalItems,returnedPageNum,currPageNum} = props;
|
|
3372
|
-
const [pageNum,setPageNum] =
|
|
580
|
+
const [pageNum,setPageNum] = React$2.useState(1);
|
|
3373
581
|
|
|
3374
582
|
const pageNumbers = [];
|
|
3375
583
|
|
|
@@ -3377,7 +585,7 @@ const Pagination = (props) => {
|
|
|
3377
585
|
pageNumbers.push(i);
|
|
3378
586
|
}
|
|
3379
587
|
|
|
3380
|
-
|
|
588
|
+
React$2.useEffect(()=>{
|
|
3381
589
|
setPageNum(currPageNum);
|
|
3382
590
|
},[currPageNum]);
|
|
3383
591
|
|
|
@@ -3430,14 +638,14 @@ const Pagination = (props) => {
|
|
|
3430
638
|
const _jsxFileName$V = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\AppActionsTable\\AppActionsTable.tsx";
|
|
3431
639
|
const AppActionsTable = (props) => {
|
|
3432
640
|
const {actions,callback,srchActive} = props;
|
|
3433
|
-
const [currentPage,setCurrentPage] =
|
|
3434
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
3435
|
-
const [dispActions,setDispActions] =
|
|
3436
|
-
const [dispActionsOri,setDispActionsOri] =
|
|
3437
|
-
const [displayContent,setDisplayContent] =
|
|
3438
|
-
const [sortDir,setSortDir] =
|
|
3439
|
-
|
|
3440
|
-
|
|
641
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
642
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
643
|
+
const [dispActions,setDispActions] = React$2.useState([]);
|
|
644
|
+
const [dispActionsOri,setDispActionsOri] = React$2.useState(actions);
|
|
645
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
646
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
647
|
+
|
|
648
|
+
React$2.useEffect(()=>{
|
|
3441
649
|
//pagination
|
|
3442
650
|
if (dispActionsOri.length > 0){
|
|
3443
651
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -3450,14 +658,14 @@ const AppActionsTable = (props) => {
|
|
|
3450
658
|
setDisplayContent(true);
|
|
3451
659
|
},[dispActionsOri,currentPage]);
|
|
3452
660
|
|
|
3453
|
-
|
|
661
|
+
React$2.useEffect(()=>{
|
|
3454
662
|
setDispActionsOri(actions.sort((a,b) => {
|
|
3455
663
|
if(a.title < b.title) return -1
|
|
3456
664
|
return 1
|
|
3457
665
|
}));
|
|
3458
666
|
},[actions]);
|
|
3459
667
|
|
|
3460
|
-
|
|
668
|
+
React$2.useEffect(()=>{
|
|
3461
669
|
if (srchActive) setCurrentPage(1);
|
|
3462
670
|
},[srchActive]);
|
|
3463
671
|
|
|
@@ -3645,14 +853,14 @@ const NothingContent$9 = styled.div`
|
|
|
3645
853
|
const _jsxFileName$U = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\AppFormsTable\\AppFormsTable.tsx";
|
|
3646
854
|
const AppFormsTable = (props) => {
|
|
3647
855
|
const {forms,callback,srchActive} = props;
|
|
3648
|
-
const [currentPage,setCurrentPage] =
|
|
3649
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
3650
|
-
const [dispForms,setDispForms] =
|
|
3651
|
-
const [dispFormsOri,setDispFormsOri] =
|
|
3652
|
-
const [displayContent,setDisplayContent] =
|
|
3653
|
-
const [sortDir,setSortDir] =
|
|
3654
|
-
|
|
3655
|
-
|
|
856
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
857
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
858
|
+
const [dispForms,setDispForms] = React$2.useState([]);
|
|
859
|
+
const [dispFormsOri,setDispFormsOri] = React$2.useState(forms);
|
|
860
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
861
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
862
|
+
|
|
863
|
+
React$2.useEffect(()=>{
|
|
3656
864
|
//pagination
|
|
3657
865
|
if (dispFormsOri.length > 0){
|
|
3658
866
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -3665,14 +873,14 @@ const AppFormsTable = (props) => {
|
|
|
3665
873
|
setDisplayContent(true);
|
|
3666
874
|
},[dispFormsOri,currentPage]);
|
|
3667
875
|
|
|
3668
|
-
|
|
876
|
+
React$2.useEffect(()=>{
|
|
3669
877
|
setDispFormsOri(forms.sort((a,b) => {
|
|
3670
878
|
if(a.formName < b.formName) return -1
|
|
3671
879
|
return 1
|
|
3672
880
|
}));
|
|
3673
881
|
},[forms]);
|
|
3674
882
|
|
|
3675
|
-
|
|
883
|
+
React$2.useEffect(()=>{
|
|
3676
884
|
if (srchActive) setCurrentPage(1);
|
|
3677
885
|
},[srchActive]);
|
|
3678
886
|
|
|
@@ -3855,14 +1063,14 @@ const NothingContent$8 = styled.div`
|
|
|
3855
1063
|
const _jsxFileName$T = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\AppModulesTable\\AppModulesTable.tsx";
|
|
3856
1064
|
const AppModulesTable = (props) => {
|
|
3857
1065
|
const {modules,callback,srchActive} = props;
|
|
3858
|
-
const [currentPage,setCurrentPage] =
|
|
3859
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
3860
|
-
const [dispModules,setDispModules] =
|
|
3861
|
-
const [dispModulesOri,setDispModulesOri] =
|
|
3862
|
-
const [displayContent,setDisplayContent] =
|
|
3863
|
-
const [sortDir,setSortDir] =
|
|
3864
|
-
|
|
3865
|
-
|
|
1066
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
1067
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
1068
|
+
const [dispModules,setDispModules] = React$2.useState([]);
|
|
1069
|
+
const [dispModulesOri,setDispModulesOri] = React$2.useState(modules);
|
|
1070
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
1071
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
1072
|
+
|
|
1073
|
+
React$2.useEffect(()=>{
|
|
3866
1074
|
//pagination
|
|
3867
1075
|
if (dispModulesOri.length > 0){
|
|
3868
1076
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -3875,14 +1083,14 @@ const AppModulesTable = (props) => {
|
|
|
3875
1083
|
setDisplayContent(true);
|
|
3876
1084
|
},[dispModulesOri,currentPage]);
|
|
3877
1085
|
|
|
3878
|
-
|
|
1086
|
+
React$2.useEffect(()=>{
|
|
3879
1087
|
setDispModulesOri(modules.sort((a,b) => {
|
|
3880
1088
|
if(a.moduleName < b.moduleName) return -1
|
|
3881
1089
|
return 1
|
|
3882
1090
|
}));
|
|
3883
1091
|
},[modules]);
|
|
3884
1092
|
|
|
3885
|
-
|
|
1093
|
+
React$2.useEffect(()=>{
|
|
3886
1094
|
if (srchActive) setCurrentPage(1);
|
|
3887
1095
|
},[srchActive]);
|
|
3888
1096
|
|
|
@@ -4336,8 +1544,8 @@ const Loader = (props) => {
|
|
|
4336
1544
|
const _jsxFileName$P = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\BankAccounts\\BankAccounts.tsx";
|
|
4337
1545
|
const BankAccounts = (props) => {
|
|
4338
1546
|
const {acctDets,loading} = props;
|
|
4339
|
-
const [acctBtnNum,setAcctBtnNum] =
|
|
4340
|
-
const [clickedBtn,setClickedBtn] =
|
|
1547
|
+
const [acctBtnNum,setAcctBtnNum] = React$2.useState(null); //index of the account whose button was clicked. Used to trigger the loading spinner for that account
|
|
1548
|
+
const [clickedBtn,setClickedBtn] = React$2.useState(null);
|
|
4341
1549
|
|
|
4342
1550
|
return (
|
|
4343
1551
|
React$2.createElement(BankAcctsWrapper, {__self: undefined, __source: {fileName: _jsxFileName$P, lineNumber: 15}}
|
|
@@ -4471,7 +1679,7 @@ const _jsxFileName$O = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
4471
1679
|
|
|
4472
1680
|
const BankSelector = (props) => {
|
|
4473
1681
|
const {bankAcct,selectedBank} = props;
|
|
4474
|
-
const [selIndex,setSelIndex] =
|
|
1682
|
+
const [selIndex,setSelIndex] = React$2.useState(null);
|
|
4475
1683
|
|
|
4476
1684
|
return (
|
|
4477
1685
|
React$2.createElement(MapContainer, {__self: undefined, __source: {fileName: _jsxFileName$O, lineNumber: 10}}
|
|
@@ -4676,14 +1884,14 @@ const BrokerCountry = styled.div`
|
|
|
4676
1884
|
const _jsxFileName$M = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\BrokersTable\\BrokersTable.tsx";
|
|
4677
1885
|
const BrokersTable = (props) => {
|
|
4678
1886
|
const {brokers,callback,srchActive} = props;
|
|
4679
|
-
const [currentPage,setCurrentPage] =
|
|
4680
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
4681
|
-
const [dispBrokers,setDispBrokers] =
|
|
4682
|
-
const [dispBrokersOri,setDispBrokersOri] =
|
|
4683
|
-
const [displayContent,setDisplayContent] =
|
|
4684
|
-
const [sortDir,setSortDir] =
|
|
4685
|
-
|
|
4686
|
-
|
|
1887
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
1888
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
1889
|
+
const [dispBrokers,setDispBrokers] = React$2.useState([]);
|
|
1890
|
+
const [dispBrokersOri,setDispBrokersOri] = React$2.useState(brokers);
|
|
1891
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
1892
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
1893
|
+
|
|
1894
|
+
React$2.useEffect(()=>{
|
|
4687
1895
|
//pagination
|
|
4688
1896
|
if (dispBrokersOri.length > 0){
|
|
4689
1897
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -4696,14 +1904,14 @@ const BrokersTable = (props) => {
|
|
|
4696
1904
|
setDisplayContent(true);
|
|
4697
1905
|
},[dispBrokersOri,currentPage]);
|
|
4698
1906
|
|
|
4699
|
-
|
|
1907
|
+
React$2.useEffect(()=>{
|
|
4700
1908
|
setDispBrokersOri(brokers.sort((a,b) => {
|
|
4701
1909
|
if(a.name < b.name) return -1
|
|
4702
1910
|
return 1
|
|
4703
1911
|
}));
|
|
4704
1912
|
},[brokers]);
|
|
4705
1913
|
|
|
4706
|
-
|
|
1914
|
+
React$2.useEffect(()=>{
|
|
4707
1915
|
if (srchActive) setCurrentPage(1);
|
|
4708
1916
|
},[srchActive]);
|
|
4709
1917
|
|
|
@@ -18219,8 +15427,8 @@ function cloneData(data) {
|
|
|
18219
15427
|
|
|
18220
15428
|
function ChartComponent(param, ref) {
|
|
18221
15429
|
let { height =150 , width =300 , redraw =false , datasetIdKey , type , data , options , plugins =[] , fallbackContent , updateMode , ...props } = param;
|
|
18222
|
-
const canvasRef =
|
|
18223
|
-
const chartRef =
|
|
15430
|
+
const canvasRef = React$2.useRef(null);
|
|
15431
|
+
const chartRef = React$2.useRef();
|
|
18224
15432
|
const renderChart = ()=>{
|
|
18225
15433
|
if (!canvasRef.current) return;
|
|
18226
15434
|
chartRef.current = new Chart$2(canvasRef.current, {
|
|
@@ -18240,7 +15448,7 @@ function ChartComponent(param, ref) {
|
|
|
18240
15448
|
chartRef.current = null;
|
|
18241
15449
|
}
|
|
18242
15450
|
};
|
|
18243
|
-
|
|
15451
|
+
React$2.useEffect(()=>{
|
|
18244
15452
|
if (!redraw && chartRef.current && options) {
|
|
18245
15453
|
setOptions(chartRef.current, options);
|
|
18246
15454
|
}
|
|
@@ -18248,7 +15456,7 @@ function ChartComponent(param, ref) {
|
|
|
18248
15456
|
redraw,
|
|
18249
15457
|
options
|
|
18250
15458
|
]);
|
|
18251
|
-
|
|
15459
|
+
React$2.useEffect(()=>{
|
|
18252
15460
|
if (!redraw && chartRef.current) {
|
|
18253
15461
|
setLabels(chartRef.current.config.data, data.labels);
|
|
18254
15462
|
}
|
|
@@ -18256,7 +15464,7 @@ function ChartComponent(param, ref) {
|
|
|
18256
15464
|
redraw,
|
|
18257
15465
|
data.labels
|
|
18258
15466
|
]);
|
|
18259
|
-
|
|
15467
|
+
React$2.useEffect(()=>{
|
|
18260
15468
|
if (!redraw && chartRef.current && data.datasets) {
|
|
18261
15469
|
setDatasets(chartRef.current.config.data, data.datasets, datasetIdKey);
|
|
18262
15470
|
}
|
|
@@ -18264,7 +15472,7 @@ function ChartComponent(param, ref) {
|
|
|
18264
15472
|
redraw,
|
|
18265
15473
|
data.datasets
|
|
18266
15474
|
]);
|
|
18267
|
-
|
|
15475
|
+
React$2.useEffect(()=>{
|
|
18268
15476
|
if (!chartRef.current) return;
|
|
18269
15477
|
if (redraw) {
|
|
18270
15478
|
destroyChart();
|
|
@@ -18279,14 +15487,14 @@ function ChartComponent(param, ref) {
|
|
|
18279
15487
|
data.datasets,
|
|
18280
15488
|
updateMode
|
|
18281
15489
|
]);
|
|
18282
|
-
|
|
15490
|
+
React$2.useEffect(()=>{
|
|
18283
15491
|
if (!chartRef.current) return;
|
|
18284
15492
|
destroyChart();
|
|
18285
15493
|
setTimeout(renderChart);
|
|
18286
15494
|
}, [
|
|
18287
15495
|
type
|
|
18288
15496
|
]);
|
|
18289
|
-
|
|
15497
|
+
React$2.useEffect(()=>{
|
|
18290
15498
|
renderChart();
|
|
18291
15499
|
return ()=>destroyChart()
|
|
18292
15500
|
;
|
|
@@ -18298,11 +15506,11 @@ function ChartComponent(param, ref) {
|
|
|
18298
15506
|
width: width
|
|
18299
15507
|
}, props), fallbackContent));
|
|
18300
15508
|
}
|
|
18301
|
-
const Chart$1 = /*#__PURE__*/
|
|
15509
|
+
const Chart$1 = /*#__PURE__*/ React$2.forwardRef(ChartComponent);
|
|
18302
15510
|
|
|
18303
15511
|
function createTypedChart(type, registerables) {
|
|
18304
15512
|
Chart$2.register(registerables);
|
|
18305
|
-
return(/*#__PURE__*/
|
|
15513
|
+
return(/*#__PURE__*/ React$2.forwardRef((props, ref)=>/*#__PURE__*/ React$2.createElement(Chart$1, Object.assign({}, props, {
|
|
18306
15514
|
ref: ref,
|
|
18307
15515
|
type: type
|
|
18308
15516
|
}))
|
|
@@ -18310,6 +15518,8 @@ function createTypedChart(type, registerables) {
|
|
|
18310
15518
|
}
|
|
18311
15519
|
const Line = /* #__PURE__ */ createTypedChart('line', LineController);
|
|
18312
15520
|
|
|
15521
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
15522
|
+
|
|
18313
15523
|
var dayjs_minExports = {};
|
|
18314
15524
|
var dayjs_min = {
|
|
18315
15525
|
get exports(){ return dayjs_minExports; },
|
|
@@ -18422,9 +15632,9 @@ const _jsxFileName$L = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
18422
15632
|
|
|
18423
15633
|
const Chart = (props) => {
|
|
18424
15634
|
const {ratesData,exchCurrFlag,baseCurrCode,exchCurrName,exchCurrCode} = props;
|
|
18425
|
-
const [graphData,setGraphData] =
|
|
15635
|
+
const [graphData,setGraphData] = React$2.useState({});
|
|
18426
15636
|
|
|
18427
|
-
const [change,setChange] =
|
|
15637
|
+
const [change,setChange] = React$2.useState(0);
|
|
18428
15638
|
|
|
18429
15639
|
//generate graph colour based on performance of the currency
|
|
18430
15640
|
const performanceColor = (rateChange) => {
|
|
@@ -18446,7 +15656,7 @@ const Chart = (props) => {
|
|
|
18446
15656
|
}
|
|
18447
15657
|
};
|
|
18448
15658
|
|
|
18449
|
-
|
|
15659
|
+
React$2.useEffect(()=>{
|
|
18450
15660
|
let curr = {
|
|
18451
15661
|
dates:[],
|
|
18452
15662
|
data:[],
|
|
@@ -18660,9 +15870,9 @@ const _jsxFileName$K = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
18660
15870
|
|
|
18661
15871
|
const ChartMedium = (props) => {
|
|
18662
15872
|
const {ratesData,exchCurrFlag,baseCurrCode,exchCurrName,exchCurrCode} = props;
|
|
18663
|
-
const [graphData,setGraphData] =
|
|
15873
|
+
const [graphData,setGraphData] = React$2.useState({});
|
|
18664
15874
|
|
|
18665
|
-
const [change,setChange] =
|
|
15875
|
+
const [change,setChange] = React$2.useState(0);
|
|
18666
15876
|
|
|
18667
15877
|
//generate graph colour based on performance of the currency
|
|
18668
15878
|
const performanceColor = (rateChange) => {
|
|
@@ -18684,7 +15894,7 @@ const ChartMedium = (props) => {
|
|
|
18684
15894
|
}
|
|
18685
15895
|
};
|
|
18686
15896
|
|
|
18687
|
-
|
|
15897
|
+
React$2.useEffect(()=>{
|
|
18688
15898
|
let curr = {
|
|
18689
15899
|
dates:[],
|
|
18690
15900
|
data:[],
|
|
@@ -18897,9 +16107,9 @@ const _jsxFileName$J = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
18897
16107
|
|
|
18898
16108
|
const ChartSmall = (props) => {
|
|
18899
16109
|
const {ratesData,exchCurrFlag,baseCurrCode,exchCurrName,exchCurrCode} = props;
|
|
18900
|
-
const [graphData,setGraphData] =
|
|
16110
|
+
const [graphData,setGraphData] = React$2.useState({});
|
|
18901
16111
|
|
|
18902
|
-
const [change,setChange] =
|
|
16112
|
+
const [change,setChange] = React$2.useState(0);
|
|
18903
16113
|
|
|
18904
16114
|
//generate graph colour based on performance of the currency
|
|
18905
16115
|
const performanceColor = (rateChange) => {
|
|
@@ -18921,7 +16131,7 @@ const ChartSmall = (props) => {
|
|
|
18921
16131
|
}
|
|
18922
16132
|
};
|
|
18923
16133
|
|
|
18924
|
-
|
|
16134
|
+
React$2.useEffect(()=>{
|
|
18925
16135
|
let curr = {
|
|
18926
16136
|
dates:[],
|
|
18927
16137
|
data:[],
|
|
@@ -19303,16 +16513,16 @@ const _jsxFileName$H = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
19303
16513
|
|
|
19304
16514
|
const CountrySelector = (props) => {
|
|
19305
16515
|
const {options,selectedOption,initialText,initialFlag,label,placeholder,searchable,sectionTitle} = props;
|
|
19306
|
-
const [opened,setOpened] =
|
|
19307
|
-
const [passedOption,setPassedOption] =
|
|
19308
|
-
const [optionsOri,setOptionsOri] =
|
|
19309
|
-
const [optionsRec,setOptionsRec] =
|
|
19310
|
-
const [qryStr,setQryStr] =
|
|
19311
|
-
const buttonRef =
|
|
16516
|
+
const [opened,setOpened] = React$2.useState(false);
|
|
16517
|
+
const [passedOption,setPassedOption] = React$2.useState({});
|
|
16518
|
+
const [optionsOri,setOptionsOri] = React$2.useState([]);
|
|
16519
|
+
const [optionsRec,setOptionsRec] = React$2.useState([]);
|
|
16520
|
+
const [qryStr,setQryStr] = React$2.useState('');
|
|
16521
|
+
const buttonRef = React$2.useRef();
|
|
19312
16522
|
|
|
19313
16523
|
let imgFile = initialFlag ? initialFlag : img$2;
|
|
19314
16524
|
|
|
19315
|
-
|
|
16525
|
+
React$2.useEffect(()=>{
|
|
19316
16526
|
document.addEventListener('keyup',function(e){
|
|
19317
16527
|
if (opened && e.key === 'Escape') setOpened(false);
|
|
19318
16528
|
if (!opened && (document ).activeElement.classList.value.includes('country-selector') && e.code === 'Enter' ||
|
|
@@ -19325,7 +16535,7 @@ const CountrySelector = (props) => {
|
|
|
19325
16535
|
}
|
|
19326
16536
|
},[opened]);
|
|
19327
16537
|
|
|
19328
|
-
|
|
16538
|
+
React$2.useEffect(()=>{
|
|
19329
16539
|
setOptionsOri(options);
|
|
19330
16540
|
setOptionsRec(options);
|
|
19331
16541
|
},[options]);
|
|
@@ -19524,16 +16734,16 @@ const NothingContent$6 = styled.div`
|
|
|
19524
16734
|
const _jsxFileName$G = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\CurrencyPairs\\CurrencyPairsTable.tsx";
|
|
19525
16735
|
const CurrencyPairsTable = (props) => {
|
|
19526
16736
|
const {pairs,callback,srchActive} = props;
|
|
19527
|
-
const [currentPage,setCurrentPage] =
|
|
19528
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
19529
|
-
const [dispPairs,setDispPairs] =
|
|
19530
|
-
const [dispPairsOri,setDispPairsOri] =
|
|
19531
|
-
const [displayContent,setDisplayContent] =
|
|
19532
|
-
const [sortPairDir,setSortPairDir] =
|
|
19533
|
-
const [sortBaseDir,setSortBaseDir] =
|
|
19534
|
-
const [sortExchDir,setSortExchDir] =
|
|
19535
|
-
|
|
19536
|
-
|
|
16737
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
16738
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
16739
|
+
const [dispPairs,setDispPairs] = React$2.useState([]);
|
|
16740
|
+
const [dispPairsOri,setDispPairsOri] = React$2.useState(pairs);
|
|
16741
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
16742
|
+
const [sortPairDir,setSortPairDir] = React$2.useState('desc');
|
|
16743
|
+
const [sortBaseDir,setSortBaseDir] = React$2.useState('desc');
|
|
16744
|
+
const [sortExchDir,setSortExchDir] = React$2.useState('desc');
|
|
16745
|
+
|
|
16746
|
+
React$2.useEffect(()=>{
|
|
19537
16747
|
//pagination
|
|
19538
16748
|
if (dispPairsOri.length > 0){
|
|
19539
16749
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -19546,14 +16756,14 @@ const CurrencyPairsTable = (props) => {
|
|
|
19546
16756
|
setDisplayContent(true);
|
|
19547
16757
|
},[dispPairsOri,currentPage]);
|
|
19548
16758
|
|
|
19549
|
-
|
|
16759
|
+
React$2.useEffect(()=>{
|
|
19550
16760
|
setDispPairsOri(pairs.sort((a,b) => {
|
|
19551
16761
|
if(a.pairCode < b.pairCode) return -1
|
|
19552
16762
|
return 1
|
|
19553
16763
|
}));
|
|
19554
16764
|
},[pairs]);
|
|
19555
16765
|
|
|
19556
|
-
|
|
16766
|
+
React$2.useEffect(()=>{
|
|
19557
16767
|
if (srchActive) setCurrentPage(1);
|
|
19558
16768
|
},[srchActive]);
|
|
19559
16769
|
|
|
@@ -19928,12 +17138,12 @@ const _jsxFileName$F = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
19928
17138
|
|
|
19929
17139
|
const DatePicker = (props) => {
|
|
19930
17140
|
const { onChange, label, subtext,disablePastDays,disableFutureDays ,placeholder} = props;
|
|
19931
|
-
const [selectedDate, setSelectedDate] =
|
|
19932
|
-
const [isCalendarOpen, setIsCalendarOpen] =
|
|
17141
|
+
const [selectedDate, setSelectedDate] = React$2.useState(null);
|
|
17142
|
+
const [isCalendarOpen, setIsCalendarOpen] = React$2.useState(false);
|
|
19933
17143
|
|
|
19934
|
-
const calendarRef =
|
|
17144
|
+
const calendarRef = React$2.useRef(null);
|
|
19935
17145
|
|
|
19936
|
-
|
|
17146
|
+
React$2.useEffect(()=>{
|
|
19937
17147
|
document.addEventListener('click',function(e){
|
|
19938
17148
|
setIsCalendarOpen(calendarRef.current.contains(e.target));
|
|
19939
17149
|
});
|
|
@@ -20004,9 +17214,9 @@ const DatePicker = (props) => {
|
|
|
20004
17214
|
|
|
20005
17215
|
|
|
20006
17216
|
const Calendar = ({ onChange, selected,disablePastDaysProp,disableFutureDaysProp}) => {
|
|
20007
|
-
const [currentDate, setCurrentDate] =
|
|
20008
|
-
const [currentYear,setCurrentYear] =
|
|
20009
|
-
const [calendarView,setCalendarView] =
|
|
17217
|
+
const [currentDate, setCurrentDate] = React$2.useState(selected || new Date());
|
|
17218
|
+
const [currentYear,setCurrentYear] = React$2.useState(new Date().getFullYear());
|
|
17219
|
+
const [calendarView,setCalendarView] = React$2.useState(true);
|
|
20010
17220
|
|
|
20011
17221
|
const daysOfWeek = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
20012
17222
|
|
|
@@ -20474,18 +17684,18 @@ const YearPickerContainer = styled.div`
|
|
|
20474
17684
|
|
|
20475
17685
|
const _jsxFileName$E = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\DateRangePicker\\DateRangePicker.tsx";
|
|
20476
17686
|
const DateRangePicker = ({ selectedDateRange,label,subtext ,placeholder}) => {
|
|
20477
|
-
const [startMonth, setStartMonth] =
|
|
20478
|
-
const [endMonth, setEndMonth] =
|
|
17687
|
+
const [startMonth, setStartMonth] = React$2.useState(new Date());
|
|
17688
|
+
const [endMonth, setEndMonth] = React$2.useState(() => {
|
|
20479
17689
|
const nextMonth = new Date();
|
|
20480
17690
|
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
|
20481
17691
|
return nextMonth;
|
|
20482
17692
|
});
|
|
20483
|
-
const [startDate, setStartDate] =
|
|
20484
|
-
const [endDate, setEndDate] =
|
|
20485
|
-
const [showCalendar,setShowCalendar] =
|
|
17693
|
+
const [startDate, setStartDate] = React$2.useState(null);
|
|
17694
|
+
const [endDate, setEndDate] = React$2.useState(null);
|
|
17695
|
+
const [showCalendar,setShowCalendar] = React$2.useState(false);
|
|
20486
17696
|
|
|
20487
|
-
const [toggleStartYearPicker,setToggleStartYearPicker] =
|
|
20488
|
-
const [toggleEndYearPicker,setToggleEndYearPicker] =
|
|
17697
|
+
const [toggleStartYearPicker,setToggleStartYearPicker] = React$2.useState(false);
|
|
17698
|
+
const [toggleEndYearPicker,setToggleEndYearPicker] = React$2.useState(false);
|
|
20489
17699
|
|
|
20490
17700
|
const handleDateClick = (date, isStartCalendar) => {
|
|
20491
17701
|
if (!startDate) {
|
|
@@ -20546,7 +17756,7 @@ const DateRangePicker = ({ selectedDateRange,label,subtext ,placeholder}) => {
|
|
|
20546
17756
|
const YearPicker = (props) => {
|
|
20547
17757
|
const {selYear,monthYear,isVisible} = props;
|
|
20548
17758
|
const yearRange = 10;
|
|
20549
|
-
const [calendarYear, setCalendarYear] =
|
|
17759
|
+
const [calendarYear, setCalendarYear] = React$2.useState(new Date().getFullYear());
|
|
20550
17760
|
|
|
20551
17761
|
const handleNextRange = () => {
|
|
20552
17762
|
setCalendarYear(prevYear => prevYear + (yearRange * 2 + 1));
|
|
@@ -20989,15 +18199,15 @@ const DropdownOption = styled.div`
|
|
|
20989
18199
|
const _jsxFileName$C = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\DropdownList\\DropdownList.tsx";
|
|
20990
18200
|
const DropdownList = (props) => {
|
|
20991
18201
|
const {options,returnedSelection,initialText,disabled,label,placeholder,searchable} = props;
|
|
20992
|
-
const [opened,setOpened] =
|
|
20993
|
-
const [passedOption,setPassedOption] =
|
|
20994
|
-
const [err,setErr] =
|
|
20995
|
-
const [optionsOri,setOptionsOri] =
|
|
20996
|
-
const [optionsRec,setOptionsRec] =
|
|
20997
|
-
const [qryStr,setQryStr] =
|
|
20998
|
-
const buttonRef =
|
|
20999
|
-
|
|
21000
|
-
|
|
18202
|
+
const [opened,setOpened] = React$2.useState(false);
|
|
18203
|
+
const [passedOption,setPassedOption] = React$2.useState({});
|
|
18204
|
+
const [err,setErr] = React$2.useState(false);
|
|
18205
|
+
const [optionsOri,setOptionsOri] = React$2.useState([]);
|
|
18206
|
+
const [optionsRec,setOptionsRec] = React$2.useState([]);
|
|
18207
|
+
const [qryStr,setQryStr] = React$2.useState('');
|
|
18208
|
+
const buttonRef = React$2.useRef();
|
|
18209
|
+
|
|
18210
|
+
React$2.useEffect(()=>{
|
|
21001
18211
|
document.addEventListener('keyup',function(e){
|
|
21002
18212
|
if (opened && e.code === 'Escape') setOpened(false);
|
|
21003
18213
|
if (!opened && (document ).activeElement.classList.value.includes('dropdown-field') && e.code === 'Enter' ||
|
|
@@ -21010,7 +18220,7 @@ const DropdownList = (props) => {
|
|
|
21010
18220
|
}
|
|
21011
18221
|
},[opened]);
|
|
21012
18222
|
|
|
21013
|
-
|
|
18223
|
+
React$2.useEffect(()=>{
|
|
21014
18224
|
setOptionsOri(options);
|
|
21015
18225
|
setOptionsRec(options);
|
|
21016
18226
|
},[options]);
|
|
@@ -21233,36 +18443,33 @@ const CopyrightText = styled.p`
|
|
|
21233
18443
|
|
|
21234
18444
|
const _jsxFileName$A = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\Footer\\Footer.tsx";
|
|
21235
18445
|
const Footer = () => {
|
|
21236
|
-
const [title,setTitle] = React$2.useState('Contact Us');
|
|
21237
|
-
|
|
21238
18446
|
return (
|
|
21239
|
-
React$2.createElement(FooterContainer, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21240
|
-
, React$2.createElement(FooterArea, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21241
|
-
, React$2.createElement(AboutSSX, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
18447
|
+
React$2.createElement(FooterContainer, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 6}}
|
|
18448
|
+
, React$2.createElement(FooterArea, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 7}}
|
|
18449
|
+
, React$2.createElement(AboutSSX, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 8}}
|
|
21242
18450
|
/*<img style={{marginBottom:'16px'}} src={SSXLogo} alt="SSX Logo"/>*/
|
|
21243
18451
|
, React$2.createElement('img', {
|
|
21244
18452
|
src: "https://res.cloudinary.com/dxivfczqg/image/upload/v1643889560/ssx-linear-logo-light_mdafbc.png",
|
|
21245
|
-
alt: "SSX Logo" , __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21246
|
-
, React$2.createElement('p', { style: {width:'270px'}, __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
18453
|
+
alt: "SSX Logo" , __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 10}})
|
|
18454
|
+
, React$2.createElement('p', { style: {width:'270px'}, __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 13}}, "A platform you can trust to deliver the latest capital trading news and trends across Africa." )
|
|
21247
18455
|
)
|
|
21248
|
-
, React$2.createElement(SSXInfo, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21249
|
-
, React$2.createElement('h6', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21250
|
-
|
|
21251
|
-
|
|
21252
|
-
|
|
21253
|
-
, React$2.createElement('br', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 22}}), "questions@secondstax.info"
|
|
18456
|
+
, React$2.createElement(SSXInfo, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 15}}
|
|
18457
|
+
, React$2.createElement('h6', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 16}}, "Contact Us" )
|
|
18458
|
+
, React$2.createElement('p', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 17}}, "222 Swaniker Street" , React$2.createElement('br', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 17}}), "Abelemkpe - Accra"
|
|
18459
|
+
, React$2.createElement('br', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 18}}), "+233 (0) 59 284 1131"
|
|
18460
|
+
, React$2.createElement('br', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 19}}), "questions@secondstax.info"
|
|
21254
18461
|
)
|
|
21255
18462
|
)
|
|
21256
|
-
, React$2.createElement(SSXInfo, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21257
|
-
, React$2.createElement('h6', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21258
|
-
, React$2.createElement('path', { d: "M7.00001 0.833336C5.68147 0.833336 4.39254 1.22433 3.29621 1.95687C2.19988 2.68941 1.3454 3.73061 0.840816 4.94878C0.336232 6.16695 0.20421 7.5074 0.461445 8.8006C0.718679 10.0938 1.35362 11.2817 2.28597 12.214C3.21832 13.1464 4.4062 13.7813 5.69941 14.0386C6.99262 14.2958 8.33306 14.1638 9.55124 13.6592C10.7694 13.1546 11.8106 12.3001 12.5431 11.2038C13.2757 10.1075 13.6667 8.81854 13.6667 7.5C13.6647 5.7325 12.9617 4.03795 11.7119 2.78813C10.4621 1.53831 8.76752 0.835302 7.00001 0.833336ZM7.00001 12.8333C5.94518 12.8333 4.91403 12.5205 4.03697 11.9345C3.15991 11.3485 2.47632 10.5155 2.07266 9.54098C1.66899 8.56644 1.56337 7.49409 1.76916 6.45952C1.97495 5.42496 2.4829 4.47465 3.22878 3.72877C3.97466 2.98289 4.92497 2.47494 5.95953 2.26915C6.9941 2.06336 8.06645 2.16898 9.04099 2.57265C10.0155 2.97631 10.8485 3.6599 11.4345 4.53696C12.0206 5.41402 12.3333 6.44517 12.3333 7.5C12.3317 8.91399 11.7693 10.2696 10.7695 11.2695C9.76962 12.2693 8.41401 12.8317 7.00001 12.8333ZM7.00001 7.16667C6.8232 7.16667 6.65363 7.23691 6.52861 7.36193C6.40358 7.48696 6.33335 7.65652 6.33335 7.83334V9.83333C6.33335 10.0101 6.40358 10.1797 6.52861 10.3047C6.65363 10.4298 6.8232 10.5 7.00001 10.5C7.17682 10.5 7.34639 10.4298 7.47142 10.3047C7.59644 10.1797 7.66668 10.0101 7.66668 9.83333V7.83334C7.66668 7.65652 7.59644 7.48696 7.47142 7.36193C7.34639 7.23691 7.17682 7.16667 7.00001 7.16667ZM7.00001 4.5C6.8352 4.5 6.67408 4.54888 6.53704 4.64044C6.4 4.73201 6.29319 4.86216 6.23011 5.01443C6.16704 5.1667 6.15054 5.33426 6.18269 5.49591C6.21485 5.65756 6.29421 5.80605 6.41076 5.92259C6.5273 6.03913 6.67579 6.1185 6.83744 6.15066C6.99909 6.18281 7.16664 6.16631 7.31892 6.10323C7.47119 6.04016 7.60134 5.93335 7.6929 5.79631C7.78447 5.65927 7.83335 5.49815 7.83335 5.33334C7.83335 5.11232 7.74555 4.90036 7.58927 4.74408C7.43299 4.5878 7.22103 4.5 7.00001 4.5Z" , fill: "#F7F9FC", __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
18463
|
+
, React$2.createElement(SSXInfo, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 22}}
|
|
18464
|
+
, React$2.createElement('h6', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 23}}, React$2.createElement('svg', { width: "14", height: "15", viewBox: "0 0 14 15" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 23}}
|
|
18465
|
+
, React$2.createElement('path', { d: "M7.00001 0.833336C5.68147 0.833336 4.39254 1.22433 3.29621 1.95687C2.19988 2.68941 1.3454 3.73061 0.840816 4.94878C0.336232 6.16695 0.20421 7.5074 0.461445 8.8006C0.718679 10.0938 1.35362 11.2817 2.28597 12.214C3.21832 13.1464 4.4062 13.7813 5.69941 14.0386C6.99262 14.2958 8.33306 14.1638 9.55124 13.6592C10.7694 13.1546 11.8106 12.3001 12.5431 11.2038C13.2757 10.1075 13.6667 8.81854 13.6667 7.5C13.6647 5.7325 12.9617 4.03795 11.7119 2.78813C10.4621 1.53831 8.76752 0.835302 7.00001 0.833336ZM7.00001 12.8333C5.94518 12.8333 4.91403 12.5205 4.03697 11.9345C3.15991 11.3485 2.47632 10.5155 2.07266 9.54098C1.66899 8.56644 1.56337 7.49409 1.76916 6.45952C1.97495 5.42496 2.4829 4.47465 3.22878 3.72877C3.97466 2.98289 4.92497 2.47494 5.95953 2.26915C6.9941 2.06336 8.06645 2.16898 9.04099 2.57265C10.0155 2.97631 10.8485 3.6599 11.4345 4.53696C12.0206 5.41402 12.3333 6.44517 12.3333 7.5C12.3317 8.91399 11.7693 10.2696 10.7695 11.2695C9.76962 12.2693 8.41401 12.8317 7.00001 12.8333ZM7.00001 7.16667C6.8232 7.16667 6.65363 7.23691 6.52861 7.36193C6.40358 7.48696 6.33335 7.65652 6.33335 7.83334V9.83333C6.33335 10.0101 6.40358 10.1797 6.52861 10.3047C6.65363 10.4298 6.8232 10.5 7.00001 10.5C7.17682 10.5 7.34639 10.4298 7.47142 10.3047C7.59644 10.1797 7.66668 10.0101 7.66668 9.83333V7.83334C7.66668 7.65652 7.59644 7.48696 7.47142 7.36193C7.34639 7.23691 7.17682 7.16667 7.00001 7.16667ZM7.00001 4.5C6.8352 4.5 6.67408 4.54888 6.53704 4.64044C6.4 4.73201 6.29319 4.86216 6.23011 5.01443C6.16704 5.1667 6.15054 5.33426 6.18269 5.49591C6.21485 5.65756 6.29421 5.80605 6.41076 5.92259C6.5273 6.03913 6.67579 6.1185 6.83744 6.15066C6.99909 6.18281 7.16664 6.16631 7.31892 6.10323C7.47119 6.04016 7.60134 5.93335 7.6929 5.79631C7.78447 5.65927 7.83335 5.49815 7.83335 5.33334C7.83335 5.11232 7.74555 4.90036 7.58927 4.74408C7.43299 4.5878 7.22103 4.5 7.00001 4.5Z" , fill: "#F7F9FC", __self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 24}})
|
|
21259
18466
|
), "Important Note"
|
|
21260
18467
|
)
|
|
21261
|
-
, React$2.createElement('p', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
18468
|
+
, React$2.createElement('p', {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 27}}, "SecondSTAX does not own rights to some of the content displayed on this website. All content is sourced directly from the outlet." )
|
|
21262
18469
|
)
|
|
21263
18470
|
)
|
|
21264
|
-
, React$2.createElement(CopyrightArea, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
21265
|
-
, React$2.createElement(CopyrightText, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber:
|
|
18471
|
+
, React$2.createElement(CopyrightArea, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 30}}
|
|
18472
|
+
, React$2.createElement(CopyrightText, {__self: undefined, __source: {fileName: _jsxFileName$A, lineNumber: 31}}, "©", new Date().getFullYear(), " SecondSTAX Ltd. All Rights Reserved." )
|
|
21266
18473
|
)
|
|
21267
18474
|
)
|
|
21268
18475
|
)
|
|
@@ -22288,11 +19495,11 @@ const _jsxFileName$u = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
22288
19495
|
|
|
22289
19496
|
const LPTopBar = (props) => {
|
|
22290
19497
|
const {userName,requestLpUrl,notifications, myProfileUrl, signOutApiUrl} = props;
|
|
22291
|
-
const [toggleBugReporting,setToggleBugReporting] =
|
|
22292
|
-
const [toggleNotifications,setToggleNotifications] =
|
|
22293
|
-
const [toggleProfileCard,setToggleProfileCard] =
|
|
22294
|
-
const [bugReportStage,setBugReportStage] =
|
|
22295
|
-
const [sendingBR,setSendingBR] =
|
|
19498
|
+
const [toggleBugReporting,setToggleBugReporting] = React$2.useState(false);
|
|
19499
|
+
const [toggleNotifications,setToggleNotifications] = React$2.useState(false);
|
|
19500
|
+
const [toggleProfileCard,setToggleProfileCard] = React$2.useState(false);
|
|
19501
|
+
const [bugReportStage,setBugReportStage] = React$2.useState(1);
|
|
19502
|
+
const [sendingBR,setSendingBR] = React$2.useState(false);
|
|
22296
19503
|
|
|
22297
19504
|
function submitBug(){
|
|
22298
19505
|
setSendingBR(true);
|
|
@@ -22759,7 +19966,7 @@ const _jsxFileName$s = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
22759
19966
|
|
|
22760
19967
|
const Tab = (props) => {
|
|
22761
19968
|
const {tabs,bgHexColor,inactiveTabBgHexColor,selectedTab} = props;
|
|
22762
|
-
const [tabIndex,setTabIndex] =
|
|
19969
|
+
const [tabIndex,setTabIndex] = React$2.useState(0);
|
|
22763
19970
|
|
|
22764
19971
|
return (
|
|
22765
19972
|
React$2.createElement(React$2.Fragment, null
|
|
@@ -23241,12 +20448,12 @@ const _jsxFileName$l = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
23241
20448
|
const PasswordField = (props) => {
|
|
23242
20449
|
const {label,subtext,disabled,errMsg,setValue} = props;
|
|
23243
20450
|
|
|
23244
|
-
const [passString,setPassString] =
|
|
23245
|
-
const [borderColor,setBorderColor] =
|
|
23246
|
-
const [err,setErr] =
|
|
23247
|
-
const [showPw,setShowPw] =
|
|
20451
|
+
const [passString,setPassString] = React$2.useState('');
|
|
20452
|
+
const [borderColor,setBorderColor] = React$2.useState('');
|
|
20453
|
+
const [err,setErr] = React$2.useState(false);
|
|
20454
|
+
const [showPw,setShowPw] = React$2.useState(false);
|
|
23248
20455
|
|
|
23249
|
-
|
|
20456
|
+
React$2.useEffect(()=>{
|
|
23250
20457
|
setValue('');
|
|
23251
20458
|
setPassString('');
|
|
23252
20459
|
},[]);
|
|
@@ -23390,14 +20597,14 @@ const NothingContent$4 = styled.div`
|
|
|
23390
20597
|
const _jsxFileName$k = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\PaymentMethodsTable\\PaymentMethods.tsx";
|
|
23391
20598
|
const PaymentMethodsTable = (props) => {
|
|
23392
20599
|
const {methods,callback,srchActive} = props;
|
|
23393
|
-
const [currentPage,setCurrentPage] =
|
|
23394
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
23395
|
-
const [dispMethods,setDispMethods] =
|
|
23396
|
-
const [dispMethodsori,setDispMethodsori] =
|
|
23397
|
-
const [displayContent,setDisplayContent] =
|
|
23398
|
-
const [sortDir,setSortDir] =
|
|
23399
|
-
|
|
23400
|
-
|
|
20600
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
20601
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
20602
|
+
const [dispMethods,setDispMethods] = React$2.useState([]);
|
|
20603
|
+
const [dispMethodsori,setDispMethodsori] = React$2.useState(methods);
|
|
20604
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
20605
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
20606
|
+
|
|
20607
|
+
React$2.useEffect(()=>{
|
|
23401
20608
|
//pagination
|
|
23402
20609
|
if (dispMethodsori.length > 0){
|
|
23403
20610
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -23410,14 +20617,14 @@ const PaymentMethodsTable = (props) => {
|
|
|
23410
20617
|
setDisplayContent(true);
|
|
23411
20618
|
},[dispMethodsori,currentPage]);
|
|
23412
20619
|
|
|
23413
|
-
|
|
20620
|
+
React$2.useEffect(()=>{
|
|
23414
20621
|
setDispMethodsori(methods.sort((a,b) => {
|
|
23415
20622
|
if(a.pymtModeName < b.pymtModeName) return -1
|
|
23416
20623
|
return 1
|
|
23417
20624
|
}));
|
|
23418
20625
|
},[methods]);
|
|
23419
20626
|
|
|
23420
|
-
|
|
20627
|
+
React$2.useEffect(()=>{
|
|
23421
20628
|
if (srchActive) setCurrentPage(1);
|
|
23422
20629
|
},[srchActive]);
|
|
23423
20630
|
|
|
@@ -23600,14 +20807,14 @@ const NothingContent$3 = styled.div`
|
|
|
23600
20807
|
const _jsxFileName$j = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\ProvidersTable\\ProvidersTable.tsx";
|
|
23601
20808
|
const ProvidersTable = (props) => {
|
|
23602
20809
|
const {providers,callback,srchActive} = props;
|
|
23603
|
-
const [currentPage,setCurrentPage] =
|
|
23604
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
23605
|
-
const [dispProvs,setDispProvs] =
|
|
23606
|
-
const [dispProvsOri,setDispProvsOri] =
|
|
23607
|
-
const [displayContent,setDisplayContent] =
|
|
23608
|
-
const [sortDir,setSortDir] =
|
|
23609
|
-
|
|
23610
|
-
|
|
20810
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
20811
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
20812
|
+
const [dispProvs,setDispProvs] = React$2.useState([]);
|
|
20813
|
+
const [dispProvsOri,setDispProvsOri] = React$2.useState(providers);
|
|
20814
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
20815
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
20816
|
+
|
|
20817
|
+
React$2.useEffect(()=>{
|
|
23611
20818
|
//pagination
|
|
23612
20819
|
if (dispProvsOri.length > 0){
|
|
23613
20820
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -23620,14 +20827,14 @@ const ProvidersTable = (props) => {
|
|
|
23620
20827
|
setDisplayContent(true);
|
|
23621
20828
|
},[dispProvsOri,currentPage]);
|
|
23622
20829
|
|
|
23623
|
-
|
|
20830
|
+
React$2.useEffect(()=>{
|
|
23624
20831
|
setDispProvsOri(providers.sort((a,b) => {
|
|
23625
20832
|
if(a.name < b.name) return -1
|
|
23626
20833
|
return 1
|
|
23627
20834
|
}));
|
|
23628
20835
|
},[providers]);
|
|
23629
20836
|
|
|
23630
|
-
|
|
20837
|
+
React$2.useEffect(()=>{
|
|
23631
20838
|
if (srchActive) setCurrentPage(1);
|
|
23632
20839
|
},[srchActive]);
|
|
23633
20840
|
|
|
@@ -23972,7 +21179,7 @@ const TextField = (props) => {
|
|
|
23972
21179
|
|
|
23973
21180
|
const [borderColor,setBorderColor] = React$2.useState('');
|
|
23974
21181
|
const [err,setErr] = React$2.useState(false);
|
|
23975
|
-
const textFieldRef =
|
|
21182
|
+
const textFieldRef = React$2.useRef();
|
|
23976
21183
|
|
|
23977
21184
|
function validate(){
|
|
23978
21185
|
if (value){
|
|
@@ -24020,15 +21227,15 @@ const _jsxFileName$g = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
24020
21227
|
|
|
24021
21228
|
const RequestForm = (props) => {
|
|
24022
21229
|
const {symbols,currencies,returnedData} = props;
|
|
24023
|
-
const [selSymbol,setSelSymbol] =
|
|
24024
|
-
const [qty,setQty] =
|
|
24025
|
-
const [baseCurrency,setBaseCurrency] =
|
|
24026
|
-
const [price,setPrice] =
|
|
21230
|
+
const [selSymbol,setSelSymbol] = React$2.useState({});
|
|
21231
|
+
const [qty,setQty] = React$2.useState('');
|
|
21232
|
+
const [baseCurrency,setBaseCurrency] = React$2.useState({});
|
|
21233
|
+
const [price,setPrice] = React$2.useState('');
|
|
24027
21234
|
|
|
24028
|
-
const [fmtdSymbl,setFmtdSymbl] =
|
|
24029
|
-
const [fmtdCurr,setFmtdCurr] =
|
|
21235
|
+
const [fmtdSymbl,setFmtdSymbl] = React$2.useState([]);
|
|
21236
|
+
const [fmtdCurr,setFmtdCurr] = React$2.useState([]);
|
|
24030
21237
|
|
|
24031
|
-
|
|
21238
|
+
React$2.useEffect(()=>{
|
|
24032
21239
|
let tempFmtd = [];
|
|
24033
21240
|
symbols.forEach((symbol) => {
|
|
24034
21241
|
let temp = {
|
|
@@ -24042,7 +21249,7 @@ const RequestForm = (props) => {
|
|
|
24042
21249
|
setFmtdSymbl(tempFmtd);
|
|
24043
21250
|
},[symbols]);
|
|
24044
21251
|
|
|
24045
|
-
|
|
21252
|
+
React$2.useEffect(()=>{
|
|
24046
21253
|
let tempFmtd = [];
|
|
24047
21254
|
currencies.forEach((currency) => {
|
|
24048
21255
|
let temp = {
|
|
@@ -24449,7 +21656,7 @@ function ___$insertStyle(css) {
|
|
|
24449
21656
|
|
|
24450
21657
|
Object.defineProperty(dist, '__esModule', { value: true });
|
|
24451
21658
|
|
|
24452
|
-
var React$1 =
|
|
21659
|
+
var React$1 = React$2;
|
|
24453
21660
|
|
|
24454
21661
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24455
21662
|
|
|
@@ -24737,14 +21944,14 @@ const NothingContent$2 = styled.div`
|
|
|
24737
21944
|
const _jsxFileName$9 = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\SystemConfigTable\\SystemConfigTable.tsx";
|
|
24738
21945
|
const SystemConfigTable = (props) => {
|
|
24739
21946
|
const {configs,callback,srchActive} = props;
|
|
24740
|
-
const [currentPage,setCurrentPage] =
|
|
24741
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
24742
|
-
const [dispConfigs,setDispConfigs] =
|
|
24743
|
-
const [dispConfigsOri,setDispConfigsOri] =
|
|
24744
|
-
const [displayContent,setDisplayContent] =
|
|
24745
|
-
const [sortDir,setSortDir] =
|
|
24746
|
-
|
|
24747
|
-
|
|
21947
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
21948
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
21949
|
+
const [dispConfigs,setDispConfigs] = React$2.useState([]);
|
|
21950
|
+
const [dispConfigsOri,setDispConfigsOri] = React$2.useState(configs);
|
|
21951
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
21952
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
21953
|
+
|
|
21954
|
+
React$2.useEffect(()=>{
|
|
24748
21955
|
//pagination
|
|
24749
21956
|
if (dispConfigsOri.length > 0){
|
|
24750
21957
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -24757,14 +21964,14 @@ const SystemConfigTable = (props) => {
|
|
|
24757
21964
|
setDisplayContent(true);
|
|
24758
21965
|
},[dispConfigsOri,currentPage]);
|
|
24759
21966
|
|
|
24760
|
-
|
|
21967
|
+
React$2.useEffect(()=>{
|
|
24761
21968
|
setDispConfigsOri(configs.sort((a,b) => {
|
|
24762
21969
|
if(a.configName < b.configName) return -1
|
|
24763
21970
|
return 1
|
|
24764
21971
|
}));
|
|
24765
21972
|
},[configs]);
|
|
24766
21973
|
|
|
24767
|
-
|
|
21974
|
+
React$2.useEffect(()=>{
|
|
24768
21975
|
if (srchActive) setCurrentPage(1);
|
|
24769
21976
|
},[srchActive]);
|
|
24770
21977
|
|
|
@@ -24956,22 +22163,22 @@ function ChevronDownIcon({
|
|
|
24956
22163
|
titleId,
|
|
24957
22164
|
...props
|
|
24958
22165
|
}, svgRef) {
|
|
24959
|
-
return /*#__PURE__*/
|
|
22166
|
+
return /*#__PURE__*/React__namespace.createElement("svg", Object.assign({
|
|
24960
22167
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24961
22168
|
viewBox: "0 0 24 24",
|
|
24962
22169
|
fill: "currentColor",
|
|
24963
22170
|
"aria-hidden": "true",
|
|
24964
22171
|
ref: svgRef,
|
|
24965
22172
|
"aria-labelledby": titleId
|
|
24966
|
-
}, props), title ? /*#__PURE__*/
|
|
22173
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
24967
22174
|
id: titleId
|
|
24968
|
-
}, title) : null, /*#__PURE__*/
|
|
22175
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
24969
22176
|
fillRule: "evenodd",
|
|
24970
22177
|
d: "M12.53 16.28a.75.75 0 01-1.06 0l-7.5-7.5a.75.75 0 011.06-1.06L12 14.69l6.97-6.97a.75.75 0 111.06 1.06l-7.5 7.5z",
|
|
24971
22178
|
clipRule: "evenodd"
|
|
24972
22179
|
}));
|
|
24973
22180
|
}
|
|
24974
|
-
const ForwardRef$1 =
|
|
22181
|
+
const ForwardRef$1 = React__namespace.forwardRef(ChevronDownIcon);
|
|
24975
22182
|
var ChevronDownIcon$1 = ForwardRef$1;
|
|
24976
22183
|
|
|
24977
22184
|
function XMarkIcon({
|
|
@@ -24979,22 +22186,22 @@ function XMarkIcon({
|
|
|
24979
22186
|
titleId,
|
|
24980
22187
|
...props
|
|
24981
22188
|
}, svgRef) {
|
|
24982
|
-
return /*#__PURE__*/
|
|
22189
|
+
return /*#__PURE__*/React__namespace.createElement("svg", Object.assign({
|
|
24983
22190
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24984
22191
|
viewBox: "0 0 24 24",
|
|
24985
22192
|
fill: "currentColor",
|
|
24986
22193
|
"aria-hidden": "true",
|
|
24987
22194
|
ref: svgRef,
|
|
24988
22195
|
"aria-labelledby": titleId
|
|
24989
|
-
}, props), title ? /*#__PURE__*/
|
|
22196
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
24990
22197
|
id: titleId
|
|
24991
|
-
}, title) : null, /*#__PURE__*/
|
|
22198
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
24992
22199
|
fillRule: "evenodd",
|
|
24993
22200
|
d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",
|
|
24994
22201
|
clipRule: "evenodd"
|
|
24995
22202
|
}));
|
|
24996
22203
|
}
|
|
24997
|
-
const ForwardRef =
|
|
22204
|
+
const ForwardRef = React__namespace.forwardRef(XMarkIcon);
|
|
24998
22205
|
var XMarkIcon$1 = ForwardRef;
|
|
24999
22206
|
|
|
25000
22207
|
const _jsxFileName$8 = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\Table\\table.tsx";//create react component
|
|
@@ -25013,18 +22220,18 @@ const Table$2 = (props) => {
|
|
|
25013
22220
|
hasSearch = false,
|
|
25014
22221
|
formatData,
|
|
25015
22222
|
} = props;
|
|
25016
|
-
const [dataToShow, setDataToShow] =
|
|
25017
|
-
const [allData, setAllData] =
|
|
25018
|
-
const [currentPage, setCurrentPage] =
|
|
25019
|
-
const [itemsPerPage, setItemsPerPage] =
|
|
25020
|
-
const [search, setSearch] =
|
|
25021
|
-
const [selectedColumn, setSelectedColumn] =
|
|
25022
|
-
const [searchResults, setSearchResults] =
|
|
25023
|
-
const [refresh, setRefresh] =
|
|
25024
|
-
const [secondaryColumns, setSecondaryColumns] =
|
|
22223
|
+
const [dataToShow, setDataToShow] = React__namespace.useState([]);
|
|
22224
|
+
const [allData, setAllData] = React__namespace.useState([]);
|
|
22225
|
+
const [currentPage, setCurrentPage] = React__namespace.useState(1);
|
|
22226
|
+
const [itemsPerPage, setItemsPerPage] = React__namespace.useState(10);
|
|
22227
|
+
const [search, setSearch] = React__namespace.useState("");
|
|
22228
|
+
const [selectedColumn, setSelectedColumn] = React__namespace.useState("");
|
|
22229
|
+
const [searchResults, setSearchResults] = React__namespace.useState([]);
|
|
22230
|
+
const [refresh, setRefresh] = React__namespace.useState(false);
|
|
22231
|
+
const [secondaryColumns, setSecondaryColumns] = React__namespace.useState
|
|
25025
22232
|
|
|
25026
22233
|
([]);
|
|
25027
|
-
const [rowsToExpand, setRowsToExpand] =
|
|
22234
|
+
const [rowsToExpand, setRowsToExpand] = React__namespace.useState([]);
|
|
25028
22235
|
|
|
25029
22236
|
const rowClick = function (row) {
|
|
25030
22237
|
if (onRowClick) {
|
|
@@ -25045,7 +22252,7 @@ const Table$2 = (props) => {
|
|
|
25045
22252
|
setCurrentPage(page);
|
|
25046
22253
|
};
|
|
25047
22254
|
|
|
25048
|
-
|
|
22255
|
+
React__namespace.useEffect(() => {
|
|
25049
22256
|
if (searchResults.length > 0) {
|
|
25050
22257
|
setDataToShow(
|
|
25051
22258
|
searchResults.slice(
|
|
@@ -25062,7 +22269,7 @@ const Table$2 = (props) => {
|
|
|
25062
22269
|
setDataToShow(y);
|
|
25063
22270
|
}, [currentPage]);
|
|
25064
22271
|
|
|
25065
|
-
|
|
22272
|
+
React__namespace.useEffect(() => {
|
|
25066
22273
|
let y = allData.slice(
|
|
25067
22274
|
(currentPage - 1) * itemsPerPage,
|
|
25068
22275
|
currentPage * itemsPerPage
|
|
@@ -25107,21 +22314,21 @@ const Table$2 = (props) => {
|
|
|
25107
22314
|
setCurrentPage(1);
|
|
25108
22315
|
};
|
|
25109
22316
|
|
|
25110
|
-
|
|
22317
|
+
React__namespace.useEffect(() => {
|
|
25111
22318
|
if (search) {
|
|
25112
22319
|
setDataToShow(searchResults.slice(0, itemsPerPage));
|
|
25113
22320
|
}
|
|
25114
22321
|
}, [searchResults]);
|
|
25115
22322
|
|
|
25116
|
-
|
|
22323
|
+
React__namespace.useEffect(() => {
|
|
25117
22324
|
setDataToShow(allData.slice(0, itemsPerPage));
|
|
25118
22325
|
}, [secondaryColumns]);
|
|
25119
22326
|
|
|
25120
|
-
|
|
22327
|
+
React__namespace.useEffect(() => {
|
|
25121
22328
|
onSearchChange(search);
|
|
25122
22329
|
}, [search]);
|
|
25123
22330
|
|
|
25124
|
-
|
|
22331
|
+
React__namespace.useEffect(() => {
|
|
25125
22332
|
// check if itemsPerPage is a number
|
|
25126
22333
|
if (itemsPerPageProp) {
|
|
25127
22334
|
setItemsPerPage(itemsPerPageProp);
|
|
@@ -25130,7 +22337,7 @@ const Table$2 = (props) => {
|
|
|
25130
22337
|
}
|
|
25131
22338
|
}, []);
|
|
25132
22339
|
|
|
25133
|
-
|
|
22340
|
+
React__namespace.useEffect(() => {
|
|
25134
22341
|
getData(data, config)
|
|
25135
22342
|
.then((data) => {
|
|
25136
22343
|
if (formatData) {
|
|
@@ -25165,13 +22372,13 @@ const Table$2 = (props) => {
|
|
|
25165
22372
|
|
|
25166
22373
|
// console.log(dataToShow);
|
|
25167
22374
|
return (
|
|
25168
|
-
|
|
25169
|
-
,
|
|
25170
|
-
,
|
|
22375
|
+
React__namespace.createElement('div', { className: "s-data-table", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 178}}
|
|
22376
|
+
, React__namespace.createElement('div', { className: "s-data-table_header", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 179}}
|
|
22377
|
+
, React__namespace.createElement('h5', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 180}}, title)
|
|
25171
22378
|
/* search input for table */
|
|
25172
22379
|
, hasSearch && (
|
|
25173
|
-
|
|
25174
|
-
,
|
|
22380
|
+
React__namespace.createElement('div', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 183}}
|
|
22381
|
+
, React__namespace.createElement('input', {
|
|
25175
22382
|
type: "text",
|
|
25176
22383
|
value: search,
|
|
25177
22384
|
placeholder: "Search",
|
|
@@ -25180,7 +22387,7 @@ const Table$2 = (props) => {
|
|
|
25180
22387
|
}, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 184}}
|
|
25181
22388
|
)
|
|
25182
22389
|
, search && (
|
|
25183
|
-
|
|
22390
|
+
React__namespace.createElement(XMarkIcon$1, {
|
|
25184
22391
|
onClick: clearSearchData,
|
|
25185
22392
|
className: "s-datatable-icon", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 193}}
|
|
25186
22393
|
)
|
|
@@ -25188,14 +22395,14 @@ const Table$2 = (props) => {
|
|
|
25188
22395
|
)
|
|
25189
22396
|
)
|
|
25190
22397
|
)
|
|
25191
|
-
,
|
|
25192
|
-
,
|
|
25193
|
-
,
|
|
22398
|
+
, React__namespace.createElement(TableStyled, {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 201}}
|
|
22399
|
+
, React__namespace.createElement('thead', { className: "s-data-table_head h-[66px]" , __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 202}}
|
|
22400
|
+
, React__namespace.createElement('tr', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 203}}
|
|
25194
22401
|
, secondaryColumns &&
|
|
25195
22402
|
secondaryColumns.length > 0 &&
|
|
25196
22403
|
secondaryColumns.map((column, index) => {
|
|
25197
22404
|
return (
|
|
25198
|
-
|
|
22405
|
+
React__namespace.createElement('th', {
|
|
25199
22406
|
style: {
|
|
25200
22407
|
width: column.width
|
|
25201
22408
|
? column.width
|
|
@@ -25211,11 +22418,11 @@ const Table$2 = (props) => {
|
|
|
25211
22418
|
setSelectedColumn(column.field);
|
|
25212
22419
|
}, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 208}}
|
|
25213
22420
|
|
|
25214
|
-
,
|
|
25215
|
-
,
|
|
25216
|
-
,
|
|
22421
|
+
, React__namespace.createElement('div', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 224}}
|
|
22422
|
+
, React__namespace.createElement('span', { className: "text-white", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 225}}, column.title)
|
|
22423
|
+
, React__namespace.createElement('span', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 226}}
|
|
25217
22424
|
, column.sortable && (
|
|
25218
|
-
|
|
22425
|
+
React__namespace.createElement(ChevronDownIcon$1, { className: "s-datatable-icon", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 228}} )
|
|
25219
22426
|
)
|
|
25220
22427
|
)
|
|
25221
22428
|
)
|
|
@@ -25224,13 +22431,13 @@ const Table$2 = (props) => {
|
|
|
25224
22431
|
})
|
|
25225
22432
|
)
|
|
25226
22433
|
)
|
|
25227
|
-
,
|
|
22434
|
+
, React__namespace.createElement('tbody', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 237}}
|
|
25228
22435
|
, dataToShow &&
|
|
25229
22436
|
dataToShow.length > 0 &&
|
|
25230
22437
|
dataToShow.map((item, index) => {
|
|
25231
22438
|
return (
|
|
25232
|
-
|
|
25233
|
-
,
|
|
22439
|
+
React__namespace.createElement(React__namespace.Fragment, null
|
|
22440
|
+
, React__namespace.createElement('tr', {
|
|
25234
22441
|
className: "h-[62px]",
|
|
25235
22442
|
style: { cursor: onRowClick ? "pointer" : "" },
|
|
25236
22443
|
onClick: () => rowClick(item),
|
|
@@ -25238,7 +22445,7 @@ const Table$2 = (props) => {
|
|
|
25238
22445
|
|
|
25239
22446
|
, secondaryColumns.map((column, index) => {
|
|
25240
22447
|
return (
|
|
25241
|
-
|
|
22448
|
+
React__namespace.createElement('td', { className: "font-semibold", key: index, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 251}}
|
|
25242
22449
|
, item[column.field]
|
|
25243
22450
|
)
|
|
25244
22451
|
);
|
|
@@ -25248,9 +22455,9 @@ const Table$2 = (props) => {
|
|
|
25248
22455
|
rowsToExpand.length > 0 &&
|
|
25249
22456
|
rowsToExpand.indexOf(item.id) > -1 &&
|
|
25250
22457
|
onRowExpandComponent && (
|
|
25251
|
-
|
|
25252
|
-
,
|
|
25253
|
-
,
|
|
22458
|
+
React__namespace.createElement('tr', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 261}}
|
|
22459
|
+
, React__namespace.createElement('td', { colSpan: secondaryColumns.length, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 262}}
|
|
22460
|
+
, React__namespace.createElement('div', { key: index, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 263}}, onRowExpandComponent(item))
|
|
25254
22461
|
)
|
|
25255
22462
|
)
|
|
25256
22463
|
)
|
|
@@ -25258,16 +22465,16 @@ const Table$2 = (props) => {
|
|
|
25258
22465
|
);
|
|
25259
22466
|
})
|
|
25260
22467
|
, dataToShow && dataToShow.length === 0 && (
|
|
25261
|
-
|
|
25262
|
-
,
|
|
22468
|
+
React__namespace.createElement('tr', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 271}}
|
|
22469
|
+
, React__namespace.createElement('td', { colSpan: columns.length, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 272}}, "No data found" )
|
|
25263
22470
|
)
|
|
25264
22471
|
)
|
|
25265
22472
|
)
|
|
25266
|
-
,
|
|
25267
|
-
,
|
|
25268
|
-
,
|
|
25269
|
-
,
|
|
25270
|
-
,
|
|
22473
|
+
, React__namespace.createElement('tfoot', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 276}}
|
|
22474
|
+
, React__namespace.createElement('tr', {__self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 277}}
|
|
22475
|
+
, React__namespace.createElement('td', { colSpan: columns.length, __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 278}}
|
|
22476
|
+
, React__namespace.createElement('div', { className: "s-datatable-foot_summary w-full flex" , __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 279}}
|
|
22477
|
+
, React__namespace.createElement('button', {
|
|
25271
22478
|
onClick: () => {
|
|
25272
22479
|
goToPrevious();
|
|
25273
22480
|
},
|
|
@@ -25275,27 +22482,27 @@ const Table$2 = (props) => {
|
|
|
25275
22482
|
className: "bg-white p-1 rounded-sm" , __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 280}}
|
|
25276
22483
|
|
|
25277
22484
|
, currentPage == 1 ? (
|
|
25278
|
-
|
|
22485
|
+
React__namespace.createElement('svg', {
|
|
25279
22486
|
width: "24",
|
|
25280
22487
|
height: "24",
|
|
25281
22488
|
viewBox: "0 0 24 24" ,
|
|
25282
22489
|
fill: "none",
|
|
25283
22490
|
xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 288}}
|
|
25284
22491
|
|
|
25285
|
-
,
|
|
22492
|
+
, React__namespace.createElement('path', {
|
|
25286
22493
|
d: "M11.29 12L14.83 8.46001C15.0163 8.27265 15.1208 8.0192 15.1208 7.75501C15.1208 7.49082 15.0163 7.23737 14.83 7.05001C14.737 6.95628 14.6264 6.88189 14.5046 6.83112C14.3827 6.78035 14.252 6.75421 14.12 6.75421C13.988 6.75421 13.8573 6.78035 13.7354 6.83112C13.6136 6.88189 13.503 6.95628 13.41 7.05001L9.17 11.29C9.07628 11.383 9.00188 11.4936 8.95111 11.6154C8.90035 11.7373 8.87421 11.868 8.87421 12C8.87421 12.132 8.90035 12.2627 8.95111 12.3846C9.00188 12.5064 9.07628 12.617 9.17 12.71L13.41 17C13.5034 17.0927 13.6143 17.166 13.7361 17.2158C13.8579 17.2655 13.9884 17.2908 14.12 17.29C14.2516 17.2908 14.3821 17.2655 14.5039 17.2158C14.6257 17.166 14.7366 17.0927 14.83 17C15.0163 16.8126 15.1208 16.5592 15.1208 16.295C15.1208 16.0308 15.0163 15.7774 14.83 15.59L11.29 12Z" ,
|
|
25287
22494
|
fill: "#E8EEF7", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 295}}
|
|
25288
22495
|
)
|
|
25289
22496
|
)
|
|
25290
22497
|
) : (
|
|
25291
|
-
|
|
22498
|
+
React__namespace.createElement('svg', {
|
|
25292
22499
|
width: "24",
|
|
25293
22500
|
height: "24",
|
|
25294
22501
|
viewBox: "0 0 24 24" ,
|
|
25295
22502
|
fill: "none",
|
|
25296
22503
|
xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 301}}
|
|
25297
22504
|
|
|
25298
|
-
,
|
|
22505
|
+
, React__namespace.createElement('path', {
|
|
25299
22506
|
d: "M11.29 12L14.83 8.46001C15.0163 8.27265 15.1208 8.0192 15.1208 7.75501C15.1208 7.49082 15.0163 7.23737 14.83 7.05001C14.737 6.95628 14.6264 6.88189 14.5046 6.83112C14.3827 6.78035 14.252 6.75421 14.12 6.75421C13.988 6.75421 13.8573 6.78035 13.7354 6.83112C13.6136 6.88189 13.503 6.95628 13.41 7.05001L9.17 11.29C9.07628 11.383 9.00188 11.4936 8.95111 11.6154C8.90035 11.7373 8.87421 11.868 8.87421 12C8.87421 12.132 8.90035 12.2627 8.95111 12.3846C9.00188 12.5064 9.07628 12.617 9.17 12.71L13.41 17C13.5034 17.0927 13.6143 17.166 13.7361 17.2158C13.8579 17.2655 13.9884 17.2908 14.12 17.29C14.2516 17.2908 14.3821 17.2655 14.5039 17.2158C14.6257 17.166 14.7366 17.0927 14.83 17C15.0163 16.8126 15.1208 16.5592 15.1208 16.295C15.1208 16.0308 15.0163 15.7774 14.83 15.59L11.29 12Z" ,
|
|
25300
22507
|
fill: "#070B12", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 308}}
|
|
25301
22508
|
)
|
|
@@ -25315,7 +22522,7 @@ const Table$2 = (props) => {
|
|
|
25315
22522
|
return null;
|
|
25316
22523
|
}
|
|
25317
22524
|
return (
|
|
25318
|
-
|
|
22525
|
+
React__namespace.createElement('button', {
|
|
25319
22526
|
key: item,
|
|
25320
22527
|
onClick: () => {
|
|
25321
22528
|
goToPage(item);
|
|
@@ -25330,7 +22537,7 @@ const Table$2 = (props) => {
|
|
|
25330
22537
|
)
|
|
25331
22538
|
);
|
|
25332
22539
|
})
|
|
25333
|
-
,
|
|
22540
|
+
, React__namespace.createElement('button', {
|
|
25334
22541
|
onClick: () => {
|
|
25335
22542
|
goToNext();
|
|
25336
22543
|
},
|
|
@@ -25340,27 +22547,27 @@ const Table$2 = (props) => {
|
|
|
25340
22547
|
className: "bg-white p-1 rounded-sm" , __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 343}}
|
|
25341
22548
|
|
|
25342
22549
|
, currentPage == Math.ceil(allData.length / itemsPerPage) ? (
|
|
25343
|
-
|
|
22550
|
+
React__namespace.createElement('svg', {
|
|
25344
22551
|
width: "24",
|
|
25345
22552
|
height: "24",
|
|
25346
22553
|
viewBox: "0 0 24 24" ,
|
|
25347
22554
|
fill: "none",
|
|
25348
22555
|
xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 353}}
|
|
25349
22556
|
|
|
25350
|
-
,
|
|
22557
|
+
, React__namespace.createElement('path', {
|
|
25351
22558
|
d: "M14.83 11.29L10.59 7.05001C10.497 6.95628 10.3864 6.88189 10.2646 6.83112C10.1427 6.78035 10.012 6.75421 9.88 6.75421C9.74799 6.75421 9.61729 6.78035 9.49543 6.83112C9.37357 6.88189 9.26297 6.95628 9.17 7.05001C8.98375 7.23737 8.87921 7.49082 8.87921 7.75501C8.87921 8.0192 8.98375 8.27265 9.17 8.46001L12.71 12L9.17 15.54C8.98375 15.7274 8.87921 15.9808 8.87921 16.245C8.87921 16.5092 8.98375 16.7626 9.17 16.95C9.26344 17.0427 9.37426 17.116 9.4961 17.1658C9.61794 17.2155 9.7484 17.2408 9.88 17.24C10.0116 17.2408 10.1421 17.2155 10.2639 17.1658C10.3857 17.116 10.4966 17.0427 10.59 16.95L14.83 12.71C14.9237 12.617 14.9981 12.5064 15.0489 12.3846C15.0997 12.2627 15.1258 12.132 15.1258 12C15.1258 11.868 15.0997 11.7373 15.0489 11.6154C14.9981 11.4936 14.9237 11.383 14.83 11.29Z" ,
|
|
25352
22559
|
fill: "#E8EEF7", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 360}}
|
|
25353
22560
|
)
|
|
25354
22561
|
)
|
|
25355
22562
|
) : (
|
|
25356
|
-
|
|
22563
|
+
React__namespace.createElement('svg', {
|
|
25357
22564
|
width: "24",
|
|
25358
22565
|
height: "24",
|
|
25359
22566
|
viewBox: "0 0 24 24" ,
|
|
25360
22567
|
fill: "none",
|
|
25361
22568
|
xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 366}}
|
|
25362
22569
|
|
|
25363
|
-
,
|
|
22570
|
+
, React__namespace.createElement('path', {
|
|
25364
22571
|
d: "M14.83 11.29L10.59 7.05001C10.497 6.95628 10.3864 6.88189 10.2646 6.83112C10.1427 6.78035 10.012 6.75421 9.88 6.75421C9.74799 6.75421 9.61729 6.78035 9.49543 6.83112C9.37357 6.88189 9.26297 6.95628 9.17 7.05001C8.98375 7.23737 8.87921 7.49082 8.87921 7.75501C8.87921 8.0192 8.98375 8.27265 9.17 8.46001L12.71 12L9.17 15.54C8.98375 15.7274 8.87921 15.9808 8.87921 16.245C8.87921 16.5092 8.98375 16.7626 9.17 16.95C9.26344 17.0427 9.37426 17.116 9.4961 17.1658C9.61794 17.2155 9.7484 17.2408 9.88 17.24C10.0116 17.2408 10.1421 17.2155 10.2639 17.1658C10.3857 17.116 10.4966 17.0427 10.59 16.95L14.83 12.71C14.9237 12.617 14.9981 12.5064 15.0489 12.3846C15.0997 12.2627 15.1258 12.132 15.1258 12C15.1258 11.868 15.0997 11.7373 15.0489 11.6154C14.9981 11.4936 14.9237 11.383 14.83 11.29Z" ,
|
|
25365
22572
|
fill: "#070B12", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 373}}
|
|
25366
22573
|
)
|
|
@@ -25371,7 +22578,7 @@ const Table$2 = (props) => {
|
|
|
25371
22578
|
{dataToShow.length * currentPage} of {allData.length - 1}
|
|
25372
22579
|
</span> */
|
|
25373
22580
|
)
|
|
25374
|
-
,
|
|
22581
|
+
, React__namespace.createElement('div', { className: "s-datable-foot_pagination", __self: undefined, __source: {fileName: _jsxFileName$8, lineNumber: 384}}
|
|
25375
22582
|
|
|
25376
22583
|
)
|
|
25377
22584
|
)
|
|
@@ -25461,9 +22668,9 @@ const TextArea = (props) => {
|
|
|
25461
22668
|
let {label,subtext,errMsg,disabled,required,value} = props;
|
|
25462
22669
|
|
|
25463
22670
|
// const [value,setValue]:any = useState('')
|
|
25464
|
-
const [borderColor,setBorderColor] =
|
|
25465
|
-
const [err,setErr] =
|
|
25466
|
-
const textFieldRef =
|
|
22671
|
+
const [borderColor,setBorderColor] = React$2.useState('');
|
|
22672
|
+
const [err,setErr] = React$2.useState(false);
|
|
22673
|
+
const textFieldRef = React$2.useRef();
|
|
25467
22674
|
|
|
25468
22675
|
function validate(){
|
|
25469
22676
|
if (value){
|
|
@@ -25866,15 +23073,15 @@ const _jsxFileName$4 = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
25866
23073
|
|
|
25867
23074
|
const UpdateUserActions$1 = (props) => {
|
|
25868
23075
|
const {currentOptions,availableOptions,selOptions,titleAvailable,titleCurrent} = props;
|
|
25869
|
-
const [available,setAvailable] =
|
|
25870
|
-
const [currentUserOptions,setCurrentUserOptions] =
|
|
25871
|
-
const [selections,setSelections] =
|
|
23076
|
+
const [available,setAvailable] = React$2.useState(availableOptions);
|
|
23077
|
+
const [currentUserOptions,setCurrentUserOptions] = React$2.useState(currentOptions);
|
|
23078
|
+
const [selections,setSelections] = React$2.useState({added:[],removed:[]});
|
|
25872
23079
|
|
|
25873
|
-
|
|
23080
|
+
React$2.useEffect(()=>{
|
|
25874
23081
|
selOptions(selections);
|
|
25875
23082
|
},[]);
|
|
25876
23083
|
|
|
25877
|
-
|
|
23084
|
+
React$2.useEffect(()=>{
|
|
25878
23085
|
const actionsListContainer = document.querySelectorAll('.actionsList');
|
|
25879
23086
|
actionsListContainer.forEach((container)=>{
|
|
25880
23087
|
container.addEventListener('mouseover',function(){
|
|
@@ -26118,16 +23325,16 @@ const _jsxFileName$3 = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
|
|
|
26118
23325
|
|
|
26119
23326
|
const UpdateUserActions = (props) => {
|
|
26120
23327
|
const {currentOptions,availableOptions,supplementaryOptions,selOptions,titleAvailable,titleCurrent} = props;
|
|
26121
|
-
const [available,setAvailable] =
|
|
26122
|
-
const [supOptions,setSupOptions] =
|
|
26123
|
-
const [currentUserOptions,setCurrentUserOptions] =
|
|
26124
|
-
const [selections,setSelections] =
|
|
23328
|
+
const [available,setAvailable] = React$2.useState(availableOptions);
|
|
23329
|
+
const [supOptions,setSupOptions] = React$2.useState(supplementaryOptions);
|
|
23330
|
+
const [currentUserOptions,setCurrentUserOptions] = React$2.useState(currentOptions);
|
|
23331
|
+
const [selections,setSelections] = React$2.useState({added:[],removed:[]});
|
|
26125
23332
|
|
|
26126
|
-
|
|
23333
|
+
React$2.useEffect(()=>{
|
|
26127
23334
|
selOptions(selections);
|
|
26128
23335
|
},[]);
|
|
26129
23336
|
|
|
26130
|
-
|
|
23337
|
+
React$2.useEffect(()=>{
|
|
26131
23338
|
const actionsListContainer = document.querySelectorAll('.actionsList');
|
|
26132
23339
|
actionsListContainer.forEach((container)=>{
|
|
26133
23340
|
container.addEventListener('mouseover',function(){
|
|
@@ -26364,14 +23571,14 @@ const NothingContent$1 = styled.div`
|
|
|
26364
23571
|
const _jsxFileName$2 = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\UserRolesTable\\UserRolesTable.tsx";
|
|
26365
23572
|
const UserRolesTable = (props) => {
|
|
26366
23573
|
const {roles,callback,srchActive} = props;
|
|
26367
|
-
const [currentPage,setCurrentPage] =
|
|
26368
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
26369
|
-
const [dispRoles,setDispRoles] =
|
|
26370
|
-
const [dispRolesOri,setDispRolesOri] =
|
|
26371
|
-
const [displayContent,setDisplayContent] =
|
|
26372
|
-
const [sortDir,setSortDir] =
|
|
26373
|
-
|
|
26374
|
-
|
|
23574
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
23575
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
23576
|
+
const [dispRoles,setDispRoles] = React$2.useState([]);
|
|
23577
|
+
const [dispRolesOri,setDispRolesOri] = React$2.useState(roles);
|
|
23578
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
23579
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
23580
|
+
|
|
23581
|
+
React$2.useEffect(()=>{
|
|
26375
23582
|
//pagination
|
|
26376
23583
|
if (dispRolesOri.length > 0){
|
|
26377
23584
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -26384,14 +23591,14 @@ const UserRolesTable = (props) => {
|
|
|
26384
23591
|
setDisplayContent(true);
|
|
26385
23592
|
},[dispRolesOri,currentPage]);
|
|
26386
23593
|
|
|
26387
|
-
|
|
23594
|
+
React$2.useEffect(()=>{
|
|
26388
23595
|
setDispRolesOri(roles.sort((a,b) => {
|
|
26389
23596
|
if(a.roleName < b.roleName) return -1
|
|
26390
23597
|
return 1
|
|
26391
23598
|
}));
|
|
26392
23599
|
},[roles]);
|
|
26393
23600
|
|
|
26394
|
-
|
|
23601
|
+
React$2.useEffect(()=>{
|
|
26395
23602
|
if (srchActive) setCurrentPage(1);
|
|
26396
23603
|
},[srchActive]);
|
|
26397
23604
|
|
|
@@ -26573,14 +23780,14 @@ const NothingContent = styled.div`
|
|
|
26573
23780
|
const _jsxFileName$1 = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\components\\UsersTable\\UsersTable.tsx";
|
|
26574
23781
|
const UsersTable = (props) => {
|
|
26575
23782
|
const {users,callback,srchActive} = props;
|
|
26576
|
-
const [currentPage,setCurrentPage] =
|
|
26577
|
-
const [itemsPerPage,setItemsPerPage] =
|
|
26578
|
-
const [dispUsers,setDispUsers] =
|
|
26579
|
-
const [dispUsersOri,setDispUsersOri] =
|
|
26580
|
-
const [displayContent,setDisplayContent] =
|
|
26581
|
-
const [sortDir,setSortDir] =
|
|
26582
|
-
|
|
26583
|
-
|
|
23783
|
+
const [currentPage,setCurrentPage] = React$2.useState(1);
|
|
23784
|
+
const [itemsPerPage,setItemsPerPage] = React$2.useState(10);
|
|
23785
|
+
const [dispUsers,setDispUsers] = React$2.useState([]);
|
|
23786
|
+
const [dispUsersOri,setDispUsersOri] = React$2.useState(users);
|
|
23787
|
+
const [displayContent,setDisplayContent] = React$2.useState(false); //for handling the display of page content after data is available
|
|
23788
|
+
const [sortDir,setSortDir] = React$2.useState('desc');
|
|
23789
|
+
|
|
23790
|
+
React$2.useEffect(()=>{
|
|
26584
23791
|
//pagination
|
|
26585
23792
|
if (dispUsersOri.length > 0){
|
|
26586
23793
|
const lastItemIndex = currentPage * itemsPerPage;
|
|
@@ -26593,14 +23800,14 @@ const UsersTable = (props) => {
|
|
|
26593
23800
|
setDisplayContent(true);
|
|
26594
23801
|
},[dispUsersOri,currentPage]);
|
|
26595
23802
|
|
|
26596
|
-
|
|
23803
|
+
React$2.useEffect(()=>{
|
|
26597
23804
|
setDispUsersOri(users.sort((a,b) => {
|
|
26598
23805
|
if(a.name < b.name) return -1
|
|
26599
23806
|
return 1
|
|
26600
23807
|
}));
|
|
26601
23808
|
},[users]);
|
|
26602
23809
|
|
|
26603
|
-
|
|
23810
|
+
React$2.useEffect(()=>{
|
|
26604
23811
|
if (srchActive) setCurrentPage(1);
|
|
26605
23812
|
},[srchActive]);
|
|
26606
23813
|
|