infinity-forge 8.3.9 → 8.4.0
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,4 +1,4 @@
|
|
|
1
|
-
import { CarouselProps } from './interfaces.js';
|
|
1
|
+
import { ActionsCarousel, CarouselProps } from './interfaces.js';
|
|
2
2
|
export declare function useCarousel<T = any>({ id, items, Component, config }: CarouselProps<T>): {
|
|
3
3
|
Carousel: () => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
Prev: ({ children }: {
|
|
@@ -7,7 +7,5 @@ export declare function useCarousel<T = any>({ id, items, Component, config }: C
|
|
|
7
7
|
Next: ({ children }: {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
actions:
|
|
11
|
-
slideTo: (index: number) => void;
|
|
12
|
-
};
|
|
10
|
+
actions: ActionsCarousel;
|
|
13
11
|
};
|
|
@@ -46,12 +46,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
exports.useCarousel = useCarousel;
|
|
48
48
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
+
var react_1 = require("react");
|
|
49
50
|
var ui_1 = require("../../../ui/index.js");
|
|
50
51
|
var swiper_1 = require("./carousel-lib/react/swiper.js");
|
|
51
52
|
var swiper_slide_1 = require("./carousel-lib/react/swiper-slide.js");
|
|
52
53
|
var index_1 = require("./carousel-lib/modules/index.js");
|
|
53
54
|
var S = __importStar(require("./styles.js"));
|
|
54
|
-
var react_1 = require("react");
|
|
55
55
|
function useCarousel(_a) {
|
|
56
56
|
var id = _a.id, items = _a.items, Component = _a.Component, config = _a.config;
|
|
57
57
|
var nextUID = 'next' + id;
|
|
@@ -67,12 +67,6 @@ function useCarousel(_a) {
|
|
|
67
67
|
var children = _a.children;
|
|
68
68
|
return ((0, jsx_runtime_1.jsx)("button", { type: 'button', className: nextUID, children: children }));
|
|
69
69
|
}
|
|
70
|
-
function Carousel() {
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(S.Carousel, { children: (0, jsx_runtime_1.jsx)(SwiperLib, __assign({}, config, { ref: swiperRef, modules: [index_1.Pagination, index_1.Autoplay, index_1.Navigation, index_1.Virtual, index_1.EffectFade, index_1.Grid], navigation: {
|
|
72
|
-
nextEl: '.' + nextUID,
|
|
73
|
-
prevEl: '.' + prevUID,
|
|
74
|
-
}, children: items.map(function (item) { return ((0, jsx_runtime_1.jsx)(SwiperSlideLib, { children: (0, jsx_runtime_1.jsx)(Component, __assign({}, item)) }, item.id || (0, ui_1.uid)(11, true))); }) })) }));
|
|
75
|
-
}
|
|
76
70
|
var actions = {
|
|
77
71
|
slideTo: function (index) {
|
|
78
72
|
if (swiperRef.current) {
|
|
@@ -80,6 +74,12 @@ function useCarousel(_a) {
|
|
|
80
74
|
}
|
|
81
75
|
},
|
|
82
76
|
};
|
|
77
|
+
function Carousel() {
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(S.Carousel, { children: (0, jsx_runtime_1.jsx)(SwiperLib, __assign({}, config, { ref: swiperRef, modules: [index_1.Pagination, index_1.Autoplay, index_1.Navigation, index_1.Virtual, index_1.EffectFade, index_1.Grid], navigation: {
|
|
79
|
+
nextEl: '.' + nextUID,
|
|
80
|
+
prevEl: '.' + prevUID,
|
|
81
|
+
}, children: items.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(SwiperSlideLib, { children: (0, jsx_runtime_1.jsx)(Component, __assign({}, item, actions, { index: index })) }, item.id || (0, ui_1.uid)(11, true))); }) })) }));
|
|
82
|
+
}
|
|
83
83
|
return {
|
|
84
84
|
Carousel: Carousel,
|
|
85
85
|
Prev: Prev,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/components/carousel/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAG,EAAE,SAAS,EACd,OAAO,EAAE,CAAC,kBAAU,EAAE,gBAAQ,EAAE,kBAAU,EAAE,eAAO,EAAE,kBAAU,EAAE,YAAI,CAAC,EACtE,UAAU,EAAE;oBACV,MAAM,EAAE,GAAG,GAAG,OAAO;oBACrB,MAAM,EAAE,GAAG,GAAG,OAAO;iBACtB,YAEA,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,CAC1B,uBAAC,cAAc,cACb,uBAAC,SAAS,eAAK,IAAI,EAAM,OAAO,IAAE,KAAK,EAAE,KAAK,IAAI,IAD9B,IAAY,CAAC,EAAE,IAAI,IAAA,QAAG,EAAC,EAAE,EAAE,IAAI,CAAC,CAErC,CAClB,EAJ2B,CAI3B,CAAC,IACQ,GACD,CACd,CAAA;IACH,CAAC;IAED,OAAO;QACL,QAAQ,UAAA;QACR,IAAI,MAAA;QACJ,IAAI,MAAA;QACJ,OAAO,SAAA;KACR,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { SwiperOptions } from "./carousel-lib/types/index.js";
|
|
2
|
+
export type ActionsCarousel = {
|
|
3
|
+
slideTo: (index: number) => void;
|
|
4
|
+
};
|
|
2
5
|
export interface CarouselProps<T = any> {
|
|
3
6
|
id: string;
|
|
4
7
|
items: T[];
|
|
5
8
|
config?: SwiperOptions;
|
|
6
|
-
Component: React.ComponentType<T
|
|
9
|
+
Component: React.ComponentType<T & ActionsCarousel & {
|
|
10
|
+
index: number;
|
|
11
|
+
}>;
|
|
7
12
|
}
|