@evergis/uilib-gl 1.0.99 → 1.0.101
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IPreviewImage, ImageSlideShowType } from "../types";
|
|
2
|
-
export declare const useImageSlideShow: (images: IPreviewImage[]) => ImageSlideShowType;
|
|
2
|
+
export declare const useImageSlideShow: (images: IPreviewImage[], initialIndex?: number) => ImageSlideShowType;
|
package/dist/uilib-gl.esm.js
CHANGED
|
@@ -19849,25 +19849,27 @@ const DropdownField = /*#__PURE__*/styled.div.attrs(props => ({
|
|
|
19849
19849
|
border-color: ${_ref4 => {
|
|
19850
19850
|
let {
|
|
19851
19851
|
theme: {
|
|
19852
|
-
input
|
|
19852
|
+
input,
|
|
19853
|
+
palette
|
|
19853
19854
|
},
|
|
19854
19855
|
error,
|
|
19855
19856
|
active,
|
|
19856
19857
|
focused
|
|
19857
19858
|
} = _ref4;
|
|
19858
|
-
return error ? input.error : active ?
|
|
19859
|
+
return error ? input.error : active ? palette.primary : focused ? input.hoverBorderColor : "";
|
|
19859
19860
|
}};
|
|
19860
19861
|
|
|
19861
19862
|
:hover {
|
|
19862
19863
|
border-color: ${_ref5 => {
|
|
19863
19864
|
let {
|
|
19864
19865
|
theme: {
|
|
19865
|
-
input
|
|
19866
|
+
input,
|
|
19867
|
+
palette
|
|
19866
19868
|
},
|
|
19867
19869
|
error,
|
|
19868
19870
|
active
|
|
19869
19871
|
} = _ref5;
|
|
19870
|
-
return error ? input.error : active ?
|
|
19872
|
+
return error ? input.error : active ? palette.primary : input.hoverBorderColor;
|
|
19871
19873
|
}};
|
|
19872
19874
|
}
|
|
19873
19875
|
`;
|
|
@@ -27284,8 +27286,12 @@ const PreviewSlideShow = /*#__PURE__*/memo(_ref => {
|
|
|
27284
27286
|
})));
|
|
27285
27287
|
});
|
|
27286
27288
|
|
|
27287
|
-
const useImageSlideShow = images
|
|
27288
|
-
|
|
27289
|
+
const useImageSlideShow = function (images, initialIndex) {
|
|
27290
|
+
if (initialIndex === void 0) {
|
|
27291
|
+
initialIndex = 0;
|
|
27292
|
+
}
|
|
27293
|
+
|
|
27294
|
+
const [chosenImageIndex, setChosenImageIndex] = useState(initialIndex);
|
|
27289
27295
|
const [fullscreen, setFullscreen] = useState(false);
|
|
27290
27296
|
const chosenImage = useMemo(() => images[chosenImageIndex], [chosenImageIndex, images]);
|
|
27291
27297
|
const prev = useCallback(() => {
|
|
@@ -27319,6 +27325,7 @@ const useImageSlideShow = images => {
|
|
|
27319
27325
|
const PreviewComponent = _ref => {
|
|
27320
27326
|
let {
|
|
27321
27327
|
images = [],
|
|
27328
|
+
initialIndex = 0,
|
|
27322
27329
|
isOpen,
|
|
27323
27330
|
root,
|
|
27324
27331
|
onClose,
|
|
@@ -27338,7 +27345,7 @@ const PreviewComponent = _ref => {
|
|
|
27338
27345
|
prev,
|
|
27339
27346
|
next,
|
|
27340
27347
|
toggleFullscreen
|
|
27341
|
-
}] = useImageSlideShow(images);
|
|
27348
|
+
}] = useImageSlideShow(images, initialIndex);
|
|
27342
27349
|
const [failedSrcs, setFailedSrcs] = useState({});
|
|
27343
27350
|
const handleImageError = useCallback(src => {
|
|
27344
27351
|
if (!src) return;
|