@festo-ui/react 7.0.0-dev.357 → 7.0.0-dev.365
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/lib/components/modals/imageGallery/ImageGallery.d.ts +2 -0
- package/lib/components/modals/imageGallery/ImageGallery.js +27 -4
- package/lib/components/modals/imageGallery/ImageGalleryPagination.js +1 -1
- package/node/lib/components/modals/imageGallery/ImageGallery.js +27 -4
- package/node/lib/components/modals/imageGallery/ImageGalleryPagination.js +1 -1
- package/package.json +1 -1
|
@@ -8,8 +8,10 @@ interface ImageGalleryProps extends ComponentPropsWithoutRef<'div'>, ModalBasePr
|
|
|
8
8
|
images: ImageGalleryItemData[];
|
|
9
9
|
thumbnailImages?: ImageGalleryItemDataBase[];
|
|
10
10
|
pagination?: boolean;
|
|
11
|
+
showScaleButton?: boolean;
|
|
11
12
|
descriptiveContent?: boolean;
|
|
12
13
|
onSlideChanged?: (index: number) => void;
|
|
14
|
+
onScaleChange?: (value: boolean) => void;
|
|
13
15
|
}
|
|
14
16
|
export declare const ImageGallery: (props: ImageGalleryProps & import("react").RefAttributes<HTMLImageElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
15
17
|
export default ImageGallery;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { forwardRef, useState } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
2
3
|
import ModalBase from '../ModalBase';
|
|
3
4
|
import BaseGallery from './BaseGallery';
|
|
4
5
|
import ImageGalleryContent from './ImageGalleryContent';
|
|
@@ -17,11 +18,14 @@ export const ImageGallery = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
17
18
|
children,
|
|
18
19
|
className,
|
|
19
20
|
pagination,
|
|
21
|
+
showScaleButton,
|
|
20
22
|
onClose,
|
|
21
23
|
onSlideChanged,
|
|
24
|
+
onScaleChange,
|
|
22
25
|
...props
|
|
23
26
|
} = _ref;
|
|
24
27
|
const [currentIndex, setCurrentIndex] = useState(startIndex + 1);
|
|
28
|
+
const [isScaled, setScaled] = useState(false);
|
|
25
29
|
function handleChange(index) {
|
|
26
30
|
setCurrentIndex(index + 1);
|
|
27
31
|
onSlideChanged?.(index);
|
|
@@ -31,6 +35,11 @@ export const ImageGallery = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
31
35
|
onClose?.();
|
|
32
36
|
}
|
|
33
37
|
const classes = getClasses(thumbnailImages, descriptiveContent, className);
|
|
38
|
+
function handleScale() {
|
|
39
|
+
const newScaled = !isScaled;
|
|
40
|
+
setScaled(newScaled);
|
|
41
|
+
onScaleChange?.(newScaled);
|
|
42
|
+
}
|
|
34
43
|
return /*#__PURE__*/_jsx(ModalBase, {
|
|
35
44
|
onClose: handleClose,
|
|
36
45
|
className: classes,
|
|
@@ -44,13 +53,27 @@ export const ImageGallery = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
44
53
|
currentIndex: currentIndex,
|
|
45
54
|
length: images.length,
|
|
46
55
|
pagination: pagination
|
|
47
|
-
}), /*#__PURE__*/_jsx("button", {
|
|
48
|
-
"aria-label": "
|
|
56
|
+
}), showScaleButton ? /*#__PURE__*/_jsx("button", {
|
|
57
|
+
"aria-label": "scale up",
|
|
49
58
|
type: "button",
|
|
50
59
|
className: "fwe-btn fwe-btn-link fwe-ml-auto",
|
|
51
|
-
onClick:
|
|
60
|
+
onClick: handleScale,
|
|
61
|
+
children: /*#__PURE__*/_jsx("i", {
|
|
62
|
+
className: cn('fwe-icon fwe-icon-lg fwe-color-white fwe-modal-image-gallery-scale', {
|
|
63
|
+
'fwe-icon-arrows-scale-down': isScaled,
|
|
64
|
+
'fwe-icon-arrows-scale-up': !isScaled
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
}) : null, /*#__PURE__*/_jsx("button", {
|
|
68
|
+
"aria-label": "close",
|
|
69
|
+
type: "button",
|
|
70
|
+
className: cn('fwe-btn fwe-btn-link', {
|
|
71
|
+
'fwe-ml-auto': !showScaleButton,
|
|
72
|
+
'fwe-ml-3': showScaleButton
|
|
73
|
+
}),
|
|
74
|
+
onClick: onClose,
|
|
52
75
|
children: /*#__PURE__*/_jsx("i", {
|
|
53
|
-
className: "fwe-icon fwe-icon-
|
|
76
|
+
className: "fwe-icon fwe-icon-2x fwe-color-white fwe-icon-menu-close fwe-modal-image-gallery-close"
|
|
54
77
|
})
|
|
55
78
|
})]
|
|
56
79
|
}), descriptiveContent ? /*#__PURE__*/_jsxs("div", {
|
|
@@ -9,7 +9,7 @@ export default function ImageGalleryPagination(_ref) {
|
|
|
9
9
|
} = _ref;
|
|
10
10
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
11
11
|
children: pagination && /*#__PURE__*/_jsxs("div", {
|
|
12
|
-
className: "fwe-pagination fwe-pagination--on-dark-bg",
|
|
12
|
+
className: "fwe-pagination fwe-pagination--on-dark-bg fwe-pagination--lining-tabular-numbers",
|
|
13
13
|
children: [/*#__PURE__*/_jsx("button", {
|
|
14
14
|
"aria-label": "previous",
|
|
15
15
|
type: "button",
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.ImageGallery = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
9
|
var _ModalBase = _interopRequireDefault(require("../ModalBase"));
|
|
9
10
|
var _BaseGallery = _interopRequireDefault(require("./BaseGallery"));
|
|
10
11
|
var _ImageGalleryContent = _interopRequireDefault(require("./ImageGalleryContent"));
|
|
@@ -22,11 +23,14 @@ const ImageGallery = exports.ImageGallery = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
22
23
|
children,
|
|
23
24
|
className,
|
|
24
25
|
pagination,
|
|
26
|
+
showScaleButton,
|
|
25
27
|
onClose,
|
|
26
28
|
onSlideChanged,
|
|
29
|
+
onScaleChange,
|
|
27
30
|
...props
|
|
28
31
|
} = _ref;
|
|
29
32
|
const [currentIndex, setCurrentIndex] = (0, _react.useState)(startIndex + 1);
|
|
33
|
+
const [isScaled, setScaled] = (0, _react.useState)(false);
|
|
30
34
|
function handleChange(index) {
|
|
31
35
|
setCurrentIndex(index + 1);
|
|
32
36
|
onSlideChanged?.(index);
|
|
@@ -36,6 +40,11 @@ const ImageGallery = exports.ImageGallery = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
36
40
|
onClose?.();
|
|
37
41
|
}
|
|
38
42
|
const classes = (0, _ImageGallery.default)(thumbnailImages, descriptiveContent, className);
|
|
43
|
+
function handleScale() {
|
|
44
|
+
const newScaled = !isScaled;
|
|
45
|
+
setScaled(newScaled);
|
|
46
|
+
onScaleChange?.(newScaled);
|
|
47
|
+
}
|
|
39
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalBase.default, {
|
|
40
49
|
onClose: handleClose,
|
|
41
50
|
className: classes,
|
|
@@ -49,13 +58,27 @@ const ImageGallery = exports.ImageGallery = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
49
58
|
currentIndex: currentIndex,
|
|
50
59
|
length: images.length,
|
|
51
60
|
pagination: pagination
|
|
52
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
53
|
-
"aria-label": "
|
|
61
|
+
}), showScaleButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
62
|
+
"aria-label": "scale up",
|
|
54
63
|
type: "button",
|
|
55
64
|
className: "fwe-btn fwe-btn-link fwe-ml-auto",
|
|
56
|
-
onClick:
|
|
65
|
+
onClick: handleScale,
|
|
66
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
67
|
+
className: (0, _classnames.default)('fwe-icon fwe-icon-lg fwe-color-white fwe-modal-image-gallery-scale', {
|
|
68
|
+
'fwe-icon-arrows-scale-down': isScaled,
|
|
69
|
+
'fwe-icon-arrows-scale-up': !isScaled
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
73
|
+
"aria-label": "close",
|
|
74
|
+
type: "button",
|
|
75
|
+
className: (0, _classnames.default)('fwe-btn fwe-btn-link', {
|
|
76
|
+
'fwe-ml-auto': !showScaleButton,
|
|
77
|
+
'fwe-ml-3': showScaleButton
|
|
78
|
+
}),
|
|
79
|
+
onClick: onClose,
|
|
57
80
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
58
|
-
className: "fwe-icon fwe-icon-
|
|
81
|
+
className: "fwe-icon fwe-icon-2x fwe-color-white fwe-icon-menu-close fwe-modal-image-gallery-close"
|
|
59
82
|
})
|
|
60
83
|
})]
|
|
61
84
|
}), descriptiveContent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -13,7 +13,7 @@ function ImageGalleryPagination(_ref) {
|
|
|
13
13
|
} = _ref;
|
|
14
14
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
15
15
|
children: pagination && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
16
|
-
className: "fwe-pagination fwe-pagination--on-dark-bg",
|
|
16
|
+
className: "fwe-pagination fwe-pagination--on-dark-bg fwe-pagination--lining-tabular-numbers",
|
|
17
17
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
18
18
|
"aria-label": "previous",
|
|
19
19
|
type: "button",
|