Skip to content

Commit 102bc00

Browse files
author
unknown
committed
1.2.0
1 parent 1e8eb6c commit 102bc00

File tree

12 files changed

+33
-14
lines changed

12 files changed

+33
-14
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 1.1.0
3+
Version: FREE 1.2.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": "1.1.0",
3+
"version": "1.2.0",
44
"main": "index.js",
55
"repository": {
66
"type": "git",

app/src/components/Carousel/Carousel.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import MDBCarouselControl from './CarouselControl/CarouselControl';
55
import MDBCarouselIndicatorItem from './CarouselIndicatorItem/CarouselIndicatorItem';
66
import { CarouselContext } from './CarouselContext';
77
const MDBCarousel: React.FC<CarouselProps> = ({
8+
asyncData,
89
fade,
910
className,
1011
dark,
@@ -120,10 +121,14 @@ const MDBCarousel: React.FC<CarouselProps> = ({
120121
}, [activeInterval, setNext, startInterval]);
121122

122123
useEffect(() => {
123-
const carouselImgList = carouselReference.current.querySelectorAll('.carousel-item-react img');
124+
if (asyncData) {
125+
setImagesCount(asyncData.length - 1);
126+
} else {
127+
const carouselImgList = carouselReference.current.querySelectorAll('.carousel-item-react img');
124128

125-
setImagesCount(carouselImgList.length - 1);
126-
}, [carouselReference, showIndicators]);
129+
setImagesCount(carouselImgList.length - 1);
130+
}
131+
}, [carouselReference, showIndicators, asyncData]);
127132

128133
const startTouch = (e: TouchEvent) => {
129134
touch && setClientTouch({ initialX: e.touches[0].clientX, initialY: e.touches[0].clientY });

app/src/components/Carousel/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22

33
declare const MDBCarousel: React.FunctionComponent<{
4+
asyncData?: any;
45
activeItem?: number;
56
className?: string;
67
fade?: boolean;

app/src/components/Carousel/types.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22

33
type CarouselProps = {
4+
asyncData?: any;
45
activeItem?: number;
56
className?: string;
67
fade?: boolean;

app/src/navigation/Scrollspy/Scrollspy.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import clsx from 'clsx';
21
import React, { useEffect, useCallback } from 'react';
32
import type { ScrollspyProps } from './types';
43

app/src/navigation/Scrollspy/ScrollspyNavList/ScrollspyNavList.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ import React from 'react';
33
import type { ScrollspyNavListProps } from './types';
44

55
const MDBScrollspyNavList: React.FC<ScrollspyNavListProps> = React.forwardRef<HTMLAllCollection, ScrollspyNavListProps>(
6-
({ className, tag: Tag, children, ...props }, ref) => {
6+
({ className, collapsible, active, tag: Tag, children, ...props }, ref) => {
77
const classes = clsx('nav', className);
88

99
return (
10-
<Tag className={classes} ref={ref} {...props}>
10+
<Tag
11+
className={classes}
12+
ref={ref}
13+
{...props}
14+
style={{
15+
overflow: collapsible && 'hidden',
16+
height: collapsible && (active ? '46px' : '0px'),
17+
transition: collapsible && 'height .5s ease',
18+
flexWrap: collapsible && 'nowrap',
19+
}}
20+
>
1121
{children}
1222
</Tag>
1323
);

app/src/navigation/Scrollspy/ScrollspyNavlink/ScrollspyNavlink.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React from 'react';
33
import type { ScrollspyNavLinkProps } from './types';
44

55
const MDBScrollspyNavLink: React.FC<ScrollspyNavLinkProps> = React.forwardRef<HTMLAllCollection, ScrollspyNavLinkProps>(
6-
({ className, scrollElement, active, tag: Tag, children, ...props }, ref) => {
7-
const classes = clsx('nav-link', className, active && 'active');
6+
({ className, collapsible, scrollElement, active, tag: Tag, children, ...props }, ref) => {
7+
const classes = clsx('nav-link', collapsible && 'collapsible-scrollspy', className, active && 'active');
88

99
const handleClick = (element: any) => {
1010
element.scrollIntoView({ behavior: 'smooth' });
@@ -16,7 +16,9 @@ const MDBScrollspyNavLink: React.FC<ScrollspyNavLinkProps> = React.forwardRef<HT
1616
ref={ref}
1717
{...props}
1818
onClick={() => handleClick(scrollElement)}
19-
style={{ cursor: 'pointer' }}
19+
style={{
20+
cursor: 'pointer',
21+
}}
2022
>
2123
{children}
2224
</Tag>

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ declare const MDBTabsPane: React$1.FunctionComponent<{
819819
}>;
820820

821821
declare const MDBCarousel: React$1.FunctionComponent<{
822+
asyncData?: any;
822823
activeItem?: number;
823824
className?: string;
824825
fade?: boolean;

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.

dist/mdb-react-ui-kit.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.

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",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"main": "./dist/mdb-react-ui-kit.js",
55
"module": "./dist/mdb-react-ui-kit.esm.js",
66
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)