seeder-st2110-components 1.0.6 → 1.1.1
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.esm.js +1126 -1088
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1126 -1088
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -724,117 +724,19 @@ var reactIs_production_min = {};
|
|
|
724
724
|
* This source code is licensed under the MIT license found in the
|
|
725
725
|
* LICENSE file in the root directory of this source tree.
|
|
726
726
|
*/
|
|
727
|
+
|
|
727
728
|
var hasRequiredReactIs_production_min;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
l = b ? Symbol.for("react.async_mode") : 60111,
|
|
740
|
-
m = b ? Symbol.for("react.concurrent_mode") : 60111,
|
|
741
|
-
n = b ? Symbol.for("react.forward_ref") : 60112,
|
|
742
|
-
p = b ? Symbol.for("react.suspense") : 60113,
|
|
743
|
-
q = b ? Symbol.for("react.suspense_list") : 60120,
|
|
744
|
-
r = b ? Symbol.for("react.memo") : 60115,
|
|
745
|
-
t = b ? Symbol.for("react.lazy") : 60116,
|
|
746
|
-
v = b ? Symbol.for("react.block") : 60121,
|
|
747
|
-
w = b ? Symbol.for("react.fundamental") : 60117,
|
|
748
|
-
x = b ? Symbol.for("react.responder") : 60118,
|
|
749
|
-
y = b ? Symbol.for("react.scope") : 60119;
|
|
750
|
-
function z(a) {
|
|
751
|
-
if ("object" === typeof a && null !== a) {
|
|
752
|
-
var u = a.$$typeof;
|
|
753
|
-
switch (u) {
|
|
754
|
-
case c:
|
|
755
|
-
switch (a = a.type, a) {
|
|
756
|
-
case l:
|
|
757
|
-
case m:
|
|
758
|
-
case e:
|
|
759
|
-
case g:
|
|
760
|
-
case f:
|
|
761
|
-
case p:
|
|
762
|
-
return a;
|
|
763
|
-
default:
|
|
764
|
-
switch (a = a && a.$$typeof, a) {
|
|
765
|
-
case k:
|
|
766
|
-
case n:
|
|
767
|
-
case t:
|
|
768
|
-
case r:
|
|
769
|
-
case h:
|
|
770
|
-
return a;
|
|
771
|
-
default:
|
|
772
|
-
return u;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
case d:
|
|
776
|
-
return u;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
function A(a) {
|
|
781
|
-
return z(a) === m;
|
|
782
|
-
}
|
|
783
|
-
reactIs_production_min.AsyncMode = l;
|
|
784
|
-
reactIs_production_min.ConcurrentMode = m;
|
|
785
|
-
reactIs_production_min.ContextConsumer = k;
|
|
786
|
-
reactIs_production_min.ContextProvider = h;
|
|
787
|
-
reactIs_production_min.Element = c;
|
|
788
|
-
reactIs_production_min.ForwardRef = n;
|
|
789
|
-
reactIs_production_min.Fragment = e;
|
|
790
|
-
reactIs_production_min.Lazy = t;
|
|
791
|
-
reactIs_production_min.Memo = r;
|
|
792
|
-
reactIs_production_min.Portal = d;
|
|
793
|
-
reactIs_production_min.Profiler = g;
|
|
794
|
-
reactIs_production_min.StrictMode = f;
|
|
795
|
-
reactIs_production_min.Suspense = p;
|
|
796
|
-
reactIs_production_min.isAsyncMode = function (a) {
|
|
797
|
-
return A(a) || z(a) === l;
|
|
798
|
-
};
|
|
799
|
-
reactIs_production_min.isConcurrentMode = A;
|
|
800
|
-
reactIs_production_min.isContextConsumer = function (a) {
|
|
801
|
-
return z(a) === k;
|
|
802
|
-
};
|
|
803
|
-
reactIs_production_min.isContextProvider = function (a) {
|
|
804
|
-
return z(a) === h;
|
|
805
|
-
};
|
|
806
|
-
reactIs_production_min.isElement = function (a) {
|
|
807
|
-
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
808
|
-
};
|
|
809
|
-
reactIs_production_min.isForwardRef = function (a) {
|
|
810
|
-
return z(a) === n;
|
|
811
|
-
};
|
|
812
|
-
reactIs_production_min.isFragment = function (a) {
|
|
813
|
-
return z(a) === e;
|
|
814
|
-
};
|
|
815
|
-
reactIs_production_min.isLazy = function (a) {
|
|
816
|
-
return z(a) === t;
|
|
817
|
-
};
|
|
818
|
-
reactIs_production_min.isMemo = function (a) {
|
|
819
|
-
return z(a) === r;
|
|
820
|
-
};
|
|
821
|
-
reactIs_production_min.isPortal = function (a) {
|
|
822
|
-
return z(a) === d;
|
|
823
|
-
};
|
|
824
|
-
reactIs_production_min.isProfiler = function (a) {
|
|
825
|
-
return z(a) === g;
|
|
826
|
-
};
|
|
827
|
-
reactIs_production_min.isStrictMode = function (a) {
|
|
828
|
-
return z(a) === f;
|
|
829
|
-
};
|
|
830
|
-
reactIs_production_min.isSuspense = function (a) {
|
|
831
|
-
return z(a) === p;
|
|
832
|
-
};
|
|
833
|
-
reactIs_production_min.isValidElementType = function (a) {
|
|
834
|
-
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
835
|
-
};
|
|
836
|
-
reactIs_production_min.typeOf = z;
|
|
837
|
-
return reactIs_production_min;
|
|
729
|
+
|
|
730
|
+
function requireReactIs_production_min () {
|
|
731
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
732
|
+
hasRequiredReactIs_production_min = 1;
|
|
733
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
734
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
735
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
736
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
737
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
738
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
739
|
+
return reactIs_production_min;
|
|
838
740
|
}
|
|
839
741
|
|
|
840
742
|
var reactIs_development = {};
|
|
@@ -847,179 +749,197 @@ var reactIs_development = {};
|
|
|
847
749
|
* This source code is licensed under the MIT license found in the
|
|
848
750
|
* LICENSE file in the root directory of this source tree.
|
|
849
751
|
*/
|
|
752
|
+
|
|
850
753
|
var hasRequiredReactIs_development;
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
754
|
+
|
|
755
|
+
function requireReactIs_development () {
|
|
756
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
757
|
+
hasRequiredReactIs_development = 1;
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
if (process.env.NODE_ENV !== "production") {
|
|
762
|
+
(function() {
|
|
763
|
+
|
|
764
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
765
|
+
// nor polyfill, then a plain number is used for performance.
|
|
766
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
767
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
768
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
769
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
770
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
771
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
772
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
773
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
774
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
775
|
+
|
|
776
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
777
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
778
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
779
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
780
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
781
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
782
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
783
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
784
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
785
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
786
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
787
|
+
|
|
788
|
+
function isValidElementType(type) {
|
|
789
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
790
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
function typeOf(object) {
|
|
794
|
+
if (typeof object === 'object' && object !== null) {
|
|
795
|
+
var $$typeof = object.$$typeof;
|
|
796
|
+
|
|
797
|
+
switch ($$typeof) {
|
|
798
|
+
case REACT_ELEMENT_TYPE:
|
|
799
|
+
var type = object.type;
|
|
800
|
+
|
|
801
|
+
switch (type) {
|
|
802
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
803
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
804
|
+
case REACT_FRAGMENT_TYPE:
|
|
805
|
+
case REACT_PROFILER_TYPE:
|
|
806
|
+
case REACT_STRICT_MODE_TYPE:
|
|
807
|
+
case REACT_SUSPENSE_TYPE:
|
|
808
|
+
return type;
|
|
809
|
+
|
|
810
|
+
default:
|
|
811
|
+
var $$typeofType = type && type.$$typeof;
|
|
812
|
+
|
|
813
|
+
switch ($$typeofType) {
|
|
814
|
+
case REACT_CONTEXT_TYPE:
|
|
815
|
+
case REACT_FORWARD_REF_TYPE:
|
|
816
|
+
case REACT_LAZY_TYPE:
|
|
817
|
+
case REACT_MEMO_TYPE:
|
|
818
|
+
case REACT_PROVIDER_TYPE:
|
|
819
|
+
return $$typeofType;
|
|
820
|
+
|
|
821
|
+
default:
|
|
822
|
+
return $$typeof;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
case REACT_PORTAL_TYPE:
|
|
828
|
+
return $$typeof;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
return undefined;
|
|
833
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
834
|
+
|
|
835
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
836
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
837
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
838
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
839
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
840
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
841
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
842
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
843
|
+
var Memo = REACT_MEMO_TYPE;
|
|
844
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
845
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
846
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
847
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
848
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
849
|
+
|
|
850
|
+
function isAsyncMode(object) {
|
|
851
|
+
{
|
|
852
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
853
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
854
|
+
|
|
855
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
860
|
+
}
|
|
861
|
+
function isConcurrentMode(object) {
|
|
862
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
863
|
+
}
|
|
864
|
+
function isContextConsumer(object) {
|
|
865
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
866
|
+
}
|
|
867
|
+
function isContextProvider(object) {
|
|
868
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
869
|
+
}
|
|
870
|
+
function isElement(object) {
|
|
871
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
872
|
+
}
|
|
873
|
+
function isForwardRef(object) {
|
|
874
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
875
|
+
}
|
|
876
|
+
function isFragment(object) {
|
|
877
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
878
|
+
}
|
|
879
|
+
function isLazy(object) {
|
|
880
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
881
|
+
}
|
|
882
|
+
function isMemo(object) {
|
|
883
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
884
|
+
}
|
|
885
|
+
function isPortal(object) {
|
|
886
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
887
|
+
}
|
|
888
|
+
function isProfiler(object) {
|
|
889
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
890
|
+
}
|
|
891
|
+
function isStrictMode(object) {
|
|
892
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
893
|
+
}
|
|
894
|
+
function isSuspense(object) {
|
|
895
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
899
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
900
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
901
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
902
|
+
reactIs_development.Element = Element;
|
|
903
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
904
|
+
reactIs_development.Fragment = Fragment;
|
|
905
|
+
reactIs_development.Lazy = Lazy;
|
|
906
|
+
reactIs_development.Memo = Memo;
|
|
907
|
+
reactIs_development.Portal = Portal;
|
|
908
|
+
reactIs_development.Profiler = Profiler;
|
|
909
|
+
reactIs_development.StrictMode = StrictMode;
|
|
910
|
+
reactIs_development.Suspense = Suspense;
|
|
911
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
912
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
913
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
914
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
915
|
+
reactIs_development.isElement = isElement;
|
|
916
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
917
|
+
reactIs_development.isFragment = isFragment;
|
|
918
|
+
reactIs_development.isLazy = isLazy;
|
|
919
|
+
reactIs_development.isMemo = isMemo;
|
|
920
|
+
reactIs_development.isPortal = isPortal;
|
|
921
|
+
reactIs_development.isProfiler = isProfiler;
|
|
922
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
923
|
+
reactIs_development.isSuspense = isSuspense;
|
|
924
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
925
|
+
reactIs_development.typeOf = typeOf;
|
|
926
|
+
})();
|
|
927
|
+
}
|
|
928
|
+
return reactIs_development;
|
|
1011
929
|
}
|
|
1012
930
|
|
|
1013
931
|
var hasRequiredReactIs;
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
932
|
+
|
|
933
|
+
function requireReactIs () {
|
|
934
|
+
if (hasRequiredReactIs) return reactIs.exports;
|
|
935
|
+
hasRequiredReactIs = 1;
|
|
936
|
+
|
|
937
|
+
if (process.env.NODE_ENV === 'production') {
|
|
938
|
+
reactIs.exports = requireReactIs_production_min();
|
|
939
|
+
} else {
|
|
940
|
+
reactIs.exports = requireReactIs_development();
|
|
941
|
+
}
|
|
942
|
+
return reactIs.exports;
|
|
1023
943
|
}
|
|
1024
944
|
|
|
1025
945
|
/*
|
|
@@ -1027,85 +947,97 @@ object-assign
|
|
|
1027
947
|
(c) Sindre Sorhus
|
|
1028
948
|
@license MIT
|
|
1029
949
|
*/
|
|
950
|
+
|
|
1030
951
|
var objectAssign;
|
|
1031
952
|
var hasRequiredObjectAssign;
|
|
1032
|
-
function requireObjectAssign() {
|
|
1033
|
-
if (hasRequiredObjectAssign) return objectAssign;
|
|
1034
|
-
hasRequiredObjectAssign = 1;
|
|
1035
|
-
/* eslint-disable no-unused-vars */
|
|
1036
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
1037
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1038
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1039
|
-
function toObject(val) {
|
|
1040
|
-
if (val === null || val === undefined) {
|
|
1041
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
1042
|
-
}
|
|
1043
|
-
return Object(val);
|
|
1044
|
-
}
|
|
1045
|
-
function shouldUseNative() {
|
|
1046
|
-
try {
|
|
1047
|
-
if (!Object.assign) {
|
|
1048
|
-
return false;
|
|
1049
|
-
}
|
|
1050
953
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
954
|
+
function requireObjectAssign () {
|
|
955
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
956
|
+
hasRequiredObjectAssign = 1;
|
|
957
|
+
/* eslint-disable no-unused-vars */
|
|
958
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
959
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
960
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
961
|
+
|
|
962
|
+
function toObject(val) {
|
|
963
|
+
if (val === null || val === undefined) {
|
|
964
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
return Object(val);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
function shouldUseNative() {
|
|
971
|
+
try {
|
|
972
|
+
if (!Object.assign) {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
977
|
+
|
|
978
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
979
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
980
|
+
test1[5] = 'de';
|
|
981
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
982
|
+
return false;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
986
|
+
var test2 = {};
|
|
987
|
+
for (var i = 0; i < 10; i++) {
|
|
988
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
989
|
+
}
|
|
990
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
991
|
+
return test2[n];
|
|
992
|
+
});
|
|
993
|
+
if (order2.join('') !== '0123456789') {
|
|
994
|
+
return false;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
998
|
+
var test3 = {};
|
|
999
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
1000
|
+
test3[letter] = letter;
|
|
1001
|
+
});
|
|
1002
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
1003
|
+
'abcdefghijklmnopqrst') {
|
|
1004
|
+
return false;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
return true;
|
|
1008
|
+
} catch (err) {
|
|
1009
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
1010
|
+
return false;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
1015
|
+
var from;
|
|
1016
|
+
var to = toObject(target);
|
|
1017
|
+
var symbols;
|
|
1018
|
+
|
|
1019
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
1020
|
+
from = Object(arguments[s]);
|
|
1021
|
+
|
|
1022
|
+
for (var key in from) {
|
|
1023
|
+
if (hasOwnProperty.call(from, key)) {
|
|
1024
|
+
to[key] = from[key];
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
if (getOwnPropertySymbols) {
|
|
1029
|
+
symbols = getOwnPropertySymbols(from);
|
|
1030
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
1031
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
1032
|
+
to[symbols[i]] = from[symbols[i]];
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
return to;
|
|
1039
|
+
};
|
|
1040
|
+
return objectAssign;
|
|
1109
1041
|
}
|
|
1110
1042
|
|
|
1111
1043
|
/**
|
|
@@ -1114,23 +1046,28 @@ function requireObjectAssign() {
|
|
|
1114
1046
|
* This source code is licensed under the MIT license found in the
|
|
1115
1047
|
* LICENSE file in the root directory of this source tree.
|
|
1116
1048
|
*/
|
|
1049
|
+
|
|
1117
1050
|
var ReactPropTypesSecret_1;
|
|
1118
1051
|
var hasRequiredReactPropTypesSecret;
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1052
|
+
|
|
1053
|
+
function requireReactPropTypesSecret () {
|
|
1054
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
1055
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
1056
|
+
|
|
1057
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
1058
|
+
|
|
1059
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
1060
|
+
return ReactPropTypesSecret_1;
|
|
1125
1061
|
}
|
|
1126
1062
|
|
|
1127
1063
|
var has;
|
|
1128
1064
|
var hasRequiredHas;
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1065
|
+
|
|
1066
|
+
function requireHas () {
|
|
1067
|
+
if (hasRequiredHas) return has;
|
|
1068
|
+
hasRequiredHas = 1;
|
|
1069
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1070
|
+
return has;
|
|
1134
1071
|
}
|
|
1135
1072
|
|
|
1136
1073
|
/**
|
|
@@ -1139,88 +1076,109 @@ function requireHas() {
|
|
|
1139
1076
|
* This source code is licensed under the MIT license found in the
|
|
1140
1077
|
* LICENSE file in the root directory of this source tree.
|
|
1141
1078
|
*/
|
|
1079
|
+
|
|
1142
1080
|
var checkPropTypes_1;
|
|
1143
1081
|
var hasRequiredCheckPropTypes;
|
|
1144
|
-
function requireCheckPropTypes() {
|
|
1145
|
-
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
1146
|
-
hasRequiredCheckPropTypes = 1;
|
|
1147
|
-
var printWarning = function () {};
|
|
1148
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1149
|
-
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
1150
|
-
var loggedTypeFailures = {};
|
|
1151
|
-
var has = /*@__PURE__*/requireHas();
|
|
1152
|
-
printWarning = function (text) {
|
|
1153
|
-
var message = 'Warning: ' + text;
|
|
1154
|
-
if (typeof console !== 'undefined') {
|
|
1155
|
-
console.error(message);
|
|
1156
|
-
}
|
|
1157
|
-
try {
|
|
1158
|
-
// --- Welcome to debugging React ---
|
|
1159
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
1160
|
-
// to find the callsite that caused this warning to fire.
|
|
1161
|
-
throw new Error(message);
|
|
1162
|
-
} catch (x) {/**/}
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
1082
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1083
|
+
function requireCheckPropTypes () {
|
|
1084
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
1085
|
+
hasRequiredCheckPropTypes = 1;
|
|
1086
|
+
|
|
1087
|
+
var printWarning = function() {};
|
|
1088
|
+
|
|
1089
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1090
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
1091
|
+
var loggedTypeFailures = {};
|
|
1092
|
+
var has = /*@__PURE__*/ requireHas();
|
|
1093
|
+
|
|
1094
|
+
printWarning = function(text) {
|
|
1095
|
+
var message = 'Warning: ' + text;
|
|
1096
|
+
if (typeof console !== 'undefined') {
|
|
1097
|
+
console.error(message);
|
|
1098
|
+
}
|
|
1099
|
+
try {
|
|
1100
|
+
// --- Welcome to debugging React ---
|
|
1101
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
1102
|
+
// to find the callsite that caused this warning to fire.
|
|
1103
|
+
throw new Error(message);
|
|
1104
|
+
} catch (x) { /**/ }
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Assert that the values match with the type specs.
|
|
1110
|
+
* Error messages are memorized and will only be shown once.
|
|
1111
|
+
*
|
|
1112
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
1113
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
1114
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
1115
|
+
* @param {string} componentName Name of the component for error messages.
|
|
1116
|
+
* @param {?Function} getStack Returns the component stack.
|
|
1117
|
+
* @private
|
|
1118
|
+
*/
|
|
1119
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
1120
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1121
|
+
for (var typeSpecName in typeSpecs) {
|
|
1122
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
1123
|
+
var error;
|
|
1124
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
1125
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
1126
|
+
// After these have been cleaned up, we'll let them throw.
|
|
1127
|
+
try {
|
|
1128
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
1129
|
+
// behavior as without this statement except with a better message.
|
|
1130
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
1131
|
+
var err = Error(
|
|
1132
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
1133
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
1134
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
1135
|
+
);
|
|
1136
|
+
err.name = 'Invariant Violation';
|
|
1137
|
+
throw err;
|
|
1138
|
+
}
|
|
1139
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
1140
|
+
} catch (ex) {
|
|
1141
|
+
error = ex;
|
|
1142
|
+
}
|
|
1143
|
+
if (error && !(error instanceof Error)) {
|
|
1144
|
+
printWarning(
|
|
1145
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
1146
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
1147
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
1148
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
1149
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
1150
|
+
'shape all require an argument).'
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
1154
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
1155
|
+
// same error.
|
|
1156
|
+
loggedTypeFailures[error.message] = true;
|
|
1157
|
+
|
|
1158
|
+
var stack = getStack ? getStack() : '';
|
|
1159
|
+
|
|
1160
|
+
printWarning(
|
|
1161
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Resets warning cache when testing.
|
|
1171
|
+
*
|
|
1172
|
+
* @private
|
|
1173
|
+
*/
|
|
1174
|
+
checkPropTypes.resetWarningCache = function() {
|
|
1175
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1176
|
+
loggedTypeFailures = {};
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
checkPropTypes_1 = checkPropTypes;
|
|
1181
|
+
return checkPropTypes_1;
|
|
1224
1182
|
}
|
|
1225
1183
|
|
|
1226
1184
|
/**
|
|
@@ -1229,551 +1187,616 @@ function requireCheckPropTypes() {
|
|
|
1229
1187
|
* This source code is licensed under the MIT license found in the
|
|
1230
1188
|
* LICENSE file in the root directory of this source tree.
|
|
1231
1189
|
*/
|
|
1190
|
+
|
|
1232
1191
|
var factoryWithTypeCheckers;
|
|
1233
1192
|
var hasRequiredFactoryWithTypeCheckers;
|
|
1234
|
-
function requireFactoryWithTypeCheckers() {
|
|
1235
|
-
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
1236
|
-
hasRequiredFactoryWithTypeCheckers = 1;
|
|
1237
|
-
var ReactIs = requireReactIs();
|
|
1238
|
-
var assign = requireObjectAssign();
|
|
1239
|
-
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
1240
|
-
var has = /*@__PURE__*/requireHas();
|
|
1241
|
-
var checkPropTypes = /*@__PURE__*/requireCheckPropTypes();
|
|
1242
|
-
var printWarning = function () {};
|
|
1243
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1244
|
-
printWarning = function (text) {
|
|
1245
|
-
var message = 'Warning: ' + text;
|
|
1246
|
-
if (typeof console !== 'undefined') {
|
|
1247
|
-
console.error(message);
|
|
1248
|
-
}
|
|
1249
|
-
try {
|
|
1250
|
-
// --- Welcome to debugging React ---
|
|
1251
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
1252
|
-
// to find the callsite that caused this warning to fire.
|
|
1253
|
-
throw new Error(message);
|
|
1254
|
-
} catch (x) {}
|
|
1255
|
-
};
|
|
1256
|
-
}
|
|
1257
|
-
function emptyFunctionThatReturnsNull() {
|
|
1258
|
-
return null;
|
|
1259
|
-
}
|
|
1260
|
-
factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) {
|
|
1261
|
-
/* global Symbol */
|
|
1262
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
1263
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* Returns the iterator method function contained on the iterable object.
|
|
1267
|
-
*
|
|
1268
|
-
* Be sure to invoke the function with the iterable as context:
|
|
1269
|
-
*
|
|
1270
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
|
1271
|
-
* if (iteratorFn) {
|
|
1272
|
-
* var iterator = iteratorFn.call(myIterable);
|
|
1273
|
-
* ...
|
|
1274
|
-
* }
|
|
1275
|
-
*
|
|
1276
|
-
* @param {?object} maybeIterable
|
|
1277
|
-
* @return {?function}
|
|
1278
|
-
*/
|
|
1279
|
-
function getIteratorFn(maybeIterable) {
|
|
1280
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
1281
|
-
if (typeof iteratorFn === 'function') {
|
|
1282
|
-
return iteratorFn;
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
/**
|
|
1287
|
-
* Collection of methods that allow declaration and validation of props that are
|
|
1288
|
-
* supplied to React components. Example usage:
|
|
1289
|
-
*
|
|
1290
|
-
* var Props = require('ReactPropTypes');
|
|
1291
|
-
* var MyArticle = React.createClass({
|
|
1292
|
-
* propTypes: {
|
|
1293
|
-
* // An optional string prop named "description".
|
|
1294
|
-
* description: Props.string,
|
|
1295
|
-
*
|
|
1296
|
-
* // A required enum prop named "category".
|
|
1297
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
1298
|
-
*
|
|
1299
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
|
1300
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
|
1301
|
-
* },
|
|
1302
|
-
* render: function() { ... }
|
|
1303
|
-
* });
|
|
1304
|
-
*
|
|
1305
|
-
* A more formal specification of how these methods are used:
|
|
1306
|
-
*
|
|
1307
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
1308
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
1309
|
-
*
|
|
1310
|
-
* Each and every declaration produces a function with the same signature. This
|
|
1311
|
-
* allows the creation of custom validation functions. For example:
|
|
1312
|
-
*
|
|
1313
|
-
* var MyLink = React.createClass({
|
|
1314
|
-
* propTypes: {
|
|
1315
|
-
* // An optional string or URI prop named "href".
|
|
1316
|
-
* href: function(props, propName, componentName) {
|
|
1317
|
-
* var propValue = props[propName];
|
|
1318
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
|
1319
|
-
* !(propValue instanceof URI)) {
|
|
1320
|
-
* return new Error(
|
|
1321
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
1322
|
-
* componentName
|
|
1323
|
-
* );
|
|
1324
|
-
* }
|
|
1325
|
-
* }
|
|
1326
|
-
* },
|
|
1327
|
-
* render: function() {...}
|
|
1328
|
-
* });
|
|
1329
|
-
*
|
|
1330
|
-
* @internal
|
|
1331
|
-
*/
|
|
1332
|
-
|
|
1333
|
-
var ANONYMOUS = '<<anonymous>>';
|
|
1334
|
-
|
|
1335
|
-
// Important!
|
|
1336
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
1337
|
-
var ReactPropTypes = {
|
|
1338
|
-
array: createPrimitiveTypeChecker('array'),
|
|
1339
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
1340
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
|
1341
|
-
func: createPrimitiveTypeChecker('function'),
|
|
1342
|
-
number: createPrimitiveTypeChecker('number'),
|
|
1343
|
-
object: createPrimitiveTypeChecker('object'),
|
|
1344
|
-
string: createPrimitiveTypeChecker('string'),
|
|
1345
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
|
1346
|
-
any: createAnyTypeChecker(),
|
|
1347
|
-
arrayOf: createArrayOfTypeChecker,
|
|
1348
|
-
element: createElementTypeChecker(),
|
|
1349
|
-
elementType: createElementTypeTypeChecker(),
|
|
1350
|
-
instanceOf: createInstanceTypeChecker,
|
|
1351
|
-
node: createNodeChecker(),
|
|
1352
|
-
objectOf: createObjectOfTypeChecker,
|
|
1353
|
-
oneOf: createEnumTypeChecker,
|
|
1354
|
-
oneOfType: createUnionTypeChecker,
|
|
1355
|
-
shape: createShapeTypeChecker,
|
|
1356
|
-
exact: createStrictShapeTypeChecker
|
|
1357
|
-
};
|
|
1358
|
-
|
|
1359
|
-
/**
|
|
1360
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
1361
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1362
|
-
*/
|
|
1363
|
-
/*eslint-disable no-self-compare*/
|
|
1364
|
-
function is(x, y) {
|
|
1365
|
-
// SameValue algorithm
|
|
1366
|
-
if (x === y) {
|
|
1367
|
-
// Steps 1-5, 7-10
|
|
1368
|
-
// Steps 6.b-6.e: +0 != -0
|
|
1369
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
1370
|
-
} else {
|
|
1371
|
-
// Step 6.a: NaN == NaN
|
|
1372
|
-
return x !== x && y !== y;
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
/*eslint-enable no-self-compare*/
|
|
1376
|
-
|
|
1377
|
-
/**
|
|
1378
|
-
* We use an Error-like object for backward compatibility as people may call
|
|
1379
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
|
1380
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
1381
|
-
* is prohibitively expensive if they are created too often, such as what
|
|
1382
|
-
* happens in oneOfType() for any type before the one that matched.
|
|
1383
|
-
*/
|
|
1384
|
-
function PropTypeError(message, data) {
|
|
1385
|
-
this.message = message;
|
|
1386
|
-
this.data = data && typeof data === 'object' ? data : {};
|
|
1387
|
-
this.stack = '';
|
|
1388
|
-
}
|
|
1389
|
-
// Make `instanceof Error` still work for returned errors.
|
|
1390
|
-
PropTypeError.prototype = Error.prototype;
|
|
1391
|
-
function createChainableTypeChecker(validate) {
|
|
1392
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1393
|
-
var manualPropTypeCallCache = {};
|
|
1394
|
-
var manualPropTypeWarningCount = 0;
|
|
1395
|
-
}
|
|
1396
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
1397
|
-
componentName = componentName || ANONYMOUS;
|
|
1398
|
-
propFullName = propFullName || propName;
|
|
1399
|
-
if (secret !== ReactPropTypesSecret) {
|
|
1400
|
-
if (throwOnDirectAccess) {
|
|
1401
|
-
// New behavior only for users of `prop-types` package
|
|
1402
|
-
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
1403
|
-
err.name = 'Invariant Violation';
|
|
1404
|
-
throw err;
|
|
1405
|
-
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
1406
|
-
// Old behavior for people using React.PropTypes
|
|
1407
|
-
var cacheKey = componentName + ':' + propName;
|
|
1408
|
-
if (!manualPropTypeCallCache[cacheKey] &&
|
|
1409
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
1410
|
-
manualPropTypeWarningCount < 3) {
|
|
1411
|
-
printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
|
|
1412
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
1413
|
-
manualPropTypeWarningCount++;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
if (props[propName] == null) {
|
|
1418
|
-
if (isRequired) {
|
|
1419
|
-
if (props[propName] === null) {
|
|
1420
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
1421
|
-
}
|
|
1422
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
1423
|
-
}
|
|
1424
|
-
return null;
|
|
1425
|
-
} else {
|
|
1426
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
1430
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
1431
|
-
return chainedCheckType;
|
|
1432
|
-
}
|
|
1433
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
1434
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
1435
|
-
var propValue = props[propName];
|
|
1436
|
-
var propType = getPropType(propValue);
|
|
1437
|
-
if (propType !== expectedType) {
|
|
1438
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
1439
|
-
// check, but we can offer a more precise error message here rather than
|
|
1440
|
-
// 'of type `object`'.
|
|
1441
|
-
var preciseType = getPreciseType(propValue);
|
|
1442
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
|
|
1443
|
-
expectedType: expectedType
|
|
1444
|
-
});
|
|
1445
|
-
}
|
|
1446
|
-
return null;
|
|
1447
|
-
}
|
|
1448
|
-
return createChainableTypeChecker(validate);
|
|
1449
|
-
}
|
|
1450
|
-
function createAnyTypeChecker() {
|
|
1451
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
1452
|
-
}
|
|
1453
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
1454
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1455
|
-
if (typeof typeChecker !== 'function') {
|
|
1456
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
1457
|
-
}
|
|
1458
|
-
var propValue = props[propName];
|
|
1459
|
-
if (!Array.isArray(propValue)) {
|
|
1460
|
-
var propType = getPropType(propValue);
|
|
1461
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
1462
|
-
}
|
|
1463
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
1464
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
1465
|
-
if (error instanceof Error) {
|
|
1466
|
-
return error;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
return null;
|
|
1470
|
-
}
|
|
1471
|
-
return createChainableTypeChecker(validate);
|
|
1472
|
-
}
|
|
1473
|
-
function createElementTypeChecker() {
|
|
1474
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1475
|
-
var propValue = props[propName];
|
|
1476
|
-
if (!isValidElement(propValue)) {
|
|
1477
|
-
var propType = getPropType(propValue);
|
|
1478
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
1479
|
-
}
|
|
1480
|
-
return null;
|
|
1481
|
-
}
|
|
1482
|
-
return createChainableTypeChecker(validate);
|
|
1483
|
-
}
|
|
1484
|
-
function createElementTypeTypeChecker() {
|
|
1485
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1486
|
-
var propValue = props[propName];
|
|
1487
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
1488
|
-
var propType = getPropType(propValue);
|
|
1489
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
1490
|
-
}
|
|
1491
|
-
return null;
|
|
1492
|
-
}
|
|
1493
|
-
return createChainableTypeChecker(validate);
|
|
1494
|
-
}
|
|
1495
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
1496
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1497
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
1498
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
1499
|
-
var actualClassName = getClassName(props[propName]);
|
|
1500
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
1501
|
-
}
|
|
1502
|
-
return null;
|
|
1503
|
-
}
|
|
1504
|
-
return createChainableTypeChecker(validate);
|
|
1505
|
-
}
|
|
1506
|
-
function createEnumTypeChecker(expectedValues) {
|
|
1507
|
-
if (!Array.isArray(expectedValues)) {
|
|
1508
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1509
|
-
if (arguments.length > 1) {
|
|
1510
|
-
printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
|
|
1511
|
-
} else {
|
|
1512
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
return emptyFunctionThatReturnsNull;
|
|
1516
|
-
}
|
|
1517
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1518
|
-
var propValue = props[propName];
|
|
1519
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
1520
|
-
if (is(propValue, expectedValues[i])) {
|
|
1521
|
-
return null;
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
1525
|
-
var type = getPreciseType(value);
|
|
1526
|
-
if (type === 'symbol') {
|
|
1527
|
-
return String(value);
|
|
1528
|
-
}
|
|
1529
|
-
return value;
|
|
1530
|
-
});
|
|
1531
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
1532
|
-
}
|
|
1533
|
-
return createChainableTypeChecker(validate);
|
|
1534
|
-
}
|
|
1535
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
1536
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1537
|
-
if (typeof typeChecker !== 'function') {
|
|
1538
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
1539
|
-
}
|
|
1540
|
-
var propValue = props[propName];
|
|
1541
|
-
var propType = getPropType(propValue);
|
|
1542
|
-
if (propType !== 'object') {
|
|
1543
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
1544
|
-
}
|
|
1545
|
-
for (var key in propValue) {
|
|
1546
|
-
if (has(propValue, key)) {
|
|
1547
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1548
|
-
if (error instanceof Error) {
|
|
1549
|
-
return error;
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
return null;
|
|
1554
|
-
}
|
|
1555
|
-
return createChainableTypeChecker(validate);
|
|
1556
|
-
}
|
|
1557
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
1558
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
1559
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
1560
|
-
return emptyFunctionThatReturnsNull;
|
|
1561
|
-
}
|
|
1562
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1563
|
-
var checker = arrayOfTypeCheckers[i];
|
|
1564
|
-
if (typeof checker !== 'function') {
|
|
1565
|
-
printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
|
1566
|
-
return emptyFunctionThatReturnsNull;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1570
|
-
var expectedTypes = [];
|
|
1571
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1572
|
-
var checker = arrayOfTypeCheckers[i];
|
|
1573
|
-
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
1574
|
-
if (checkerResult == null) {
|
|
1575
|
-
return null;
|
|
1576
|
-
}
|
|
1577
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
1578
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
|
|
1582
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
1583
|
-
}
|
|
1584
|
-
return createChainableTypeChecker(validate);
|
|
1585
|
-
}
|
|
1586
|
-
function createNodeChecker() {
|
|
1587
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1588
|
-
if (!isNode(props[propName])) {
|
|
1589
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
1590
|
-
}
|
|
1591
|
-
return null;
|
|
1592
|
-
}
|
|
1593
|
-
return createChainableTypeChecker(validate);
|
|
1594
|
-
}
|
|
1595
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
1596
|
-
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
|
|
1597
|
-
}
|
|
1598
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
1599
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1600
|
-
var propValue = props[propName];
|
|
1601
|
-
var propType = getPropType(propValue);
|
|
1602
|
-
if (propType !== 'object') {
|
|
1603
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1604
|
-
}
|
|
1605
|
-
for (var key in shapeTypes) {
|
|
1606
|
-
var checker = shapeTypes[key];
|
|
1607
|
-
if (typeof checker !== 'function') {
|
|
1608
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1609
|
-
}
|
|
1610
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1611
|
-
if (error) {
|
|
1612
|
-
return error;
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
return null;
|
|
1616
|
-
}
|
|
1617
|
-
return createChainableTypeChecker(validate);
|
|
1618
|
-
}
|
|
1619
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
1620
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1621
|
-
var propValue = props[propName];
|
|
1622
|
-
var propType = getPropType(propValue);
|
|
1623
|
-
if (propType !== 'object') {
|
|
1624
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1625
|
-
}
|
|
1626
|
-
// We need to check all keys in case some are required but missing from props.
|
|
1627
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
1628
|
-
for (var key in allKeys) {
|
|
1629
|
-
var checker = shapeTypes[key];
|
|
1630
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
1631
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1632
|
-
}
|
|
1633
|
-
if (!checker) {
|
|
1634
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
|
|
1635
|
-
}
|
|
1636
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1637
|
-
if (error) {
|
|
1638
|
-
return error;
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
return null;
|
|
1642
|
-
}
|
|
1643
|
-
return createChainableTypeChecker(validate);
|
|
1644
|
-
}
|
|
1645
|
-
function isNode(propValue) {
|
|
1646
|
-
switch (typeof propValue) {
|
|
1647
|
-
case 'number':
|
|
1648
|
-
case 'string':
|
|
1649
|
-
case 'undefined':
|
|
1650
|
-
return true;
|
|
1651
|
-
case 'boolean':
|
|
1652
|
-
return !propValue;
|
|
1653
|
-
case 'object':
|
|
1654
|
-
if (Array.isArray(propValue)) {
|
|
1655
|
-
return propValue.every(isNode);
|
|
1656
|
-
}
|
|
1657
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
1658
|
-
return true;
|
|
1659
|
-
}
|
|
1660
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
1661
|
-
if (iteratorFn) {
|
|
1662
|
-
var iterator = iteratorFn.call(propValue);
|
|
1663
|
-
var step;
|
|
1664
|
-
if (iteratorFn !== propValue.entries) {
|
|
1665
|
-
while (!(step = iterator.next()).done) {
|
|
1666
|
-
if (!isNode(step.value)) {
|
|
1667
|
-
return false;
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
} else {
|
|
1671
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1672
|
-
while (!(step = iterator.next()).done) {
|
|
1673
|
-
var entry = step.value;
|
|
1674
|
-
if (entry) {
|
|
1675
|
-
if (!isNode(entry[1])) {
|
|
1676
|
-
return false;
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
} else {
|
|
1682
|
-
return false;
|
|
1683
|
-
}
|
|
1684
|
-
return true;
|
|
1685
|
-
default:
|
|
1686
|
-
return false;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
function isSymbol(propType, propValue) {
|
|
1690
|
-
// Native Symbol.
|
|
1691
|
-
if (propType === 'symbol') {
|
|
1692
|
-
return true;
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
// falsy value can't be a Symbol
|
|
1696
|
-
if (!propValue) {
|
|
1697
|
-
return false;
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1701
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1702
|
-
return true;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1706
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1707
|
-
return true;
|
|
1708
|
-
}
|
|
1709
|
-
return false;
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1713
|
-
function getPropType(propValue) {
|
|
1714
|
-
var propType = typeof propValue;
|
|
1715
|
-
if (Array.isArray(propValue)) {
|
|
1716
|
-
return 'array';
|
|
1717
|
-
}
|
|
1718
|
-
if (propValue instanceof RegExp) {
|
|
1719
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1720
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1721
|
-
// passes PropTypes.object.
|
|
1722
|
-
return 'object';
|
|
1723
|
-
}
|
|
1724
|
-
if (isSymbol(propType, propValue)) {
|
|
1725
|
-
return 'symbol';
|
|
1726
|
-
}
|
|
1727
|
-
return propType;
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
|
1731
|
-
// See `createPrimitiveTypeChecker`.
|
|
1732
|
-
function getPreciseType(propValue) {
|
|
1733
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1734
|
-
return '' + propValue;
|
|
1735
|
-
}
|
|
1736
|
-
var propType = getPropType(propValue);
|
|
1737
|
-
if (propType === 'object') {
|
|
1738
|
-
if (propValue instanceof Date) {
|
|
1739
|
-
return 'date';
|
|
1740
|
-
} else if (propValue instanceof RegExp) {
|
|
1741
|
-
return 'regexp';
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
return propType;
|
|
1745
|
-
}
|
|
1746
1193
|
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1194
|
+
function requireFactoryWithTypeCheckers () {
|
|
1195
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
1196
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
1197
|
+
|
|
1198
|
+
var ReactIs = requireReactIs();
|
|
1199
|
+
var assign = requireObjectAssign();
|
|
1200
|
+
|
|
1201
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
1202
|
+
var has = /*@__PURE__*/ requireHas();
|
|
1203
|
+
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
|
|
1204
|
+
|
|
1205
|
+
var printWarning = function() {};
|
|
1206
|
+
|
|
1207
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1208
|
+
printWarning = function(text) {
|
|
1209
|
+
var message = 'Warning: ' + text;
|
|
1210
|
+
if (typeof console !== 'undefined') {
|
|
1211
|
+
console.error(message);
|
|
1212
|
+
}
|
|
1213
|
+
try {
|
|
1214
|
+
// --- Welcome to debugging React ---
|
|
1215
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
1216
|
+
// to find the callsite that caused this warning to fire.
|
|
1217
|
+
throw new Error(message);
|
|
1218
|
+
} catch (x) {}
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
function emptyFunctionThatReturnsNull() {
|
|
1223
|
+
return null;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
1227
|
+
/* global Symbol */
|
|
1228
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
1229
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Returns the iterator method function contained on the iterable object.
|
|
1233
|
+
*
|
|
1234
|
+
* Be sure to invoke the function with the iterable as context:
|
|
1235
|
+
*
|
|
1236
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
1237
|
+
* if (iteratorFn) {
|
|
1238
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
1239
|
+
* ...
|
|
1240
|
+
* }
|
|
1241
|
+
*
|
|
1242
|
+
* @param {?object} maybeIterable
|
|
1243
|
+
* @return {?function}
|
|
1244
|
+
*/
|
|
1245
|
+
function getIteratorFn(maybeIterable) {
|
|
1246
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
1247
|
+
if (typeof iteratorFn === 'function') {
|
|
1248
|
+
return iteratorFn;
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
1254
|
+
* supplied to React components. Example usage:
|
|
1255
|
+
*
|
|
1256
|
+
* var Props = require('ReactPropTypes');
|
|
1257
|
+
* var MyArticle = React.createClass({
|
|
1258
|
+
* propTypes: {
|
|
1259
|
+
* // An optional string prop named "description".
|
|
1260
|
+
* description: Props.string,
|
|
1261
|
+
*
|
|
1262
|
+
* // A required enum prop named "category".
|
|
1263
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
1264
|
+
*
|
|
1265
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
1266
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
1267
|
+
* },
|
|
1268
|
+
* render: function() { ... }
|
|
1269
|
+
* });
|
|
1270
|
+
*
|
|
1271
|
+
* A more formal specification of how these methods are used:
|
|
1272
|
+
*
|
|
1273
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
1274
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
1275
|
+
*
|
|
1276
|
+
* Each and every declaration produces a function with the same signature. This
|
|
1277
|
+
* allows the creation of custom validation functions. For example:
|
|
1278
|
+
*
|
|
1279
|
+
* var MyLink = React.createClass({
|
|
1280
|
+
* propTypes: {
|
|
1281
|
+
* // An optional string or URI prop named "href".
|
|
1282
|
+
* href: function(props, propName, componentName) {
|
|
1283
|
+
* var propValue = props[propName];
|
|
1284
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
1285
|
+
* !(propValue instanceof URI)) {
|
|
1286
|
+
* return new Error(
|
|
1287
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
1288
|
+
* componentName
|
|
1289
|
+
* );
|
|
1290
|
+
* }
|
|
1291
|
+
* }
|
|
1292
|
+
* },
|
|
1293
|
+
* render: function() {...}
|
|
1294
|
+
* });
|
|
1295
|
+
*
|
|
1296
|
+
* @internal
|
|
1297
|
+
*/
|
|
1298
|
+
|
|
1299
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
1300
|
+
|
|
1301
|
+
// Important!
|
|
1302
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
1303
|
+
var ReactPropTypes = {
|
|
1304
|
+
array: createPrimitiveTypeChecker('array'),
|
|
1305
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
1306
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
1307
|
+
func: createPrimitiveTypeChecker('function'),
|
|
1308
|
+
number: createPrimitiveTypeChecker('number'),
|
|
1309
|
+
object: createPrimitiveTypeChecker('object'),
|
|
1310
|
+
string: createPrimitiveTypeChecker('string'),
|
|
1311
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
1312
|
+
|
|
1313
|
+
any: createAnyTypeChecker(),
|
|
1314
|
+
arrayOf: createArrayOfTypeChecker,
|
|
1315
|
+
element: createElementTypeChecker(),
|
|
1316
|
+
elementType: createElementTypeTypeChecker(),
|
|
1317
|
+
instanceOf: createInstanceTypeChecker,
|
|
1318
|
+
node: createNodeChecker(),
|
|
1319
|
+
objectOf: createObjectOfTypeChecker,
|
|
1320
|
+
oneOf: createEnumTypeChecker,
|
|
1321
|
+
oneOfType: createUnionTypeChecker,
|
|
1322
|
+
shape: createShapeTypeChecker,
|
|
1323
|
+
exact: createStrictShapeTypeChecker,
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
1328
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1329
|
+
*/
|
|
1330
|
+
/*eslint-disable no-self-compare*/
|
|
1331
|
+
function is(x, y) {
|
|
1332
|
+
// SameValue algorithm
|
|
1333
|
+
if (x === y) {
|
|
1334
|
+
// Steps 1-5, 7-10
|
|
1335
|
+
// Steps 6.b-6.e: +0 != -0
|
|
1336
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
1337
|
+
} else {
|
|
1338
|
+
// Step 6.a: NaN == NaN
|
|
1339
|
+
return x !== x && y !== y;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
/*eslint-enable no-self-compare*/
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
1346
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
1347
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
1348
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
1349
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
1350
|
+
*/
|
|
1351
|
+
function PropTypeError(message, data) {
|
|
1352
|
+
this.message = message;
|
|
1353
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
1354
|
+
this.stack = '';
|
|
1355
|
+
}
|
|
1356
|
+
// Make `instanceof Error` still work for returned errors.
|
|
1357
|
+
PropTypeError.prototype = Error.prototype;
|
|
1358
|
+
|
|
1359
|
+
function createChainableTypeChecker(validate) {
|
|
1360
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1361
|
+
var manualPropTypeCallCache = {};
|
|
1362
|
+
var manualPropTypeWarningCount = 0;
|
|
1363
|
+
}
|
|
1364
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
1365
|
+
componentName = componentName || ANONYMOUS;
|
|
1366
|
+
propFullName = propFullName || propName;
|
|
1367
|
+
|
|
1368
|
+
if (secret !== ReactPropTypesSecret) {
|
|
1369
|
+
if (throwOnDirectAccess) {
|
|
1370
|
+
// New behavior only for users of `prop-types` package
|
|
1371
|
+
var err = new Error(
|
|
1372
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1373
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
1374
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1375
|
+
);
|
|
1376
|
+
err.name = 'Invariant Violation';
|
|
1377
|
+
throw err;
|
|
1378
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
1379
|
+
// Old behavior for people using React.PropTypes
|
|
1380
|
+
var cacheKey = componentName + ':' + propName;
|
|
1381
|
+
if (
|
|
1382
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
1383
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
1384
|
+
manualPropTypeWarningCount < 3
|
|
1385
|
+
) {
|
|
1386
|
+
printWarning(
|
|
1387
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
1388
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
1389
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
1390
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
1391
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
1392
|
+
);
|
|
1393
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
1394
|
+
manualPropTypeWarningCount++;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
if (props[propName] == null) {
|
|
1399
|
+
if (isRequired) {
|
|
1400
|
+
if (props[propName] === null) {
|
|
1401
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
1402
|
+
}
|
|
1403
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
1404
|
+
}
|
|
1405
|
+
return null;
|
|
1406
|
+
} else {
|
|
1407
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
1412
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
1413
|
+
|
|
1414
|
+
return chainedCheckType;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
1418
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
1419
|
+
var propValue = props[propName];
|
|
1420
|
+
var propType = getPropType(propValue);
|
|
1421
|
+
if (propType !== expectedType) {
|
|
1422
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
1423
|
+
// check, but we can offer a more precise error message here rather than
|
|
1424
|
+
// 'of type `object`'.
|
|
1425
|
+
var preciseType = getPreciseType(propValue);
|
|
1426
|
+
|
|
1427
|
+
return new PropTypeError(
|
|
1428
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
1429
|
+
{expectedType: expectedType}
|
|
1430
|
+
);
|
|
1431
|
+
}
|
|
1432
|
+
return null;
|
|
1433
|
+
}
|
|
1434
|
+
return createChainableTypeChecker(validate);
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
function createAnyTypeChecker() {
|
|
1438
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
1442
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1443
|
+
if (typeof typeChecker !== 'function') {
|
|
1444
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
1445
|
+
}
|
|
1446
|
+
var propValue = props[propName];
|
|
1447
|
+
if (!Array.isArray(propValue)) {
|
|
1448
|
+
var propType = getPropType(propValue);
|
|
1449
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
1450
|
+
}
|
|
1451
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
1452
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
1453
|
+
if (error instanceof Error) {
|
|
1454
|
+
return error;
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
return null;
|
|
1458
|
+
}
|
|
1459
|
+
return createChainableTypeChecker(validate);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
function createElementTypeChecker() {
|
|
1463
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1464
|
+
var propValue = props[propName];
|
|
1465
|
+
if (!isValidElement(propValue)) {
|
|
1466
|
+
var propType = getPropType(propValue);
|
|
1467
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
1468
|
+
}
|
|
1469
|
+
return null;
|
|
1470
|
+
}
|
|
1471
|
+
return createChainableTypeChecker(validate);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
function createElementTypeTypeChecker() {
|
|
1475
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1476
|
+
var propValue = props[propName];
|
|
1477
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
1478
|
+
var propType = getPropType(propValue);
|
|
1479
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
1480
|
+
}
|
|
1481
|
+
return null;
|
|
1482
|
+
}
|
|
1483
|
+
return createChainableTypeChecker(validate);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
1487
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1488
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
1489
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
1490
|
+
var actualClassName = getClassName(props[propName]);
|
|
1491
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
1492
|
+
}
|
|
1493
|
+
return null;
|
|
1494
|
+
}
|
|
1495
|
+
return createChainableTypeChecker(validate);
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
function createEnumTypeChecker(expectedValues) {
|
|
1499
|
+
if (!Array.isArray(expectedValues)) {
|
|
1500
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1501
|
+
if (arguments.length > 1) {
|
|
1502
|
+
printWarning(
|
|
1503
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
1504
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
1505
|
+
);
|
|
1506
|
+
} else {
|
|
1507
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
return emptyFunctionThatReturnsNull;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1514
|
+
var propValue = props[propName];
|
|
1515
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
1516
|
+
if (is(propValue, expectedValues[i])) {
|
|
1517
|
+
return null;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
1522
|
+
var type = getPreciseType(value);
|
|
1523
|
+
if (type === 'symbol') {
|
|
1524
|
+
return String(value);
|
|
1525
|
+
}
|
|
1526
|
+
return value;
|
|
1527
|
+
});
|
|
1528
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
1529
|
+
}
|
|
1530
|
+
return createChainableTypeChecker(validate);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
1534
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1535
|
+
if (typeof typeChecker !== 'function') {
|
|
1536
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
1537
|
+
}
|
|
1538
|
+
var propValue = props[propName];
|
|
1539
|
+
var propType = getPropType(propValue);
|
|
1540
|
+
if (propType !== 'object') {
|
|
1541
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
1542
|
+
}
|
|
1543
|
+
for (var key in propValue) {
|
|
1544
|
+
if (has(propValue, key)) {
|
|
1545
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1546
|
+
if (error instanceof Error) {
|
|
1547
|
+
return error;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
return null;
|
|
1552
|
+
}
|
|
1553
|
+
return createChainableTypeChecker(validate);
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
1557
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
1558
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
1559
|
+
return emptyFunctionThatReturnsNull;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1563
|
+
var checker = arrayOfTypeCheckers[i];
|
|
1564
|
+
if (typeof checker !== 'function') {
|
|
1565
|
+
printWarning(
|
|
1566
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
1567
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
1568
|
+
);
|
|
1569
|
+
return emptyFunctionThatReturnsNull;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1574
|
+
var expectedTypes = [];
|
|
1575
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1576
|
+
var checker = arrayOfTypeCheckers[i];
|
|
1577
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
1578
|
+
if (checkerResult == null) {
|
|
1579
|
+
return null;
|
|
1580
|
+
}
|
|
1581
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
1582
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
1586
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
1587
|
+
}
|
|
1588
|
+
return createChainableTypeChecker(validate);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
function createNodeChecker() {
|
|
1592
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1593
|
+
if (!isNode(props[propName])) {
|
|
1594
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
1595
|
+
}
|
|
1596
|
+
return null;
|
|
1597
|
+
}
|
|
1598
|
+
return createChainableTypeChecker(validate);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
1602
|
+
return new PropTypeError(
|
|
1603
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
1604
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
1605
|
+
);
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
1609
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1610
|
+
var propValue = props[propName];
|
|
1611
|
+
var propType = getPropType(propValue);
|
|
1612
|
+
if (propType !== 'object') {
|
|
1613
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1614
|
+
}
|
|
1615
|
+
for (var key in shapeTypes) {
|
|
1616
|
+
var checker = shapeTypes[key];
|
|
1617
|
+
if (typeof checker !== 'function') {
|
|
1618
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1619
|
+
}
|
|
1620
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1621
|
+
if (error) {
|
|
1622
|
+
return error;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
return null;
|
|
1626
|
+
}
|
|
1627
|
+
return createChainableTypeChecker(validate);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
1631
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1632
|
+
var propValue = props[propName];
|
|
1633
|
+
var propType = getPropType(propValue);
|
|
1634
|
+
if (propType !== 'object') {
|
|
1635
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1636
|
+
}
|
|
1637
|
+
// We need to check all keys in case some are required but missing from props.
|
|
1638
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
1639
|
+
for (var key in allKeys) {
|
|
1640
|
+
var checker = shapeTypes[key];
|
|
1641
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
1642
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1643
|
+
}
|
|
1644
|
+
if (!checker) {
|
|
1645
|
+
return new PropTypeError(
|
|
1646
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
1647
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
1648
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
1649
|
+
);
|
|
1650
|
+
}
|
|
1651
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1652
|
+
if (error) {
|
|
1653
|
+
return error;
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
return null;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
return createChainableTypeChecker(validate);
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
function isNode(propValue) {
|
|
1663
|
+
switch (typeof propValue) {
|
|
1664
|
+
case 'number':
|
|
1665
|
+
case 'string':
|
|
1666
|
+
case 'undefined':
|
|
1667
|
+
return true;
|
|
1668
|
+
case 'boolean':
|
|
1669
|
+
return !propValue;
|
|
1670
|
+
case 'object':
|
|
1671
|
+
if (Array.isArray(propValue)) {
|
|
1672
|
+
return propValue.every(isNode);
|
|
1673
|
+
}
|
|
1674
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
1675
|
+
return true;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
1679
|
+
if (iteratorFn) {
|
|
1680
|
+
var iterator = iteratorFn.call(propValue);
|
|
1681
|
+
var step;
|
|
1682
|
+
if (iteratorFn !== propValue.entries) {
|
|
1683
|
+
while (!(step = iterator.next()).done) {
|
|
1684
|
+
if (!isNode(step.value)) {
|
|
1685
|
+
return false;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
} else {
|
|
1689
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1690
|
+
while (!(step = iterator.next()).done) {
|
|
1691
|
+
var entry = step.value;
|
|
1692
|
+
if (entry) {
|
|
1693
|
+
if (!isNode(entry[1])) {
|
|
1694
|
+
return false;
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
} else {
|
|
1700
|
+
return false;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
return true;
|
|
1704
|
+
default:
|
|
1705
|
+
return false;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
function isSymbol(propType, propValue) {
|
|
1710
|
+
// Native Symbol.
|
|
1711
|
+
if (propType === 'symbol') {
|
|
1712
|
+
return true;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// falsy value can't be a Symbol
|
|
1716
|
+
if (!propValue) {
|
|
1717
|
+
return false;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1721
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1722
|
+
return true;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1726
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1727
|
+
return true;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
return false;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1734
|
+
function getPropType(propValue) {
|
|
1735
|
+
var propType = typeof propValue;
|
|
1736
|
+
if (Array.isArray(propValue)) {
|
|
1737
|
+
return 'array';
|
|
1738
|
+
}
|
|
1739
|
+
if (propValue instanceof RegExp) {
|
|
1740
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1741
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1742
|
+
// passes PropTypes.object.
|
|
1743
|
+
return 'object';
|
|
1744
|
+
}
|
|
1745
|
+
if (isSymbol(propType, propValue)) {
|
|
1746
|
+
return 'symbol';
|
|
1747
|
+
}
|
|
1748
|
+
return propType;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1752
|
+
// See `createPrimitiveTypeChecker`.
|
|
1753
|
+
function getPreciseType(propValue) {
|
|
1754
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1755
|
+
return '' + propValue;
|
|
1756
|
+
}
|
|
1757
|
+
var propType = getPropType(propValue);
|
|
1758
|
+
if (propType === 'object') {
|
|
1759
|
+
if (propValue instanceof Date) {
|
|
1760
|
+
return 'date';
|
|
1761
|
+
} else if (propValue instanceof RegExp) {
|
|
1762
|
+
return 'regexp';
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
return propType;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1769
|
+
// For example, "undefined" or "of type array"
|
|
1770
|
+
function getPostfixForTypeWarning(value) {
|
|
1771
|
+
var type = getPreciseType(value);
|
|
1772
|
+
switch (type) {
|
|
1773
|
+
case 'array':
|
|
1774
|
+
case 'object':
|
|
1775
|
+
return 'an ' + type;
|
|
1776
|
+
case 'boolean':
|
|
1777
|
+
case 'date':
|
|
1778
|
+
case 'regexp':
|
|
1779
|
+
return 'a ' + type;
|
|
1780
|
+
default:
|
|
1781
|
+
return type;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
// Returns class name of the object, if any.
|
|
1786
|
+
function getClassName(propValue) {
|
|
1787
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1788
|
+
return ANONYMOUS;
|
|
1789
|
+
}
|
|
1790
|
+
return propValue.constructor.name;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1794
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1795
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1796
|
+
|
|
1797
|
+
return ReactPropTypes;
|
|
1798
|
+
};
|
|
1799
|
+
return factoryWithTypeCheckers;
|
|
1777
1800
|
}
|
|
1778
1801
|
|
|
1779
1802
|
/**
|
|
@@ -1782,58 +1805,69 @@ function requireFactoryWithTypeCheckers() {
|
|
|
1782
1805
|
* This source code is licensed under the MIT license found in the
|
|
1783
1806
|
* LICENSE file in the root directory of this source tree.
|
|
1784
1807
|
*/
|
|
1808
|
+
|
|
1785
1809
|
var factoryWithThrowingShims;
|
|
1786
1810
|
var hasRequiredFactoryWithThrowingShims;
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1811
|
+
|
|
1812
|
+
function requireFactoryWithThrowingShims () {
|
|
1813
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1814
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
1815
|
+
|
|
1816
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
1817
|
+
|
|
1818
|
+
function emptyFunction() {}
|
|
1819
|
+
function emptyFunctionWithReset() {}
|
|
1820
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1821
|
+
|
|
1822
|
+
factoryWithThrowingShims = function() {
|
|
1823
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1824
|
+
if (secret === ReactPropTypesSecret) {
|
|
1825
|
+
// It is still safe when called from React.
|
|
1826
|
+
return;
|
|
1827
|
+
}
|
|
1828
|
+
var err = new Error(
|
|
1829
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1830
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1831
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1832
|
+
);
|
|
1833
|
+
err.name = 'Invariant Violation';
|
|
1834
|
+
throw err;
|
|
1835
|
+
} shim.isRequired = shim;
|
|
1836
|
+
function getShim() {
|
|
1837
|
+
return shim;
|
|
1838
|
+
} // Important!
|
|
1839
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1840
|
+
var ReactPropTypes = {
|
|
1841
|
+
array: shim,
|
|
1842
|
+
bigint: shim,
|
|
1843
|
+
bool: shim,
|
|
1844
|
+
func: shim,
|
|
1845
|
+
number: shim,
|
|
1846
|
+
object: shim,
|
|
1847
|
+
string: shim,
|
|
1848
|
+
symbol: shim,
|
|
1849
|
+
|
|
1850
|
+
any: shim,
|
|
1851
|
+
arrayOf: getShim,
|
|
1852
|
+
element: shim,
|
|
1853
|
+
elementType: shim,
|
|
1854
|
+
instanceOf: getShim,
|
|
1855
|
+
node: shim,
|
|
1856
|
+
objectOf: getShim,
|
|
1857
|
+
oneOf: getShim,
|
|
1858
|
+
oneOfType: getShim,
|
|
1859
|
+
shape: getShim,
|
|
1860
|
+
exact: getShim,
|
|
1861
|
+
|
|
1862
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
1863
|
+
resetWarningCache: emptyFunction
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1867
|
+
|
|
1868
|
+
return ReactPropTypes;
|
|
1869
|
+
};
|
|
1870
|
+
return factoryWithThrowingShims;
|
|
1837
1871
|
}
|
|
1838
1872
|
|
|
1839
1873
|
/**
|
|
@@ -1842,23 +1876,25 @@ function requireFactoryWithThrowingShims() {
|
|
|
1842
1876
|
* This source code is licensed under the MIT license found in the
|
|
1843
1877
|
* LICENSE file in the root directory of this source tree.
|
|
1844
1878
|
*/
|
|
1879
|
+
|
|
1845
1880
|
var hasRequiredPropTypes;
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1881
|
+
|
|
1882
|
+
function requirePropTypes () {
|
|
1883
|
+
if (hasRequiredPropTypes) return propTypes.exports;
|
|
1884
|
+
hasRequiredPropTypes = 1;
|
|
1885
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1886
|
+
var ReactIs = requireReactIs();
|
|
1887
|
+
|
|
1888
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1889
|
+
// http://fb.me/prop-types-in-prod
|
|
1890
|
+
var throwOnDirectAccess = true;
|
|
1891
|
+
propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1892
|
+
} else {
|
|
1893
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1894
|
+
// http://fb.me/prop-types-in-prod
|
|
1895
|
+
propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
|
|
1896
|
+
}
|
|
1897
|
+
return propTypes.exports;
|
|
1862
1898
|
}
|
|
1863
1899
|
|
|
1864
1900
|
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
@@ -2271,42 +2307,41 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
2271
2307
|
const [submitLoading, setSubmitLoading] = react.useState(false);
|
|
2272
2308
|
const [isInitialized, setIsInitialized] = react.useState(false);
|
|
2273
2309
|
const hasFetchedRef = react.useRef(false);
|
|
2274
|
-
const
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
if (
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
const results = await Promise.allSettled(promises);
|
|
2286
|
-
if (sections.includes('LAN')) {
|
|
2287
|
-
const lanResult = results[0];
|
|
2288
|
-
if (lanResult.status === 'fulfilled') {
|
|
2289
|
-
setLanConfigs(lanResult.value || []);
|
|
2310
|
+
const hasInitializedRef = react.useRef(false); // 确保表单初始值只设置一次
|
|
2311
|
+
|
|
2312
|
+
react.useEffect(() => {
|
|
2313
|
+
if (!open) return;
|
|
2314
|
+
const fetchData = async () => {
|
|
2315
|
+
if (hasFetchedRef.current) return;
|
|
2316
|
+
try {
|
|
2317
|
+
hasFetchedRef.current = true;
|
|
2318
|
+
const promises = [];
|
|
2319
|
+
if (sections.includes('LAN')) {
|
|
2320
|
+
promises.push(getLanConfig());
|
|
2290
2321
|
}
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2322
|
+
if (sections.includes('QSFP')) {
|
|
2323
|
+
promises.push(getSysConfig());
|
|
2324
|
+
}
|
|
2325
|
+
const results = await Promise.allSettled(promises);
|
|
2326
|
+
if (sections.includes('LAN')) {
|
|
2327
|
+
const lanResult = results[0];
|
|
2328
|
+
if (lanResult.status === 'fulfilled') {
|
|
2329
|
+
setLanConfigs(lanResult.value || []);
|
|
2330
|
+
}
|
|
2296
2331
|
}
|
|
2332
|
+
if (sections.includes('QSFP')) {
|
|
2333
|
+
const sysResult = sections.includes('LAN') ? results[1] : results[0];
|
|
2334
|
+
if (sysResult.status === 'fulfilled' && sysResult.value) {
|
|
2335
|
+
setSt2110Interfaces(sysResult.value.st2110_interfaces || []);
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
setIsInitialized(true);
|
|
2339
|
+
} catch (error) {
|
|
2340
|
+
console.error('Failed to fetch data:', error);
|
|
2297
2341
|
}
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
console.error('Failed to fetch data:', error);
|
|
2301
|
-
hasFetchedRef.current = false; // 出错时重置标志
|
|
2302
|
-
}
|
|
2342
|
+
};
|
|
2343
|
+
fetchData();
|
|
2303
2344
|
}, [open, getLanConfig, getSysConfig, sections]);
|
|
2304
|
-
react.useEffect(() => {
|
|
2305
|
-
if (open) {
|
|
2306
|
-
console.log(123456);
|
|
2307
|
-
fetchData();
|
|
2308
|
-
}
|
|
2309
|
-
}, [open, fetchData]);
|
|
2310
2345
|
|
|
2311
2346
|
// 当模态框关闭时重置状态
|
|
2312
2347
|
react.useEffect(() => {
|
|
@@ -2315,7 +2350,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
2315
2350
|
setLanConfigs([]);
|
|
2316
2351
|
setSt2110Interfaces([]);
|
|
2317
2352
|
form.resetFields();
|
|
2318
|
-
hasFetchedRef.current = false;
|
|
2353
|
+
hasFetchedRef.current = false;
|
|
2319
2354
|
}
|
|
2320
2355
|
}, [open, form]);
|
|
2321
2356
|
|
|
@@ -2342,10 +2377,11 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
2342
2377
|
|
|
2343
2378
|
// 当初始值准备好后设置表单值
|
|
2344
2379
|
react.useEffect(() => {
|
|
2345
|
-
if (isInitialized &&
|
|
2380
|
+
if (isInitialized && !hasInitializedRef.current) {
|
|
2346
2381
|
form.setFieldsValue(initialValues);
|
|
2382
|
+
hasInitializedRef.current = true;
|
|
2347
2383
|
}
|
|
2348
|
-
}, [
|
|
2384
|
+
}, [isInitialized, form, initialValues]);
|
|
2349
2385
|
const handleSuccess = react.useCallback(async function () {
|
|
2350
2386
|
let isPopup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
2351
2387
|
let messageText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Success';
|
|
@@ -2372,6 +2408,8 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
2372
2408
|
setSubmitLoading(true);
|
|
2373
2409
|
try {
|
|
2374
2410
|
const values = await form.validateFields();
|
|
2411
|
+
// console.log("Direct form values:", values);
|
|
2412
|
+
|
|
2375
2413
|
const updatePromises = [];
|
|
2376
2414
|
|
|
2377
2415
|
// 更新LAN配置
|