@bcgov-sso/common-react-components 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -2654,6 +2654,8 @@ var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
2654
2654
|
|
|
2655
2655
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
2656
2656
|
|
|
2657
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2658
|
+
|
|
2657
2659
|
/**
|
|
2658
2660
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2659
2661
|
*
|
|
@@ -2666,7 +2668,7 @@ var printWarning$1 = function() {};
|
|
|
2666
2668
|
if (process.env.NODE_ENV !== 'production') {
|
|
2667
2669
|
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
2668
2670
|
var loggedTypeFailures = {};
|
|
2669
|
-
var has$1 =
|
|
2671
|
+
var has$1 = has$2;
|
|
2670
2672
|
|
|
2671
2673
|
printWarning$1 = function(text) {
|
|
2672
2674
|
var message = 'Warning: ' + text;
|
|
@@ -2678,7 +2680,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2678
2680
|
// This error was thrown as a convenience so that you can use this stack
|
|
2679
2681
|
// to find the callsite that caused this warning to fire.
|
|
2680
2682
|
throw new Error(message);
|
|
2681
|
-
} catch (x) {}
|
|
2683
|
+
} catch (x) { /**/ }
|
|
2682
2684
|
};
|
|
2683
2685
|
}
|
|
2684
2686
|
|
|
@@ -2707,7 +2709,8 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
2707
2709
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2708
2710
|
var err = Error(
|
|
2709
2711
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
2710
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
2712
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
2713
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
2711
2714
|
);
|
|
2712
2715
|
err.name = 'Invariant Violation';
|
|
2713
2716
|
throw err;
|
|
@@ -2766,9 +2769,9 @@ var ReactIs$1 = reactIs$1.exports;
|
|
|
2766
2769
|
var assign = objectAssign;
|
|
2767
2770
|
|
|
2768
2771
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
2772
|
+
var has = has$2;
|
|
2769
2773
|
var checkPropTypes = checkPropTypes_1;
|
|
2770
2774
|
|
|
2771
|
-
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2772
2775
|
var printWarning = function() {};
|
|
2773
2776
|
|
|
2774
2777
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2869,6 +2872,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2869
2872
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
2870
2873
|
var ReactPropTypes = {
|
|
2871
2874
|
array: createPrimitiveTypeChecker('array'),
|
|
2875
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
2872
2876
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
2873
2877
|
func: createPrimitiveTypeChecker('function'),
|
|
2874
2878
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -2914,8 +2918,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2914
2918
|
* is prohibitively expensive if they are created too often, such as what
|
|
2915
2919
|
* happens in oneOfType() for any type before the one that matched.
|
|
2916
2920
|
*/
|
|
2917
|
-
function PropTypeError(message) {
|
|
2921
|
+
function PropTypeError(message, data) {
|
|
2918
2922
|
this.message = message;
|
|
2923
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
2919
2924
|
this.stack = '';
|
|
2920
2925
|
}
|
|
2921
2926
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -2950,7 +2955,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2950
2955
|
) {
|
|
2951
2956
|
printWarning(
|
|
2952
2957
|
'You are manually calling a React.PropTypes validation ' +
|
|
2953
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
2958
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
2954
2959
|
'and will throw in the standalone `prop-types` package. ' +
|
|
2955
2960
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
2956
2961
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -2989,7 +2994,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2989
2994
|
// 'of type `object`'.
|
|
2990
2995
|
var preciseType = getPreciseType(propValue);
|
|
2991
2996
|
|
|
2992
|
-
return new PropTypeError(
|
|
2997
|
+
return new PropTypeError(
|
|
2998
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
2999
|
+
{expectedType: expectedType}
|
|
3000
|
+
);
|
|
2993
3001
|
}
|
|
2994
3002
|
return null;
|
|
2995
3003
|
}
|
|
@@ -3133,14 +3141,19 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3133
3141
|
}
|
|
3134
3142
|
|
|
3135
3143
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3144
|
+
var expectedTypes = [];
|
|
3136
3145
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
3137
3146
|
var checker = arrayOfTypeCheckers[i];
|
|
3138
|
-
|
|
3147
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
3148
|
+
if (checkerResult == null) {
|
|
3139
3149
|
return null;
|
|
3140
3150
|
}
|
|
3151
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
3152
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
3153
|
+
}
|
|
3141
3154
|
}
|
|
3142
|
-
|
|
3143
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
3155
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
3156
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
3144
3157
|
}
|
|
3145
3158
|
return createChainableTypeChecker(validate);
|
|
3146
3159
|
}
|
|
@@ -3155,6 +3168,13 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3155
3168
|
return createChainableTypeChecker(validate);
|
|
3156
3169
|
}
|
|
3157
3170
|
|
|
3171
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
3172
|
+
return new PropTypeError(
|
|
3173
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
3174
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
3175
|
+
);
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3158
3178
|
function createShapeTypeChecker(shapeTypes) {
|
|
3159
3179
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3160
3180
|
var propValue = props[propName];
|
|
@@ -3164,8 +3184,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3164
3184
|
}
|
|
3165
3185
|
for (var key in shapeTypes) {
|
|
3166
3186
|
var checker = shapeTypes[key];
|
|
3167
|
-
if (
|
|
3168
|
-
|
|
3187
|
+
if (typeof checker !== 'function') {
|
|
3188
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3169
3189
|
}
|
|
3170
3190
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
3171
3191
|
if (error) {
|
|
@@ -3184,16 +3204,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3184
3204
|
if (propType !== 'object') {
|
|
3185
3205
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
3186
3206
|
}
|
|
3187
|
-
// We need to check all keys in case some are required but missing from
|
|
3188
|
-
// props.
|
|
3207
|
+
// We need to check all keys in case some are required but missing from props.
|
|
3189
3208
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
3190
3209
|
for (var key in allKeys) {
|
|
3191
3210
|
var checker = shapeTypes[key];
|
|
3211
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
3212
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3213
|
+
}
|
|
3192
3214
|
if (!checker) {
|
|
3193
3215
|
return new PropTypeError(
|
|
3194
3216
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
3195
3217
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
3196
|
-
'\nValid keys: ' +
|
|
3218
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
3197
3219
|
);
|
|
3198
3220
|
}
|
|
3199
3221
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
@@ -3378,6 +3400,7 @@ var factoryWithThrowingShims = function() {
|
|
|
3378
3400
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
3379
3401
|
var ReactPropTypes = {
|
|
3380
3402
|
array: shim,
|
|
3403
|
+
bigint: shim,
|
|
3381
3404
|
bool: shim,
|
|
3382
3405
|
func: shim,
|
|
3383
3406
|
number: shim,
|
|
@@ -8339,6 +8362,12 @@ const styles$1 = {
|
|
|
8339
8362
|
button: `
|
|
8340
8363
|
background-color: #1a4dff;
|
|
8341
8364
|
color: #e8edff;
|
|
8365
|
+
`,
|
|
8366
|
+
},
|
|
8367
|
+
plainText: {
|
|
8368
|
+
button: `
|
|
8369
|
+
background-color: unset;
|
|
8370
|
+
color: #0139ff;
|
|
8342
8371
|
`,
|
|
8343
8372
|
},
|
|
8344
8373
|
secondary: {
|