@festo-ui/react 9.0.0-dev.723 → 9.0.0-dev.724
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/components/modals/image-gallery/ImageGallery.css +10 -0
- package/dist/components/modals/image-gallery/ImageGallery.d.ts +2 -2
- package/dist/components/modals/image-gallery/ImageGallery.js +3 -3
- package/dist/components/modals/image-gallery/ImageGallery.stories.helper.js +1 -1
- package/dist/components/modals/image-gallery/ImageGallerySwiper.d.ts +3 -2
- package/dist/components/modals/image-gallery/ImageGallerySwiper.js +13 -3
- package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.d.ts +3 -2
- package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.js +13 -3
- package/dist/components/modals/image-gallery/internal/BaseGallery.d.ts +4 -6
- package/dist/components/modals/image-gallery/internal/BaseGallery.js +2 -17
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/package.json +1 -1
- package/dist/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.css +0 -10
- package/dist/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.d.ts +0 -11
- package/dist/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js +0 -24
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './ImageGallery.scss';
|
|
2
2
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { type ModalBaseProps } from '../ModalBase';
|
|
4
|
-
import { type ImageGalleryItemData
|
|
4
|
+
import { type ImageGalleryItemData } from './internal/BaseGallery';
|
|
5
5
|
export interface ImageGalleryProps extends ComponentPropsWithoutRef<'div'>, ModalBaseProps {
|
|
6
6
|
/** Index number of initial slide. */
|
|
7
7
|
startIndex: number;
|
|
8
8
|
images?: ImageGalleryItemData[];
|
|
9
|
-
thumbnailImages?:
|
|
9
|
+
thumbnailImages?: ImageGalleryItemData[];
|
|
10
10
|
/** Whether to show pagination controls. Can also accept a number in case images are passed as children */
|
|
11
11
|
pagination?: boolean | number;
|
|
12
12
|
showScaleButton?: boolean;
|
|
@@ -62,9 +62,9 @@ const ImageGallery = /*#__PURE__*/ forwardRef(({ isOpen, startIndex, images, thu
|
|
|
62
62
|
onSlideChanged: handleChange,
|
|
63
63
|
children: children
|
|
64
64
|
}),
|
|
65
|
-
images &&
|
|
66
|
-
imageContent: images?.[currentIndex - 1]?.
|
|
67
|
-
})
|
|
65
|
+
images && hasDescriptiveContent && /*#__PURE__*/ jsx(ImageGalleryContent, {
|
|
66
|
+
imageContent: images?.[currentIndex - 1]?.imageContent
|
|
67
|
+
}),
|
|
68
68
|
'function' == typeof descriptiveContent ? descriptiveContent?.(currentIndex - 1) : null
|
|
69
69
|
]
|
|
70
70
|
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ImageGalleryItemData } from './internal/BaseGallery';
|
|
1
2
|
interface ImageGallerySwiperProps {
|
|
2
|
-
|
|
3
|
+
readonly images?: ImageGalleryItemData[];
|
|
3
4
|
}
|
|
4
|
-
export declare function ImageGallerySwiper({
|
|
5
|
+
export declare function ImageGallerySwiper({ images }: ImageGallerySwiperProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export declare namespace ImageGallerySwiper {
|
|
6
7
|
var displayName: string;
|
|
7
8
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
2
3
|
import { useContext } from "react";
|
|
3
4
|
import { Navigation, Thumbs } from "swiper/modules";
|
|
4
|
-
import { Swiper } from "swiper/react";
|
|
5
|
+
import { Swiper, SwiperSlide } from "swiper/react";
|
|
5
6
|
import { ImageGalleryContext } from "./ImageGalleryContext.js";
|
|
6
|
-
function ImageGallerySwiper({
|
|
7
|
+
function ImageGallerySwiper({ images }) {
|
|
7
8
|
const { thumbsSwiper, startIndex, onSlideChanged } = useContext(ImageGalleryContext);
|
|
8
9
|
return /*#__PURE__*/ jsx(Swiper, {
|
|
9
10
|
initialSlide: startIndex,
|
|
@@ -22,7 +23,16 @@ function ImageGallerySwiper({ children }) {
|
|
|
22
23
|
className: "gallery-swiper fwe-image-gallery",
|
|
23
24
|
spaceBetween: 0,
|
|
24
25
|
onSlideChange: (slider)=>onSlideChanged?.(slider.activeIndex),
|
|
25
|
-
children:
|
|
26
|
+
children: images?.map(({ containMode, alt, imageContent, ...image })=>/*#__PURE__*/ jsx(SwiperSlide, {
|
|
27
|
+
zoom: containMode,
|
|
28
|
+
children: /*#__PURE__*/ jsx("img", {
|
|
29
|
+
...image,
|
|
30
|
+
className: classnames(image.className, {
|
|
31
|
+
'fr-image-gallery-item-contain': containMode
|
|
32
|
+
}),
|
|
33
|
+
alt: alt
|
|
34
|
+
})
|
|
35
|
+
}, image.src))
|
|
26
36
|
});
|
|
27
37
|
}
|
|
28
38
|
ImageGallerySwiper.displayName = 'Swiper';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ImageGalleryItemData } from './internal/BaseGallery';
|
|
1
2
|
interface ImageGalleryThumbsSwiperProps {
|
|
2
|
-
|
|
3
|
+
readonly images?: ImageGalleryItemData[];
|
|
3
4
|
}
|
|
4
|
-
export declare function ImageGalleryThumbsSwiper({
|
|
5
|
+
export declare function ImageGalleryThumbsSwiper({ images, }: ImageGalleryThumbsSwiperProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
2
3
|
import { useContext } from "react";
|
|
3
4
|
import { Thumbs } from "swiper/modules";
|
|
4
|
-
import { Swiper } from "swiper/react";
|
|
5
|
+
import { Swiper, SwiperSlide } from "swiper/react";
|
|
5
6
|
import { ImageGalleryContext, SwiperContext } from "./ImageGalleryContext.js";
|
|
6
|
-
function ImageGalleryThumbsSwiper({
|
|
7
|
+
function ImageGalleryThumbsSwiper({ images }) {
|
|
7
8
|
const { setThumbsSwiper } = useContext(ImageGalleryContext);
|
|
8
9
|
return /*#__PURE__*/ jsx(SwiperContext.Provider, {
|
|
9
10
|
value: "thumbs",
|
|
@@ -16,7 +17,16 @@ function ImageGalleryThumbsSwiper({ children }) {
|
|
|
16
17
|
],
|
|
17
18
|
watchSlidesProgress: true,
|
|
18
19
|
onSwiper: setThumbsSwiper,
|
|
19
|
-
children:
|
|
20
|
+
children: images?.map(({ containMode, alt, imageContent, ...image })=>/*#__PURE__*/ jsx(SwiperSlide, {
|
|
21
|
+
zoom: containMode,
|
|
22
|
+
children: /*#__PURE__*/ jsx("img", {
|
|
23
|
+
...image,
|
|
24
|
+
className: classnames(image.className, {
|
|
25
|
+
'fr-image-gallery-item-thumb-contain': containMode
|
|
26
|
+
}),
|
|
27
|
+
alt: alt
|
|
28
|
+
})
|
|
29
|
+
}, image.src))
|
|
20
30
|
})
|
|
21
31
|
});
|
|
22
32
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import type { ClassNamePropsWithChildren } from '../../../../utils/types';
|
|
3
3
|
import type { ImageDescriptiveContent } from '../ImageGalleryContent';
|
|
4
|
-
export interface ImageGalleryItemDataBase extends ComponentPropsWithoutRef<'img'>, Record<string, unknown> {
|
|
5
|
-
containMode?: boolean;
|
|
6
|
-
}
|
|
7
4
|
export type ImageGalleryItemData = {
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
imageContent?: ImageDescriptiveContent;
|
|
6
|
+
containMode?: boolean;
|
|
7
|
+
} & ComponentPropsWithoutRef<'img'> & Record<string, unknown>;
|
|
10
8
|
interface BaseGalleryProps extends ClassNamePropsWithChildren {
|
|
11
9
|
readonly images?: ImageGalleryItemData[];
|
|
12
|
-
readonly thumbnailImages?:
|
|
10
|
+
readonly thumbnailImages?: ImageGalleryItemData[];
|
|
13
11
|
readonly onSlideChanged?: (value: number) => void;
|
|
14
12
|
readonly startIndex?: number;
|
|
15
13
|
}
|
|
@@ -3,7 +3,6 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { ImageGalleryContext } from "../ImageGalleryContext.js";
|
|
4
4
|
import { ImageGallerySwiper } from "../ImageGallerySwiper.js";
|
|
5
5
|
import { ImageGalleryThumbsSwiper } from "../ImageGalleryThumbsSwiper.js";
|
|
6
|
-
import { ImageGalleryItem } from "../image-gallery-item/ImageGalleryItem.js";
|
|
7
6
|
function BaseGallery({ images, thumbnailImages, onSlideChanged, startIndex, children }) {
|
|
8
7
|
const [thumbsSwiper, setThumbsSwiper] = useState(null);
|
|
9
8
|
const contextValue = useMemo(()=>({
|
|
@@ -23,24 +22,10 @@ function BaseGallery({ images, thumbnailImages, onSlideChanged, startIndex, chil
|
|
|
23
22
|
children: children || /*#__PURE__*/ jsxs(Fragment, {
|
|
24
23
|
children: [
|
|
25
24
|
/*#__PURE__*/ jsx(ImageGallerySwiper, {
|
|
26
|
-
|
|
27
|
-
containMode: containMode,
|
|
28
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
29
|
-
...image,
|
|
30
|
-
className: image.className,
|
|
31
|
-
alt: alt
|
|
32
|
-
})
|
|
33
|
-
}, image.src))
|
|
25
|
+
images: images
|
|
34
26
|
}),
|
|
35
27
|
thumbnailImages && /*#__PURE__*/ jsx(ImageGalleryThumbsSwiper, {
|
|
36
|
-
|
|
37
|
-
containMode: containMode,
|
|
38
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
39
|
-
...image,
|
|
40
|
-
className: image.className,
|
|
41
|
-
alt: alt
|
|
42
|
-
})
|
|
43
|
-
}, image.src))
|
|
28
|
+
images: thumbnailImages
|
|
44
29
|
})
|
|
45
30
|
]
|
|
46
31
|
})
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export { ImageGallery } from './components/modals/image-gallery/ImageGallery';
|
|
|
23
23
|
export { ImageGalleryContent } from './components/modals/image-gallery/ImageGalleryContent';
|
|
24
24
|
export { ImageGallerySwiper } from './components/modals/image-gallery/ImageGallerySwiper';
|
|
25
25
|
export { ImageGalleryThumbsSwiper } from './components/modals/image-gallery/ImageGalleryThumbsSwiper';
|
|
26
|
-
export { ImageGalleryItem } from './components/modals/image-gallery/image-gallery-item/ImageGalleryItem';
|
|
27
26
|
export { ModalBase, type ModalBaseProps, } from './components/modals/ModalBase';
|
|
28
27
|
export { Prompt, type PromptProps } from './components/modals/Prompt';
|
|
29
28
|
export { Pagination, type PaginationProps, PaginationType, } from './components/pagination/Pagination';
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,6 @@ import { ImageGallery } from "./components/modals/image-gallery/ImageGallery.js"
|
|
|
23
23
|
import { ImageGalleryContent } from "./components/modals/image-gallery/ImageGalleryContent.js";
|
|
24
24
|
import { ImageGallerySwiper } from "./components/modals/image-gallery/ImageGallerySwiper.js";
|
|
25
25
|
import { ImageGalleryThumbsSwiper } from "./components/modals/image-gallery/ImageGalleryThumbsSwiper.js";
|
|
26
|
-
import { ImageGalleryItem } from "./components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js";
|
|
27
26
|
import { ModalBase } from "./components/modals/ModalBase.js";
|
|
28
27
|
import { Prompt } from "./components/modals/Prompt.js";
|
|
29
28
|
import { Pagination, PaginationType } from "./components/pagination/Pagination.js";
|
|
@@ -57,4 +56,4 @@ import { Switch } from "./forms/switch/Switch.js";
|
|
|
57
56
|
import { TextArea } from "./forms/text-area/TextArea.js";
|
|
58
57
|
import { TextInput } from "./forms/text-input/TextInput.js";
|
|
59
58
|
import { TimePicker } from "./forms/time-picker/TimePicker.js";
|
|
60
|
-
export { Accordion, AccordionHeader, AccordionItem, AccordionItemBody, AccordionItemHeader, AlertModal, Breadcrumb, Button, Card, CardBody, CardHeader, CardNotification, Checkbox, Chip, ChipContainer, ChipType, ConfirmModal, CustomModal, ImageGallery, ImageGalleryContent,
|
|
59
|
+
export { Accordion, AccordionHeader, AccordionItem, AccordionItemBody, AccordionItemHeader, AlertModal, Breadcrumb, Button, Card, CardBody, CardHeader, CardNotification, Checkbox, Chip, ChipContainer, ChipType, ConfirmModal, CustomModal, ImageGallery, ImageGalleryContent, ImageGallerySwiper, ImageGalleryThumbsSwiper, LinkButton, LoadingIndicator, MobileFlyout, MobileFlyoutItem, MobileFlyoutPage, ModalBase, Pagination, PaginationType, Popover, PopoverMenu, PopoverMenuContext, PopoverMenuItem, Progress, Prompt, RadioButton, RadioGroup, SearchInput, SearchSuggestion, Segment, SegmentControl, Select, SelectOption, Slider, Snackbar, SnackbarProvider, StepHorizontal, StepVertical, StepperHorizontal, StepperVertical, Switch, TabPane, TableHeaderCell, Tabs, TextArea, TextInput, TimePicker, Tooltip, addSnackbar, useSnackbar };
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type SwiperSlideProps } from 'swiper/react';
|
|
2
|
-
import './ImageGalleryItem.scss';
|
|
3
|
-
interface ImageGalleryItemProps extends SwiperSlideProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
containMode?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function ImageGalleryItem({ children, containMode, className, ...props }: ImageGalleryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare namespace ImageGalleryItem {
|
|
9
|
-
var displayName: string;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { SwiperSlide } from "swiper/react";
|
|
4
|
-
import "./ImageGalleryItem.css";
|
|
5
|
-
import { useContext } from "react";
|
|
6
|
-
import { SwiperContext } from "../ImageGalleryContext.js";
|
|
7
|
-
function ImageGalleryItem({ children, containMode, className, ...props }) {
|
|
8
|
-
const swiperType = useContext(SwiperContext);
|
|
9
|
-
const isThumbsSwiper = 'thumbs' === swiperType;
|
|
10
|
-
return /*#__PURE__*/ jsx(SwiperSlide, {
|
|
11
|
-
...props,
|
|
12
|
-
className: classnames(className, {
|
|
13
|
-
'fr-image-gallery-item--contain': containMode && isThumbsSwiper
|
|
14
|
-
}),
|
|
15
|
-
children: isThumbsSwiper ? children : /*#__PURE__*/ jsx("div", {
|
|
16
|
-
className: classnames('swiper-zoom-container', {
|
|
17
|
-
'fr-image-gallery-item--contain': containMode
|
|
18
|
-
}),
|
|
19
|
-
children: children
|
|
20
|
-
})
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
ImageGalleryItem.displayName = 'SwiperSlide';
|
|
24
|
-
export { ImageGalleryItem };
|