@coreui/react-pro 4.1.0 → 4.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/README.md +1 -1
- package/dist/components/popover/CPopover.d.ts +2 -2
- package/dist/components/smart-table/CSmartTableBody.d.ts +3 -3
- package/dist/components/smart-table/CSmartTableInterface.d.ts +9 -6
- package/dist/components/tooltip/CTooltip.d.ts +1 -1
- package/dist/index.es.js +52 -23
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +52 -23
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/popover/CPopover.tsx +4 -4
- package/src/components/smart-table/CSmartTable.tsx +15 -9
- package/src/components/smart-table/CSmartTableBody.tsx +9 -4
- package/src/components/smart-table/CSmartTableHead.tsx +1 -1
- package/src/components/smart-table/CSmartTableInterface.tsx +10 -6
- package/src/components/tooltip/CTooltip.tsx +2 -2
- package/src/utils/hooks/useForkedRef.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -385,6 +385,8 @@ var ReactPropTypesSecret$7 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
385
385
|
|
|
386
386
|
var ReactPropTypesSecret_1$1 = ReactPropTypesSecret$7;
|
|
387
387
|
|
|
388
|
+
var has$4 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
389
|
+
|
|
388
390
|
/**
|
|
389
391
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
390
392
|
*
|
|
@@ -397,7 +399,7 @@ var printWarning$4 = function() {};
|
|
|
397
399
|
if (process.env.NODE_ENV !== 'production') {
|
|
398
400
|
var ReactPropTypesSecret$6 = ReactPropTypesSecret_1$1;
|
|
399
401
|
var loggedTypeFailures$1 = {};
|
|
400
|
-
var has$3 =
|
|
402
|
+
var has$3 = has$4;
|
|
401
403
|
|
|
402
404
|
printWarning$4 = function(text) {
|
|
403
405
|
var message = 'Warning: ' + text;
|
|
@@ -409,7 +411,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
409
411
|
// This error was thrown as a convenience so that you can use this stack
|
|
410
412
|
// to find the callsite that caused this warning to fire.
|
|
411
413
|
throw new Error(message);
|
|
412
|
-
} catch (x) {}
|
|
414
|
+
} catch (x) { /**/ }
|
|
413
415
|
};
|
|
414
416
|
}
|
|
415
417
|
|
|
@@ -438,7 +440,8 @@ function checkPropTypes$3(typeSpecs, values, location, componentName, getStack)
|
|
|
438
440
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
439
441
|
var err = Error(
|
|
440
442
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
441
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
443
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
444
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
442
445
|
);
|
|
443
446
|
err.name = 'Invariant Violation';
|
|
444
447
|
throw err;
|
|
@@ -497,9 +500,9 @@ var ReactIs$3 = reactIs$1.exports;
|
|
|
497
500
|
var assign$1 = objectAssign$1;
|
|
498
501
|
|
|
499
502
|
var ReactPropTypesSecret$5 = ReactPropTypesSecret_1$1;
|
|
503
|
+
var has$2 = has$4;
|
|
500
504
|
var checkPropTypes$2 = checkPropTypes_1$1;
|
|
501
505
|
|
|
502
|
-
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
503
506
|
var printWarning$3 = function() {};
|
|
504
507
|
|
|
505
508
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -600,6 +603,7 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
600
603
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
601
604
|
var ReactPropTypes = {
|
|
602
605
|
array: createPrimitiveTypeChecker('array'),
|
|
606
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
603
607
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
604
608
|
func: createPrimitiveTypeChecker('function'),
|
|
605
609
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -645,8 +649,9 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
645
649
|
* is prohibitively expensive if they are created too often, such as what
|
|
646
650
|
* happens in oneOfType() for any type before the one that matched.
|
|
647
651
|
*/
|
|
648
|
-
function PropTypeError(message) {
|
|
652
|
+
function PropTypeError(message, data) {
|
|
649
653
|
this.message = message;
|
|
654
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
650
655
|
this.stack = '';
|
|
651
656
|
}
|
|
652
657
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -681,7 +686,7 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
681
686
|
) {
|
|
682
687
|
printWarning$3(
|
|
683
688
|
'You are manually calling a React.PropTypes validation ' +
|
|
684
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
689
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
685
690
|
'and will throw in the standalone `prop-types` package. ' +
|
|
686
691
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
687
692
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -720,7 +725,10 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
720
725
|
// 'of type `object`'.
|
|
721
726
|
var preciseType = getPreciseType(propValue);
|
|
722
727
|
|
|
723
|
-
return new PropTypeError(
|
|
728
|
+
return new PropTypeError(
|
|
729
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
730
|
+
{expectedType: expectedType}
|
|
731
|
+
);
|
|
724
732
|
}
|
|
725
733
|
return null;
|
|
726
734
|
}
|
|
@@ -864,14 +872,19 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
864
872
|
}
|
|
865
873
|
|
|
866
874
|
function validate(props, propName, componentName, location, propFullName) {
|
|
875
|
+
var expectedTypes = [];
|
|
867
876
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
868
877
|
var checker = arrayOfTypeCheckers[i];
|
|
869
|
-
|
|
878
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$5);
|
|
879
|
+
if (checkerResult == null) {
|
|
870
880
|
return null;
|
|
871
881
|
}
|
|
882
|
+
if (checkerResult.data.hasOwnProperty('expectedType')) {
|
|
883
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
884
|
+
}
|
|
872
885
|
}
|
|
873
|
-
|
|
874
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
886
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
887
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
875
888
|
}
|
|
876
889
|
return createChainableTypeChecker(validate);
|
|
877
890
|
}
|
|
@@ -886,6 +899,13 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
886
899
|
return createChainableTypeChecker(validate);
|
|
887
900
|
}
|
|
888
901
|
|
|
902
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
903
|
+
return new PropTypeError(
|
|
904
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
905
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
|
|
889
909
|
function createShapeTypeChecker(shapeTypes) {
|
|
890
910
|
function validate(props, propName, componentName, location, propFullName) {
|
|
891
911
|
var propValue = props[propName];
|
|
@@ -895,8 +915,8 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
895
915
|
}
|
|
896
916
|
for (var key in shapeTypes) {
|
|
897
917
|
var checker = shapeTypes[key];
|
|
898
|
-
if (
|
|
899
|
-
|
|
918
|
+
if (typeof checker !== 'function') {
|
|
919
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
900
920
|
}
|
|
901
921
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$5);
|
|
902
922
|
if (error) {
|
|
@@ -915,16 +935,18 @@ var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
|
915
935
|
if (propType !== 'object') {
|
|
916
936
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
917
937
|
}
|
|
918
|
-
// We need to check all keys in case some are required but missing from
|
|
919
|
-
// props.
|
|
938
|
+
// We need to check all keys in case some are required but missing from props.
|
|
920
939
|
var allKeys = assign$1({}, props[propName], shapeTypes);
|
|
921
940
|
for (var key in allKeys) {
|
|
922
941
|
var checker = shapeTypes[key];
|
|
942
|
+
if (has$2(shapeTypes, key) && typeof checker !== 'function') {
|
|
943
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
944
|
+
}
|
|
923
945
|
if (!checker) {
|
|
924
946
|
return new PropTypeError(
|
|
925
947
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
926
948
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
927
|
-
'\nValid keys: ' +
|
|
949
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
928
950
|
);
|
|
929
951
|
}
|
|
930
952
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$5);
|
|
@@ -1109,6 +1131,7 @@ var factoryWithThrowingShims$1 = function() {
|
|
|
1109
1131
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1110
1132
|
var ReactPropTypes = {
|
|
1111
1133
|
array: shim,
|
|
1134
|
+
bigint: shim,
|
|
1112
1135
|
bool: shim,
|
|
1113
1136
|
func: shim,
|
|
1114
1137
|
number: shim,
|
|
@@ -2387,6 +2410,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2387
2410
|
var CSSTransition$1 = CSSTransition;
|
|
2388
2411
|
|
|
2389
2412
|
// code borrowed from https://github.com/reach/reach-ui
|
|
2413
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2390
2414
|
function useForkedRef() {
|
|
2391
2415
|
var refs = [];
|
|
2392
2416
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -2396,6 +2420,7 @@ function useForkedRef() {
|
|
|
2396
2420
|
if (refs.every(function (ref) { return ref == null; })) {
|
|
2397
2421
|
return null;
|
|
2398
2422
|
}
|
|
2423
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2399
2424
|
return function (node) {
|
|
2400
2425
|
refs.forEach(function (ref) {
|
|
2401
2426
|
assignRef(ref, node);
|
|
@@ -2403,7 +2428,10 @@ function useForkedRef() {
|
|
|
2403
2428
|
};
|
|
2404
2429
|
}, refs);
|
|
2405
2430
|
}
|
|
2406
|
-
|
|
2431
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2432
|
+
function assignRef(ref,
|
|
2433
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2434
|
+
value) {
|
|
2407
2435
|
if (ref == null)
|
|
2408
2436
|
return;
|
|
2409
2437
|
if (isFunction(ref)) {
|
|
@@ -2418,6 +2446,7 @@ function assignRef(ref, value) {
|
|
|
2418
2446
|
}
|
|
2419
2447
|
}
|
|
2420
2448
|
}
|
|
2449
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
2421
2450
|
function isFunction(value) {
|
|
2422
2451
|
return !!(value && {}.toString.call(value) == '[object Function]');
|
|
2423
2452
|
}
|
|
@@ -7361,12 +7390,12 @@ var CPopover = function (_a) {
|
|
|
7361
7390
|
};
|
|
7362
7391
|
CPopover.propTypes = {
|
|
7363
7392
|
children: PropTypes$1.any,
|
|
7364
|
-
content: PropTypes$1.node,
|
|
7393
|
+
content: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.node]),
|
|
7365
7394
|
placement: PropTypes$1.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
7366
7395
|
offset: PropTypes$1.any,
|
|
7367
7396
|
onHide: PropTypes$1.func,
|
|
7368
7397
|
onShow: PropTypes$1.func,
|
|
7369
|
-
title: PropTypes$1.string,
|
|
7398
|
+
title: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.node]),
|
|
7370
7399
|
trigger: triggerPropType,
|
|
7371
7400
|
visible: PropTypes$1.bool,
|
|
7372
7401
|
};
|
|
@@ -9096,7 +9125,7 @@ var CIcon = React.forwardRef(function (_a, ref) {
|
|
|
9096
9125
|
var iconName = React.useMemo(function () {
|
|
9097
9126
|
return _icon && typeof _icon === 'string' && _icon.includes('-') ? toCamelCase(_icon) : _icon;
|
|
9098
9127
|
}, [change]);
|
|
9099
|
-
var titleCode = title ? "<title>"
|
|
9128
|
+
var titleCode = title ? "<title>".concat(title, "</title>") : '';
|
|
9100
9129
|
var code = React.useMemo(function () {
|
|
9101
9130
|
if (Array.isArray(_icon)) {
|
|
9102
9131
|
return _icon;
|
|
@@ -9112,13 +9141,13 @@ var CIcon = React.forwardRef(function (_a, ref) {
|
|
|
9112
9141
|
return Array.isArray(code) && code.length > 1 ? code[0] : '64 64';
|
|
9113
9142
|
})();
|
|
9114
9143
|
var viewBox = (function () {
|
|
9115
|
-
return rest['viewBox'] || "0 0 "
|
|
9144
|
+
return rest['viewBox'] || "0 0 ".concat(scale);
|
|
9116
9145
|
})();
|
|
9117
9146
|
// render
|
|
9118
9147
|
var _className = customClassName
|
|
9119
9148
|
? classNames(customClassName)
|
|
9120
9149
|
: classNames('icon', (_b = {},
|
|
9121
|
-
_b["icon-"
|
|
9150
|
+
_b["icon-".concat(size)] = size,
|
|
9122
9151
|
_b["icon-custom-size"] = height || width,
|
|
9123
9152
|
_b), className);
|
|
9124
9153
|
return use ? (React__default["default"].createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: _className }, (height && { height: height }), (width && { width: width }), { role: "img" }, rest, { ref: ref }),
|
|
@@ -9317,7 +9346,7 @@ var CSmartTableHead = React.forwardRef(function (_a, ref) {
|
|
|
9317
9346
|
CSmartTableHead.propTypes = {
|
|
9318
9347
|
columnFilter: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object]),
|
|
9319
9348
|
columnFilterState: PropTypes$1.object,
|
|
9320
|
-
columnSorter: PropTypes$1.bool,
|
|
9349
|
+
columnSorter: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object]),
|
|
9321
9350
|
component: PropTypes$1.elementType,
|
|
9322
9351
|
children: PropTypes$1.node,
|
|
9323
9352
|
columns: PropTypes$1.arrayOf(PropTypes$1.oneOfType([PropTypes$1.any, PropTypes$1.string])).isRequired,
|
|
@@ -9909,7 +9938,7 @@ var CTooltip = function (_a) {
|
|
|
9909
9938
|
};
|
|
9910
9939
|
CTooltip.propTypes = {
|
|
9911
9940
|
children: PropTypes$1.any,
|
|
9912
|
-
content: PropTypes$1.node,
|
|
9941
|
+
content: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.node]),
|
|
9913
9942
|
placement: PropTypes$1.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
9914
9943
|
onHide: PropTypes$1.func,
|
|
9915
9944
|
onShow: PropTypes$1.func,
|