Skip to content

Commit c9d6ae0

Browse files
author
Krzysztof Wilk
committed
Generate version 2.1.0
1 parent fd1932d commit c9d6ae0

Some content is hidden

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

66 files changed

+235
-592
lines changed

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MDB 5 React
22

3-
Version: FREE 2.0.0
3+
Version: FREE 2.1.0
44

55
Documentation:
66
https://mdbootstrap.com/docs/b5/react/

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mdb-react-ui-kit-demo",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"main": "index.js",
55
"repository": {
66
"type": "git",

app/src/components/Collapse/Collapse.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,24 @@ const MDBCollapse: React.FC<CollapseProps> = ({
1010
id,
1111
navbar,
1212
tag: Tag,
13+
collapseRef,
1314
style,
1415
...props
1516
}): JSX.Element => {
1617
const [showCollapse, setShowCollapse] = useState<boolean | undefined>(false);
1718
const [showCollapseString, setShowCollapseString] = useState<string | undefined>('');
1819
const [statement, setStatement] = useState(false);
1920
const [collapseHeight, setCollapseHeight] = useState<string | number | undefined>(undefined);
20-
const [transition, setTransition] = useState(false);
21-
2221
const classes = clsx(
23-
transition ? 'collapsing' : 'collapse',
24-
!transition && (showCollapse || statement) && 'show',
22+
'collapsing',
23+
'collapse',
24+
(showCollapse || statement) && 'show',
2525
navbar && 'navbar-collapse',
2626
center && 'justify-content-center',
2727
className
2828
);
29-
const refCollapse = useRef<HTMLElement>(null);
29+
const collapseEl = useRef<HTMLElement>(null);
30+
const refCollapse = collapseRef ? collapseRef : collapseEl;
3031

3132
const handleResize = useCallback(() => {
3233
if (showCollapse || statement) {
@@ -38,7 +39,7 @@ const MDBCollapse: React.FC<CollapseProps> = ({
3839
if (collapseHeight === undefined && (showCollapse || statement)) {
3940
setCollapseHeight(refCollapse?.current?.scrollHeight);
4041
}
41-
}, [collapseHeight, showCollapse, statement]);
42+
}, [collapseHeight, showCollapse, statement, refCollapse]);
4243

4344
useEffect(() => {
4445
if (typeof show === 'string') {
@@ -48,17 +49,17 @@ const MDBCollapse: React.FC<CollapseProps> = ({
4849
setShowCollapse(show);
4950
}
5051

51-
if (statement || showCollapse) {
52-
setTransition(true);
53-
}
52+
// if (statement || showCollapse) {
53+
// setTransition(true);
54+
// }
5455

55-
const timer = setTimeout(() => {
56-
setTransition(false);
57-
}, 350);
56+
// const timer = setTimeout(() => {
57+
// setTransition(false);
58+
// }, 350);
5859

59-
return () => {
60-
clearTimeout(timer);
61-
};
60+
// return () => {
61+
// clearTimeout(timer);
62+
// };
6263
}, [show, showCollapse, id, showCollapseString, statement]);
6364

6465
useEffect(() => {
@@ -67,7 +68,7 @@ const MDBCollapse: React.FC<CollapseProps> = ({
6768
} else {
6869
setCollapseHeight(0);
6970
}
70-
}, [showCollapse, statement]);
71+
}, [showCollapse, statement, refCollapse]);
7172

7273
useEffect(() => {
7374
window.addEventListener('resize', handleResize);

app/src/forms/Input/Input.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const MDBInput: React.FC<InputProps> = ({
2727
btnClasses,
2828
btnOnClick,
2929
btnRef,
30+
type,
3031
onBlur,
3132
readonly,
3233
btn,
@@ -49,7 +50,13 @@ const MDBInput: React.FC<InputProps> = ({
4950
);
5051

5152
const wrapperClasses = clsx('form-outline', contrast && 'form-white', wrapperClass);
52-
const inputClasses = clsx('form-control', active && 'active', size && `form-control-${size}`, className);
53+
const inputClasses = clsx(
54+
'form-control',
55+
active && 'active',
56+
type === 'date' && 'active',
57+
size && `form-control-${size}`,
58+
className
59+
);
5360
const labelClasses = clsx('form-label', labelClass);
5461
const validationClasses = clsx(
5562
validation &&
@@ -114,6 +121,7 @@ const MDBInput: React.FC<InputProps> = ({
114121
/>
115122
) : (
116123
<input
124+
type={type}
117125
readOnly={readonly}
118126
className={inputClasses}
119127
onBlur={handleBlur}

app/src/layout/Column/Column.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const MDBCol: React.FC<ColumnProps> = React.forwardRef<HTMLAllCollection, Column
2020
start,
2121
tag: Tag,
2222
xl,
23+
xxl,
2324
xs,
2425
...props
2526
},
@@ -32,7 +33,8 @@ const MDBCol: React.FC<ColumnProps> = React.forwardRef<HTMLAllCollection, Column
3233
md && `col-md-${md}`,
3334
lg && `col-lg-${lg}`,
3435
xl && `col-xl-${xl}`,
35-
!size && !xs && !sm && !md && !lg && !xl ? 'col' : '',
36+
xxl && `col-xxl-${xxl}`,
37+
!size && !xs && !sm && !md && !lg && !xl && !xxl ? 'col' : '',
3638
order && `order-${order}`,
3739
start && 'align-self-start',
3840
center && 'align-self-center',

app/src/layout/Column/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ declare const MDBCol: React.FunctionComponent<{
1515
start?: string | boolean;
1616
tag?: React.ElementType;
1717
xl?: string;
18+
xxl?: string;
1819
xs?: string;
1920
[rest: string]: any;
2021
}>;

app/src/layout/Column/types.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type ColumnProps = {
1515
start?: string | boolean;
1616
tag?: React.ComponentProps<any>;
1717
xl?: string;
18+
xxl?: string;
1819
xs?: string;
1920
[rest: string]: any;
2021
};

app/src/methods/Ripple/Ripple.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import clsx from 'clsx';
2-
import React, { useState, useEffect } from 'react';
2+
import React, { useState, useEffect, useRef } from 'react';
33
import type { RippleProps } from './types';
44
import MDBBtn from '../../components/Button/Button';
55
import MDBRippleWave from './RippleWave/RippleWave';
66

7-
const MDBRipple: React.FC<RippleProps> = React.forwardRef<HTMLAllCollection, RippleProps>(
7+
const MDBRipple: React.FC<RippleProps> =
88
(
99
{
1010
className,
@@ -16,10 +16,12 @@ const MDBRipple: React.FC<RippleProps> = React.forwardRef<HTMLAllCollection, Rip
1616
rippleColor,
1717
children,
1818
onClick,
19+
rippleRef,
1920
...props
20-
},
21-
ref
21+
}
2222
) => {
23+
const rippleEl = useRef(null);
24+
const rippleReference = rippleRef ? rippleRef : rippleEl;
2325
const GRADIENT =
2426
'rgba({{color}}, 0.2) 0, rgba({{color}}, 0.3) 40%, rgba({{color}}, 0.4) 50%, rgba({{color}}, 0.5) 60%, rgba({{color}}, 0) 70%';
2527

@@ -159,7 +161,7 @@ const MDBRipple: React.FC<RippleProps> = React.forwardRef<HTMLAllCollection, Rip
159161
};
160162

161163
const getStyles = (e: any) => {
162-
const itemRect = e.target.getBoundingClientRect();
164+
const itemRect = rippleReference.current.getBoundingClientRect();
163165

164166
const offsetX = e.clientX - itemRect.left;
165167
const offsetY = e.clientY - itemRect.top;
@@ -219,15 +221,14 @@ const MDBRipple: React.FC<RippleProps> = React.forwardRef<HTMLAllCollection, Rip
219221
}, [rippleDuration, rippleStyles]);
220222

221223
return (
222-
<Tag className={classes} onClick={(e: any) => handleClick(e)} ref={ref} {...props}>
224+
<Tag className={classes} onClick={(e: any) => handleClick(e)} ref={rippleReference} {...props}>
223225
{children}
224226
{rippleStyles.map((item, i) => (
225227
<MDBRippleWave key={i} style={item}></MDBRippleWave>
226228
))}
227229
</Tag>
228230
);
229-
}
230-
);
231+
};
231232

232233
MDBRipple.defaultProps = { rippleTag: 'div', rippleDuration: 500, rippleRadius: 0, rippleColor: 'dark' };
233234

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ declare const MDBCol: React$1.FunctionComponent<{
2323
start?: string | boolean;
2424
tag?: React$1.ElementType;
2525
xl?: string;
26+
xxl?: string;
2627
xs?: string;
2728
[rest: string]: any;
2829
}>;

dist/mdb-react-ui-kit.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)