Skip to content

Commit aa50395

Browse files
author
Tomasz John
committed
- update: warnings removed
1 parent 294d642 commit aa50395

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+157
-114
lines changed

package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@
7070
"nwb": "^0.23.0",
7171
"react-app-polyfill": "^1.0.6",
7272
"react-popper": "^0.10.4",
73-
"sinon": "^5.1.1",
74-
"react": "^16.12.0",
75-
"react-dom": "^16.12.0",
76-
"react-router-dom": "^5.1.2"
73+
"sinon": "^5.1.1"
7774
},
7875
"repository": {
7976
"type": "git",

src/CBadge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React,{useMemo, useRef} from 'react';
1+
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
44
import {tagPropType, mapToCssModules} from './Shared/helper.js';

src/CBreadcrumb.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React, {useState} from 'react';
1+
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {tagPropType, mapToCssModules} from './Shared/helper.js';
54
import {Route, Link, matchPath} from 'react-router-dom';
65
import CBreadcrumbCustom from './CBreadcrumbCustom';
76
import CBreadcrumbItem from './CBreadcrumbItem';
@@ -45,7 +44,8 @@ const CBreadcrumbRouteItem = ({ match }) => {
4544

4645
CBreadcrumbRouteItem.propTypes = {
4746
match: PropTypes.shape({
48-
url: PropTypes.string
47+
url: PropTypes.string,
48+
isExact: PropTypes.bool
4949
})
5050
};
5151

@@ -80,7 +80,6 @@ const CBreadcrumbRouter = args=>{
8080
const CBreadcrumb = props=>{
8181

8282
const {
83-
tag: Tag,
8483
children,
8584
className,
8685
custom,
@@ -126,6 +125,7 @@ CBreadcrumb.propTypes = {
126125
//
127126
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
128127
appRoutes: PropTypes.any,
128+
match: PropTypes.object,
129129
routesProps: PropTypes.object
130130
};
131131

src/CButton.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ const CButton = props=>{
7171
onClick={onClick}
7272
aria-label={ariaLabel || defaultAriaLabel}
7373
ref={innerRef}
74-
children={textHtml ? textHtml : children}
75-
/>;
74+
>
75+
{textHtml ? textHtml : children}
76+
</Tag>
7677

7778
}
7879

src/CButtonClose.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const CButtonClose = props=>{
3333

3434
CButtonClose.propTypes = {
3535
tag: tagPropType,
36+
children: PropTypes.node,
3637
className: PropTypes.string,
3738
cssModule: PropTypes.object,
3839
//

src/CCard.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {tagPropType, mapToCssModules, deprecated} from './Shared/helper.js';
4+
import {tagPropType, mapToCssModules} from './Shared/helper.js';
55
import CCardBody from './CCardBody';
66
import CCardHeader from './CCardHeader';
77
import CCardFooter from './CCardFooter';
@@ -62,7 +62,9 @@ const CCard = props=>{
6262
);
6363

6464
return (
65-
<Tag {...attributes} className={classes} ref={innerRef} children={children}/>
65+
<Tag {...attributes} className={classes} ref={innerRef}>
66+
{children}
67+
</Tag>
6668
);
6769

6870
}

src/CCardLink.js

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import CLink from './CLink';
99
const CCardLink = props=>{
1010

1111
const {
12-
tag: Tag,
1312
className,
1413
cssModule,
1514
//

src/CCarousel.js

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ CCarousel.propTypes = {
107107
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
108108
items: PropTypes.array,
109109
indicators: PropTypes.bool,
110+
defaultOpen: PropTypes.bool,
110111
controls: PropTypes.bool,
111112
autoPlay: PropTypes.bool,
112113
activeIndex: PropTypes.number,

src/CCollapse.js

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ CCollapse.propTypes = {
6767
defaultOpen: PropTypes.bool,
6868
toggler: PropTypes.string,
6969
toggleEvents: PropTypes.arrayOf(PropTypes.string),
70+
toggle: PropTypes.func,
71+
show: PropTypes.bool
7072
};
7173

7274
CCollapse.defaultProps = {

src/CCollapseCustom.js

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const CCollapseCustom = props=>{
2929
className,
3030
cssModule,
3131
//
32-
innerRef,
3332
show,
3433
navbar,
3534
...otherProps

src/CDataTable.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { useState, useEffect, useRef, useMemo } from 'react';
1+
import React, { useState, useRef, useMemo } from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {tagPropType, mapToCssModules} from './Shared/helper.js';
4+
import {tagPropType} from './Shared/helper.js';
55
import Slot from './Shared/Slot';
66
import { CIcon } from '@coreui/icons-react';
77
import CSpinner from './CSpinner';
@@ -50,8 +50,8 @@ const CDataTable = props=>{
5050
loading,
5151
change,
5252
onChange,
53-
customContent,
54-
...attributes
53+
//customContent,
54+
//...attributes
5555
} = props;
5656

5757
//Object.assign(style, cssModule)
@@ -68,7 +68,7 @@ const CDataTable = props=>{
6868
});
6969
const [tableFilterState, setTableFilterState] = useState(tableFilterValue);
7070
const [columnFilterState, setColumnFilterState] = useState({});
71-
const [page, setPage] = useState(activePage || 1);
71+
/*const [page, setPage] = useState(activePage || 1);*/
7272
const [passedItems, setPassedItems] = useState(items || []);
7373

7474
// functions
@@ -270,26 +270,22 @@ const CDataTable = props=>{
270270
setPerPageItems(itemsPerPage);
271271
}, [itemsPerPage]);
272272

273-
//sorterValue
274-
/*
273+
//sorterValue ?
275274
useMemo(()=>{
276275
const asc = sorterValue.asc === false ? false : true;
277276
setSorterState(Object.assign({}, { asc, column: sorterValue.column }));
278277
}, [sorterValue]);
279-
*/
280278

281279
//tableFilterValue
282280
useMemo(()=>{
283281
if (compData.firstRun) return;
284282
setTableFilterState(tableFilterValue);
285283
}, [tableFilterValue]);
286284

287-
//columnFilterValue
288-
/*
285+
//columnFilterValue ?
289286
useMemo(()=>{
290287
setColumnFilterState(Object.assign({}, columnFilterValue));
291288
}, [columnFilterValue]);
292-
*/
293289

294290
//items
295291
useMemo(()=>{
@@ -479,7 +475,7 @@ const CDataTable = props=>{
479475
key={'details' + itemIndex}
480476
>
481477
<td
482-
colspan={colspan}
478+
colSpan={colspan}
483479
className="p-0"
484480
style={{border:'none !important'}}
485481
>

src/CDropdown.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const CDropdown = props=>{
1717

1818
//custom
1919

20-
const [isOpen, setIsOpen] = useState(props.defaultOpen || false);
20+
const [isOpen, setIsOpen] = useState(defaultOpen || false);
2121

2222
if (!custom){
2323
const userToggle = toggle;

src/CDropdownCustom.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, {useEffect, useRef} from 'react';
22
import ReactDOM from 'react-dom';
33
import PropTypes from 'prop-types';
44
import classNames from 'classnames';
5-
import {tagPropType, mapToCssModules, omit, keyCodes, deprecated} from './Shared/helper.js';
5+
import {tagPropType, mapToCssModules, omit, keyCodes} from './Shared/helper.js';
66
import {Manager} from 'react-popper';
77

88
export const Context = React.createContext({});
@@ -18,6 +18,10 @@ class CPopperContentWrapper extends React.Component {
1818
}
1919
}
2020

21+
CPopperContentWrapper.propTypes = {
22+
children: PropTypes.node
23+
};
24+
2125
CPopperContentWrapper.contextType = Context;
2226

2327
CPopperContentWrapper.childContextTypes = {
@@ -170,8 +174,8 @@ const CDropdownCustom = props=>{
170174

171175
useEffect(() => {
172176
if (fields.firstRender){
173-
return;
174-
};
177+
return
178+
}
175179
handleProps();
176180
}, [props.show]);
177181

src/CDropdownItem.js

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ CDropdownItem.propTypes = {
9090
//
9191
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
9292
color: PropTypes.string,
93+
href: PropTypes.string,
9394
divider: PropTypes.bool,
9495
header: PropTypes.bool,
9596
active: PropTypes.bool,

src/CDropdownToggle.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ const CDropdownToggle = props=>{
8080
className={classes}
8181
onClick={onClick}
8282
aria-expanded={context.isOpen}
83-
children={children}
84-
/>
83+
>
84+
{children}
85+
</Tag>
8586
);
8687
else
8788
return (
@@ -90,9 +91,10 @@ const CDropdownToggle = props=>{
9091
className={classes}
9192
onClick={onClick}
9293
aria-expanded={context.isOpen}
93-
children={children}
9494
ref={innerRef}
95-
/>
95+
>
96+
{children}
97+
</Tag>
9698
);
9799
}
98100

@@ -103,9 +105,10 @@ const CDropdownToggle = props=>{
103105
component={Tag}
104106
onClick={onClick}
105107
aria-expanded={context.isOpen}
106-
children={children}
107108
ref={innerRef}
108-
/>
109+
>
110+
{children}
111+
</Target>
109112
);
110113

111114
}

src/CEmbed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {mapToCssModules, omit, pick, TransitionPropTypeKeys, TransitionTimeouts, tagPropType} from './Shared/helper.js';
4+
import {mapToCssModules, tagPropType} from './Shared/helper.js';
55
import CEmbedObject from './CEmbedObject';
66

77
//component - CoreUI / CEmbed

src/CEmbedObject.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {mapToCssModules, omit, pick, TransitionPropTypeKeys, TransitionTimeouts, tagPropType} from './Shared/helper.js';
4+
import {mapToCssModules, tagPropType} from './Shared/helper.js';
55

66
//component - CoreUI / CEmbedObject
77

src/CFooter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {tagPropType, mapToCssModules} from './Shared/helper.js';
4+
import {mapToCssModules} from './Shared/helper.js';
55

66
//component - CoreUI / CFooter
77

src/CHeader.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {tagPropType, mapToCssModules} from './Shared/helper.js';
54

65
//component - CoreUI / CHeader
76

src/CHeaderNavItem.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,24 @@ const CHeaderNavItem = props=>{
3232
if (!custom){
3333
return (
3434
<Tag {...attributes} className={classes} ref={innerRef}>
35-
<CHeaderNavLink {...linkProps} className={linkClassName} to={to} children={children} />
35+
<CHeaderNavLink {...linkProps} className={linkClassName} to={to}>
36+
{children}
37+
</CHeaderNavLink>
3638
</Tag>
3739
);
3840
}
3941

4042
return (
41-
<Tag {...attributes} className={classes} children={children} ref={innerRef} />
43+
<Tag {...attributes} className={classes} ref={innerRef}>
44+
{children}
45+
</Tag>
4246
);
4347

4448
}
4549

4650
CHeaderNavItem.propTypes = {
4751
tag: tagPropType,
52+
children: PropTypes.node,
4853
className: PropTypes.string,
4954
cssModule: PropTypes.object,
5055
custom: PropTypes.bool,

src/CHeaderNavLink.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import {tagPropType, mapToCssModules} from './Shared/helper.js';
4+
import {mapToCssModules} from './Shared/helper.js';
55
import CLink from './CLink';
66

77
//component - CoreUI / CHeaderNavLink

src/CImg.js

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ CImg.propTypes = {
9292
block: PropTypes.bool,
9393
fluid: PropTypes.bool,
9494
fluidGrow: PropTypes.bool,
95+
active: PropTypes.bool,
9596
shape: PropTypes.string,//oneOf(['', 'rounded']),
9697
thumbnail: PropTypes.bool,
9798
align: PropTypes.oneOf(['', 'left', 'right', 'center']),

0 commit comments

Comments
 (0)