@dgui/react-web-shared 1.7.6-next.1 → 1.8.0-next.1
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/cjs/Generics/WebBaseCarousel/WebBaseCarousel.js +46 -0
- package/dist/cjs/Generics/WebBaseCarousel/WebBaseCarousel.js.map +1 -0
- package/dist/cjs/Generics/WebBaseCarousel/WebBaseHorse.js +27 -0
- package/dist/cjs/Generics/WebBaseCarousel/WebBaseHorse.js.map +1 -0
- package/dist/cjs/Generics/WebBaseCarousel/index.js +3 -0
- package/dist/cjs/Generics/WebBaseCarousel/index.js.map +1 -0
- package/dist/cjs/Generics/WebBaseGateway/WebBaseGateway.js +17 -0
- package/dist/cjs/Generics/WebBaseGateway/WebBaseGateway.js.map +1 -0
- package/dist/cjs/Generics/WebBaseGateway/WebBaseGatewayContext.js +5 -0
- package/dist/cjs/Generics/WebBaseGateway/WebBaseGatewayContext.js.map +1 -0
- package/dist/cjs/Generics/WebBaseGateway/WebBaseGatewayProvider.js +35 -0
- package/dist/cjs/Generics/WebBaseGateway/WebBaseGatewayProvider.js.map +1 -0
- package/dist/cjs/Generics/WebBaseGateway/index.js +4 -0
- package/dist/cjs/Generics/WebBaseGateway/index.js.map +1 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/Generics/WebBaseCarousel/WebBaseCarousel.js +46 -0
- package/dist/esm/Generics/WebBaseCarousel/WebBaseCarousel.js.map +1 -0
- package/dist/esm/Generics/WebBaseCarousel/WebBaseHorse.js +27 -0
- package/dist/esm/Generics/WebBaseCarousel/WebBaseHorse.js.map +1 -0
- package/dist/esm/Generics/WebBaseCarousel/index.js +3 -0
- package/dist/esm/Generics/WebBaseCarousel/index.js.map +1 -0
- package/dist/esm/Generics/WebBaseGateway/WebBaseGateway.js +17 -0
- package/dist/esm/Generics/WebBaseGateway/WebBaseGateway.js.map +1 -0
- package/dist/esm/Generics/WebBaseGateway/WebBaseGatewayContext.js +5 -0
- package/dist/esm/Generics/WebBaseGateway/WebBaseGatewayContext.js.map +1 -0
- package/dist/esm/Generics/WebBaseGateway/WebBaseGatewayProvider.js +35 -0
- package/dist/esm/Generics/WebBaseGateway/WebBaseGatewayProvider.js.map +1 -0
- package/dist/esm/Generics/WebBaseGateway/index.js +4 -0
- package/dist/esm/Generics/WebBaseGateway/index.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +21 -18
- package/dist/Generics/WebBaseCarousel/WebBaseCarousel.js +0 -50
- package/dist/Generics/WebBaseCarousel/WebBaseCarousel.js.map +0 -1
- package/dist/Generics/WebBaseCarousel/WebBaseHorse.js +0 -26
- package/dist/Generics/WebBaseCarousel/WebBaseHorse.js.map +0 -1
- package/dist/Generics/WebBaseCarousel/index.js +0 -11
- package/dist/Generics/WebBaseCarousel/index.js.map +0 -1
- package/dist/Generics/WebBaseGateway/WebBaseGateway.js +0 -23
- package/dist/Generics/WebBaseGateway/WebBaseGateway.js.map +0 -1
- package/dist/Generics/WebBaseGateway/WebBaseGatewayContext.js +0 -7
- package/dist/Generics/WebBaseGateway/WebBaseGatewayContext.js.map +0 -1
- package/dist/Generics/WebBaseGateway/WebBaseGatewayProvider.js +0 -48
- package/dist/Generics/WebBaseGateway/WebBaseGatewayProvider.js.map +0 -1
- package/dist/Generics/WebBaseGateway/index.js +0 -13
- package/dist/Generics/WebBaseGateway/index.js.map +0 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- /package/dist/{Generics → esm/Generics}/WebBaseCarousel/WebBaseCarousel.d.ts +0 -0
- /package/dist/{Generics → esm/Generics}/WebBaseCarousel/WebBaseHorse.d.ts +0 -0
- /package/dist/{Generics → esm/Generics}/WebBaseCarousel/index.d.ts +0 -0
- /package/dist/{Generics → esm/Generics}/WebBaseGateway/WebBaseGateway.d.ts +0 -0
- /package/dist/{Generics → esm/Generics}/WebBaseGateway/WebBaseGatewayContext.d.ts +0 -0
- /package/dist/{Generics → esm/Generics}/WebBaseGateway/WebBaseGatewayProvider.d.ts +0 -0
- /package/dist/{Generics → esm/Generics}/WebBaseGateway/index.d.ts +0 -0
- /package/dist/{index.d.ts → esm/index.d.ts} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { Swiper } from 'swiper/react';
|
|
4
|
+
const SLIDES_PER_VIEW = 1;
|
|
5
|
+
const SPACE_BETWEEN = 0;
|
|
6
|
+
const styles = {
|
|
7
|
+
slideContainer: {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
height: '100%',
|
|
10
|
+
width: '100%'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const modules = [];
|
|
14
|
+
const WebBaseCarousel = ({ children, onSelectTab, style: givenStyle, swipe, tabIndex = 0 }) => {
|
|
15
|
+
const style = useMemo(() => {
|
|
16
|
+
return {
|
|
17
|
+
...styles.slideContainer,
|
|
18
|
+
...givenStyle
|
|
19
|
+
};
|
|
20
|
+
}, [
|
|
21
|
+
givenStyle
|
|
22
|
+
]);
|
|
23
|
+
const handleSlideChange = useCallback((swiper) => {
|
|
24
|
+
if (onSelectTab) {
|
|
25
|
+
onSelectTab(swiper.activeIndex);
|
|
26
|
+
}
|
|
27
|
+
}, [
|
|
28
|
+
onSelectTab
|
|
29
|
+
]);
|
|
30
|
+
const swiperInstance = useRef(null);
|
|
31
|
+
const handleSwiper = useCallback((swiper) => {
|
|
32
|
+
swiperInstance.current = swiper;
|
|
33
|
+
}, []);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (swiperInstance.current) {
|
|
36
|
+
swiperInstance.current.slideTo(tabIndex);
|
|
37
|
+
}
|
|
38
|
+
}, [
|
|
39
|
+
tabIndex
|
|
40
|
+
]);
|
|
41
|
+
return (_jsx(Swiper, { allowTouchMove: swipe ?? true, initialSlide: tabIndex, modules: modules, onSlideChange: handleSlideChange, onSwiper: handleSwiper, slidesPerView: SLIDES_PER_VIEW, spaceBetween: SPACE_BETWEEN, style: style, children: children }));
|
|
42
|
+
};
|
|
43
|
+
WebBaseCarousel.displayName = 'WebBaseCarousel';
|
|
44
|
+
export default WebBaseCarousel;
|
|
45
|
+
export { default as WebBaseHorse } from './WebBaseHorse';
|
|
46
|
+
//# sourceMappingURL=WebBaseCarousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseCarousel.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseCarousel/WebBaseCarousel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAGL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,MAAM,EACP,MAAM,cAAc,CAAC;AAMtB,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,MAAM,MAAM,GAAG;IACb,cAAc,EAAE;QACd,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,OAAO,GAAmB,EAAE,CAAC;AAEnC,MAAM,eAAe,GAA4C,CAAC,EAChE,QAAQ,EACR,WAAW,EACX,KAAK,EAAE,UAAU,EACjB,KAAK,EACL,QAAQ,GAAG,CAAC,EACb,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;QACH,OAAO;YACL,GAAG,MAAM,CAAC,cAAc;YACxB,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,EACD;QACE,UAAU;KACX,CACF,CAAC;IAEF,MAAM,iBAAiB,GAAG,WAAW,CACnC,CACE,MAAmB,EACnB,EAAE;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,EAED;QACE,WAAW;KACZ,CACF,CAAC;IAEF,MAAM,cAAc,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,WAAW,CAC9B,CACE,MAAmB,EACnB,EAAE;QACF,cAAc,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,CAAC,EACD,EAAE,CACH,CAAC;IAEF,SAAS,CACP,GAAG,EAAE;QACH,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YAC3B,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EACD;QACE,QAAQ;KACT,CACF,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,cAAc,EAAE,KAAK,IAAI,IAAI,EAC7B,YAAY,EAAE,QAAQ,EACtB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,EAC9B,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,KAAsB,YAE5B,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,eAAe,eAAe,CAAC;AAI/B,OAAO,EACL,OAAO,IAAI,YAAY,EACxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { SwiperSlide } from 'swiper/react';
|
|
4
|
+
const styles = {
|
|
5
|
+
horse: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
height: '100%',
|
|
8
|
+
width: '100%'
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const WebBaseHorse = ({ children, style: givenStyle, swipe }) => {
|
|
12
|
+
const style = useMemo(() => {
|
|
13
|
+
return {
|
|
14
|
+
...styles.horse,
|
|
15
|
+
...givenStyle
|
|
16
|
+
};
|
|
17
|
+
}, [
|
|
18
|
+
givenStyle
|
|
19
|
+
]);
|
|
20
|
+
const slide = swipe ?? true;
|
|
21
|
+
return (_jsx(SwiperSlide, { className: slide ?
|
|
22
|
+
undefined :
|
|
23
|
+
'swiper-no-swiping', style: style, children: children }));
|
|
24
|
+
};
|
|
25
|
+
WebBaseHorse.displayName = 'WebBaseHorse';
|
|
26
|
+
export default WebBaseHorse;
|
|
27
|
+
//# sourceMappingURL=WebBaseHorse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseHorse.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseCarousel/WebBaseHorse.tsx"],"names":[],"mappings":";AAGA,OAAO,EAGL,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACZ,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,YAAY,GAAyC,CAAC,EAC1D,QAAQ,EACR,KAAK,EAAE,UAAU,EACjB,KAAK,EACN,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;QACH,OAAO;YACL,GAAG,MAAM,CAAC,KAAK;YACf,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,EACD;QACE,UAAU;KACX,CACF,CAAC;IAEF,MAAM,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,WAAW,IACV,SAAS,EACP,KAAK,CAAC,CAAC;YACL,SAAS,CAAC,CAAC;YACX,mBAAmB,EAEvB,KAAK,EAAE,KAAsB,YAE5B,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseCarousel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,eAAe,EAE3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,OAAO,IAAI,YAAY,EAExB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import WebBaseGatewayContext from './WebBaseGatewayContext';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
const WebBaseGateway = ({ children, gatewayId }) => {
|
|
6
|
+
const gatewayRegistry = useContext(WebBaseGatewayContext);
|
|
7
|
+
const ref = gatewayRegistry?.refs[gatewayId]?.current;
|
|
8
|
+
if (ref) {
|
|
9
|
+
return createPortal(children, ref);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return (_jsx(_Fragment, { children: null }));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
WebBaseGateway.displayName = 'WebBaseGateway';
|
|
16
|
+
export default WebBaseGateway;
|
|
17
|
+
//# sourceMappingURL=WebBaseGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseGateway.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/WebBaseGateway.tsx"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAEL,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAEnB,MAAM,cAAc,GAA2C,CAAC,EAC9D,QAAQ,EACR,SAAS,EACV,EAAE,EAAE;IACH,MAAM,eAAe,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAE1D,MAAM,GAAG,GAAG,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEtD,IACE,GAAG,EACH,CAAC;QACD,OAAO,YAAY,CACjB,QAAQ,EAGR,GAAG,CACJ,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,4BACG,IAAI,GACJ,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseGatewayContext.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/WebBaseGatewayContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEd,MAAM,OAAO,CAAC;AAEf,MAAM,qBAAqB,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC;AAErF,qBAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE5D,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import WebBaseGatewayContext from './WebBaseGatewayContext';
|
|
3
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
4
|
+
const WebBaseGatewayProvider = ({ children }) => {
|
|
5
|
+
const [refs, setRefs] = useState({});
|
|
6
|
+
const addRef = useCallback((id, ref) => {
|
|
7
|
+
setRefs((currentRefs) => {
|
|
8
|
+
return {
|
|
9
|
+
...currentRefs,
|
|
10
|
+
[id]: ref
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}, []);
|
|
14
|
+
const removeRef = useCallback((id) => {
|
|
15
|
+
setRefs((currentRefs) => {
|
|
16
|
+
const { [id]: ref, ...filteredRefs } = currentRefs;
|
|
17
|
+
return filteredRefs;
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
20
|
+
const value = useMemo(() => {
|
|
21
|
+
return {
|
|
22
|
+
addRef,
|
|
23
|
+
refs,
|
|
24
|
+
removeRef
|
|
25
|
+
};
|
|
26
|
+
}, [
|
|
27
|
+
addRef,
|
|
28
|
+
refs,
|
|
29
|
+
removeRef
|
|
30
|
+
]);
|
|
31
|
+
return (_jsx(WebBaseGatewayContext.Provider, { value: value, children: children }));
|
|
32
|
+
};
|
|
33
|
+
WebBaseGatewayProvider.displayName = 'WebBaseGatewayProvider';
|
|
34
|
+
export default WebBaseGatewayProvider;
|
|
35
|
+
//# sourceMappingURL=WebBaseGatewayProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseGatewayProvider.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/WebBaseGatewayProvider.tsx"],"names":[],"mappings":";AAKA,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAKL,WAAW,EACX,OAAO,EACP,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,MAAM,sBAAsB,GAAmD,CAAC,EAC9E,QAAQ,EACT,EAAE,EAAE;IACH,MAAM,CACJ,IAAI,EACJ,OAAO,CACR,GAAG,QAAQ,CAET,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,WAAW,CACxB,CACE,EAAU,EACV,GAAiD,EACjD,EAAE;QACF,OAAO,CACL,CACE,WAAW,EACX,EAAE;YACF,OAAO;gBACL,GAAG,WAAW;gBACd,CAAC,EAAE,CAAC,EAAE,GAAG;aACV,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,WAAW,CAC3B,CACE,EAAU,EACV,EAAE;QACF,OAAO,CACL,CACE,WAAW,EACX,EAAE;YACF,MAAM,EAEJ,CAAC,EAAE,CAAC,EAAE,GAAG,EACT,GAAG,YAAY,EAChB,GAAG,WAAW,CAAC;YAEhB,OAAO,YAAY,CAAC;QACtB,CAAC,CACF,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;QACH,OAAO;YACL,MAAM;YACN,IAAI;YACJ,SAAS;SACV,CAAC;IACJ,CAAC,EACD;QACE,MAAM;QACN,IAAI;QACJ,SAAS;KACV,CACF,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAC7B,KAAK,EAAE,KAAK,YAEX,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAE9D,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,cAAc,EAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,OAAO,IAAI,qBAAqB,EAEjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,IAAI,sBAAsB,EAElC,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EAEb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,EACd,qBAAqB,EAGrB,sBAAsB,EAEvB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { Swiper } from 'swiper/react';
|
|
4
|
+
const SLIDES_PER_VIEW = 1;
|
|
5
|
+
const SPACE_BETWEEN = 0;
|
|
6
|
+
const styles = {
|
|
7
|
+
slideContainer: {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
height: '100%',
|
|
10
|
+
width: '100%'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const modules = [];
|
|
14
|
+
const WebBaseCarousel = ({ children, onSelectTab, style: givenStyle, swipe, tabIndex = 0 }) => {
|
|
15
|
+
const style = useMemo(() => {
|
|
16
|
+
return {
|
|
17
|
+
...styles.slideContainer,
|
|
18
|
+
...givenStyle
|
|
19
|
+
};
|
|
20
|
+
}, [
|
|
21
|
+
givenStyle
|
|
22
|
+
]);
|
|
23
|
+
const handleSlideChange = useCallback((swiper) => {
|
|
24
|
+
if (onSelectTab) {
|
|
25
|
+
onSelectTab(swiper.activeIndex);
|
|
26
|
+
}
|
|
27
|
+
}, [
|
|
28
|
+
onSelectTab
|
|
29
|
+
]);
|
|
30
|
+
const swiperInstance = useRef(null);
|
|
31
|
+
const handleSwiper = useCallback((swiper) => {
|
|
32
|
+
swiperInstance.current = swiper;
|
|
33
|
+
}, []);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (swiperInstance.current) {
|
|
36
|
+
swiperInstance.current.slideTo(tabIndex);
|
|
37
|
+
}
|
|
38
|
+
}, [
|
|
39
|
+
tabIndex
|
|
40
|
+
]);
|
|
41
|
+
return (_jsx(Swiper, { allowTouchMove: swipe ?? true, initialSlide: tabIndex, modules: modules, onSlideChange: handleSlideChange, onSwiper: handleSwiper, slidesPerView: SLIDES_PER_VIEW, spaceBetween: SPACE_BETWEEN, style: style, children: children }));
|
|
42
|
+
};
|
|
43
|
+
WebBaseCarousel.displayName = 'WebBaseCarousel';
|
|
44
|
+
export default WebBaseCarousel;
|
|
45
|
+
export { default as WebBaseHorse } from './WebBaseHorse';
|
|
46
|
+
//# sourceMappingURL=WebBaseCarousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseCarousel.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseCarousel/WebBaseCarousel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAGL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,MAAM,EACP,MAAM,cAAc,CAAC;AAMtB,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,MAAM,MAAM,GAAG;IACb,cAAc,EAAE;QACd,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,OAAO,GAAmB,EAAE,CAAC;AAEnC,MAAM,eAAe,GAA4C,CAAC,EAChE,QAAQ,EACR,WAAW,EACX,KAAK,EAAE,UAAU,EACjB,KAAK,EACL,QAAQ,GAAG,CAAC,EACb,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;QACH,OAAO;YACL,GAAG,MAAM,CAAC,cAAc;YACxB,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,EACD;QACE,UAAU;KACX,CACF,CAAC;IAEF,MAAM,iBAAiB,GAAG,WAAW,CACnC,CACE,MAAmB,EACnB,EAAE;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,EAED;QACE,WAAW;KACZ,CACF,CAAC;IAEF,MAAM,cAAc,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,WAAW,CAC9B,CACE,MAAmB,EACnB,EAAE;QACF,cAAc,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,CAAC,EACD,EAAE,CACH,CAAC;IAEF,SAAS,CACP,GAAG,EAAE;QACH,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YAC3B,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EACD;QACE,QAAQ;KACT,CACF,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,cAAc,EAAE,KAAK,IAAI,IAAI,EAC7B,YAAY,EAAE,QAAQ,EACtB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,EAC9B,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,KAAsB,YAE5B,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,eAAe,eAAe,CAAC;AAI/B,OAAO,EACL,OAAO,IAAI,YAAY,EACxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { SwiperSlide } from 'swiper/react';
|
|
4
|
+
const styles = {
|
|
5
|
+
horse: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
height: '100%',
|
|
8
|
+
width: '100%'
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const WebBaseHorse = ({ children, style: givenStyle, swipe }) => {
|
|
12
|
+
const style = useMemo(() => {
|
|
13
|
+
return {
|
|
14
|
+
...styles.horse,
|
|
15
|
+
...givenStyle
|
|
16
|
+
};
|
|
17
|
+
}, [
|
|
18
|
+
givenStyle
|
|
19
|
+
]);
|
|
20
|
+
const slide = swipe ?? true;
|
|
21
|
+
return (_jsx(SwiperSlide, { className: slide ?
|
|
22
|
+
undefined :
|
|
23
|
+
'swiper-no-swiping', style: style, children: children }));
|
|
24
|
+
};
|
|
25
|
+
WebBaseHorse.displayName = 'WebBaseHorse';
|
|
26
|
+
export default WebBaseHorse;
|
|
27
|
+
//# sourceMappingURL=WebBaseHorse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseHorse.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseCarousel/WebBaseHorse.tsx"],"names":[],"mappings":";AAGA,OAAO,EAGL,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACZ,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,YAAY,GAAyC,CAAC,EAC1D,QAAQ,EACR,KAAK,EAAE,UAAU,EACjB,KAAK,EACN,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;QACH,OAAO;YACL,GAAG,MAAM,CAAC,KAAK;YACf,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,EACD;QACE,UAAU;KACX,CACF,CAAC;IAEF,MAAM,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,WAAW,IACV,SAAS,EACP,KAAK,CAAC,CAAC;YACL,SAAS,CAAC,CAAC;YACX,mBAAmB,EAEvB,KAAK,EAAE,KAAsB,YAE5B,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseCarousel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,eAAe,EAE3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,OAAO,IAAI,YAAY,EAExB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import WebBaseGatewayContext from './WebBaseGatewayContext';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
const WebBaseGateway = ({ children, gatewayId }) => {
|
|
6
|
+
const gatewayRegistry = useContext(WebBaseGatewayContext);
|
|
7
|
+
const ref = gatewayRegistry?.refs[gatewayId]?.current;
|
|
8
|
+
if (ref) {
|
|
9
|
+
return createPortal(children, ref);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return (_jsx(_Fragment, { children: null }));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
WebBaseGateway.displayName = 'WebBaseGateway';
|
|
16
|
+
export default WebBaseGateway;
|
|
17
|
+
//# sourceMappingURL=WebBaseGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseGateway.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/WebBaseGateway.tsx"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAEL,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAEnB,MAAM,cAAc,GAA2C,CAAC,EAC9D,QAAQ,EACR,SAAS,EACV,EAAE,EAAE;IACH,MAAM,eAAe,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAE1D,MAAM,GAAG,GAAG,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEtD,IACE,GAAG,EACH,CAAC;QACD,OAAO,YAAY,CACjB,QAAQ,EAGR,GAAG,CACJ,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,4BACG,IAAI,GACJ,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseGatewayContext.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/WebBaseGatewayContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEd,MAAM,OAAO,CAAC;AAEf,MAAM,qBAAqB,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC;AAErF,qBAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE5D,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import WebBaseGatewayContext from './WebBaseGatewayContext';
|
|
3
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
4
|
+
const WebBaseGatewayProvider = ({ children }) => {
|
|
5
|
+
const [refs, setRefs] = useState({});
|
|
6
|
+
const addRef = useCallback((id, ref) => {
|
|
7
|
+
setRefs((currentRefs) => {
|
|
8
|
+
return {
|
|
9
|
+
...currentRefs,
|
|
10
|
+
[id]: ref
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}, []);
|
|
14
|
+
const removeRef = useCallback((id) => {
|
|
15
|
+
setRefs((currentRefs) => {
|
|
16
|
+
const { [id]: ref, ...filteredRefs } = currentRefs;
|
|
17
|
+
return filteredRefs;
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
20
|
+
const value = useMemo(() => {
|
|
21
|
+
return {
|
|
22
|
+
addRef,
|
|
23
|
+
refs,
|
|
24
|
+
removeRef
|
|
25
|
+
};
|
|
26
|
+
}, [
|
|
27
|
+
addRef,
|
|
28
|
+
refs,
|
|
29
|
+
removeRef
|
|
30
|
+
]);
|
|
31
|
+
return (_jsx(WebBaseGatewayContext.Provider, { value: value, children: children }));
|
|
32
|
+
};
|
|
33
|
+
WebBaseGatewayProvider.displayName = 'WebBaseGatewayProvider';
|
|
34
|
+
export default WebBaseGatewayProvider;
|
|
35
|
+
//# sourceMappingURL=WebBaseGatewayProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBaseGatewayProvider.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/WebBaseGatewayProvider.tsx"],"names":[],"mappings":";AAKA,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAKL,WAAW,EACX,OAAO,EACP,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,MAAM,sBAAsB,GAAmD,CAAC,EAC9E,QAAQ,EACT,EAAE,EAAE;IACH,MAAM,CACJ,IAAI,EACJ,OAAO,CACR,GAAG,QAAQ,CAET,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,WAAW,CACxB,CACE,EAAU,EACV,GAAiD,EACjD,EAAE;QACF,OAAO,CACL,CACE,WAAW,EACX,EAAE;YACF,OAAO;gBACL,GAAG,WAAW;gBACd,CAAC,EAAE,CAAC,EAAE,GAAG;aACV,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,WAAW,CAC3B,CACE,EAAU,EACV,EAAE;QACF,OAAO,CACL,CACE,WAAW,EACX,EAAE;YACF,MAAM,EAEJ,CAAC,EAAE,CAAC,EAAE,GAAG,EACT,GAAG,YAAY,EAChB,GAAG,WAAW,CAAC;YAEhB,OAAO,YAAY,CAAC;QACtB,CAAC,CACF,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;QACH,OAAO;YACL,MAAM;YACN,IAAI;YACJ,SAAS;SACV,CAAC;IACJ,CAAC,EACD;QACE,MAAM;QACN,IAAI;QACJ,SAAS;KACV,CACF,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAC7B,KAAK,EAAE,KAAK,YAEX,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAE9D,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Generics/WebBaseGateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,cAAc,EAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,OAAO,IAAI,qBAAqB,EAEjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,IAAI,sBAAsB,EAElC,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EAEb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,EACd,qBAAqB,EAGrB,sBAAsB,EAEvB,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@dgui/react-web-shared",
|
|
3
3
|
"title": "Digested React GUI Shared Web Components",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.8.0-next.1",
|
|
6
6
|
"private": false,
|
|
7
7
|
"description": "Shared Web Components for a boilerplate React GUI",
|
|
8
8
|
"author": "wallzero @wallzeroblog (http://wallzero.com)",
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
"position": "Initial and Lead Developer"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"
|
|
16
|
+
"main": "dist/cjs/index.js",
|
|
17
|
+
"module": "dist/esm/index.js",
|
|
18
|
+
"types": "dist/esm/index.d.ts",
|
|
18
19
|
"files": [
|
|
19
20
|
"dist/",
|
|
20
21
|
"COPYING.md",
|
|
@@ -30,7 +31,9 @@
|
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "run-s clean:dist build:prod",
|
|
33
|
-
"build:prod": "
|
|
34
|
+
"build:prod": "run-p build:cjs:prod build:esm:prod",
|
|
35
|
+
"build:cjs:prod": "tsc -p ./tsconfig.cjs.json",
|
|
36
|
+
"build:esm:prod": "tsc -p ./tsconfig.json",
|
|
34
37
|
"build:watch": "tsc -p ./tsconfig.json --watch --pretty --preserveWatchOutput",
|
|
35
38
|
"----------------------------------------------------------------": "",
|
|
36
39
|
"build:prod:config": "",
|
|
@@ -42,30 +45,30 @@
|
|
|
42
45
|
"clean:dist": "rimraf dist"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
|
-
"@digest/eslint-config-jest": "^4.14.
|
|
46
|
-
"@digest/eslint-config-react": "^4.14.
|
|
47
|
-
"@digest/eslint-config-typescript": "^4.14.
|
|
48
|
-
"@digest/jest-junit": "^4.14.
|
|
49
|
-
"@digest/jest-react": "^4.14.
|
|
50
|
-
"@digest/jest-typescript": "^4.14.
|
|
51
|
-
"@digest/typescript": "^4.14.
|
|
48
|
+
"@digest/eslint-config-jest": "^4.14.14",
|
|
49
|
+
"@digest/eslint-config-react": "^4.14.14",
|
|
50
|
+
"@digest/eslint-config-typescript": "^4.14.14",
|
|
51
|
+
"@digest/jest-junit": "^4.14.14",
|
|
52
|
+
"@digest/jest-react": "^4.14.14",
|
|
53
|
+
"@digest/jest-typescript": "^4.14.14",
|
|
54
|
+
"@digest/typescript": "^4.14.14",
|
|
52
55
|
"@types/jest": "^30.0.0",
|
|
53
56
|
"@types/lodash.debounce": "^4.0.9",
|
|
54
|
-
"@types/react": "^19.2.
|
|
57
|
+
"@types/react": "^19.2.13",
|
|
55
58
|
"@types/react-dom": "^19.2.3",
|
|
56
59
|
"@types/react-test-renderer": "^19.1.0",
|
|
57
60
|
"cross-env": "^10.1.0",
|
|
58
61
|
"jest-environment-jsdom": "^30.2.0",
|
|
59
62
|
"jest-environment-jsdom-global": "^4.0.0",
|
|
60
63
|
"npm-run-all": "^4.1.5",
|
|
61
|
-
"react": "^19.2.
|
|
62
|
-
"react-dom": "^19.2.
|
|
63
|
-
"react-test-renderer": "^19.2.
|
|
64
|
+
"react": "^19.2.4",
|
|
65
|
+
"react-dom": "^19.2.4",
|
|
66
|
+
"react-test-renderer": "^19.2.4",
|
|
64
67
|
"rimraf": "^6.1.2",
|
|
65
|
-
"swiper": "^12.0
|
|
68
|
+
"swiper": "^12.1.0"
|
|
66
69
|
},
|
|
67
70
|
"dependencies": {
|
|
68
|
-
"@dgui/react-shared": "1.
|
|
71
|
+
"@dgui/react-shared": "1.8.0-next.1",
|
|
69
72
|
"lodash.debounce": "^4.0.8"
|
|
70
73
|
},
|
|
71
74
|
"peerDependencies": {
|
|
@@ -81,5 +84,5 @@
|
|
|
81
84
|
"react-dom",
|
|
82
85
|
"typescript"
|
|
83
86
|
],
|
|
84
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "8c988440fbced187ef0eb3b458b429666ba85415"
|
|
85
88
|
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WebBaseHorse = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const react_2 = require("swiper/react");
|
|
10
|
-
const SLIDES_PER_VIEW = 1;
|
|
11
|
-
const SPACE_BETWEEN = 0;
|
|
12
|
-
const styles = {
|
|
13
|
-
slideContainer: {
|
|
14
|
-
display: 'flex',
|
|
15
|
-
height: '100%',
|
|
16
|
-
width: '100%'
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const modules = [];
|
|
20
|
-
const WebBaseCarousel = ({ children, onSelectTab, style: givenStyle, swipe, tabIndex = 0 }) => {
|
|
21
|
-
const style = (0, react_1.useMemo)(() => {
|
|
22
|
-
return Object.assign(Object.assign({}, styles.slideContainer), givenStyle);
|
|
23
|
-
}, [
|
|
24
|
-
givenStyle
|
|
25
|
-
]);
|
|
26
|
-
const handleSlideChange = (0, react_1.useCallback)((swiper) => {
|
|
27
|
-
if (onSelectTab) {
|
|
28
|
-
onSelectTab(swiper.activeIndex);
|
|
29
|
-
}
|
|
30
|
-
}, [
|
|
31
|
-
onSelectTab
|
|
32
|
-
]);
|
|
33
|
-
const swiperInstance = (0, react_1.useRef)(null);
|
|
34
|
-
const handleSwiper = (0, react_1.useCallback)((swiper) => {
|
|
35
|
-
swiperInstance.current = swiper;
|
|
36
|
-
}, []);
|
|
37
|
-
(0, react_1.useEffect)(() => {
|
|
38
|
-
if (swiperInstance.current) {
|
|
39
|
-
swiperInstance.current.slideTo(tabIndex);
|
|
40
|
-
}
|
|
41
|
-
}, [
|
|
42
|
-
tabIndex
|
|
43
|
-
]);
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(react_2.Swiper, { allowTouchMove: swipe !== null && swipe !== void 0 ? swipe : true, initialSlide: tabIndex, modules: modules, onSlideChange: handleSlideChange, onSwiper: handleSwiper, slidesPerView: SLIDES_PER_VIEW, spaceBetween: SPACE_BETWEEN, style: style, children: children }));
|
|
45
|
-
};
|
|
46
|
-
WebBaseCarousel.displayName = 'WebBaseCarousel';
|
|
47
|
-
exports.default = WebBaseCarousel;
|
|
48
|
-
var WebBaseHorse_1 = require("./WebBaseHorse");
|
|
49
|
-
Object.defineProperty(exports, "WebBaseHorse", { enumerable: true, get: function () { return __importDefault(WebBaseHorse_1).default; } });
|
|
50
|
-
//# sourceMappingURL=WebBaseCarousel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebBaseCarousel.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseCarousel/WebBaseCarousel.tsx"],"names":[],"mappings":";;;;;;;AAGA,iCAOe;AACf,wCAEsB;AAMtB,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,MAAM,MAAM,GAAG;IACb,cAAc,EAAE;QACd,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,OAAO,GAAmB,EAAE,CAAC;AAEnC,MAAM,eAAe,GAA4C,CAAC,EAChE,QAAQ,EACR,WAAW,EACX,KAAK,EAAE,UAAU,EACjB,KAAK,EACL,QAAQ,GAAG,CAAC,EACb,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE;QACH,uCACK,MAAM,CAAC,cAAc,GACrB,UAAU,EACb;IACJ,CAAC,EACD;QACE,UAAU;KACX,CACF,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,CACE,MAAmB,EACnB,EAAE;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,EAED;QACE,WAAW;KACZ,CACF,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,cAAM,EAAqB,IAAI,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,CACE,MAAmB,EACnB,EAAE;QACF,cAAc,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,CAAC,EACD,EAAE,CACH,CAAC;IAEF,IAAA,iBAAS,EACP,GAAG,EAAE;QACH,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YAC3B,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EACD;QACE,QAAQ;KACT,CACF,CAAC;IAEF,OAAO,CACL,uBAAC,cAAM,IACL,cAAc,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,EAC7B,YAAY,EAAE,QAAQ,EACtB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,EAC9B,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,KAAsB,YAE5B,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,kBAAe,eAAe,CAAC;AAI/B,+CAEwB;AADtB,6HAAA,OAAO,OAAgB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const react_2 = require("swiper/react");
|
|
6
|
-
const styles = {
|
|
7
|
-
horse: {
|
|
8
|
-
display: 'flex',
|
|
9
|
-
height: '100%',
|
|
10
|
-
width: '100%'
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const WebBaseHorse = ({ children, style: givenStyle, swipe }) => {
|
|
14
|
-
const style = (0, react_1.useMemo)(() => {
|
|
15
|
-
return Object.assign(Object.assign({}, styles.horse), givenStyle);
|
|
16
|
-
}, [
|
|
17
|
-
givenStyle
|
|
18
|
-
]);
|
|
19
|
-
const slide = swipe !== null && swipe !== void 0 ? swipe : true;
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { className: slide ?
|
|
21
|
-
undefined :
|
|
22
|
-
'swiper-no-swiping', style: style, children: children }));
|
|
23
|
-
};
|
|
24
|
-
WebBaseHorse.displayName = 'WebBaseHorse';
|
|
25
|
-
exports.default = WebBaseHorse;
|
|
26
|
-
//# sourceMappingURL=WebBaseHorse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebBaseHorse.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseCarousel/WebBaseHorse.tsx"],"names":[],"mappings":";;;AAGA,iCAIe;AACf,wCAEsB;AAEtB,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,YAAY,GAAyC,CAAC,EAC1D,QAAQ,EACR,KAAK,EAAE,UAAU,EACjB,KAAK,EACN,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE;QACH,uCACK,MAAM,CAAC,KAAK,GACZ,UAAU,EACb;IACJ,CAAC,EACD;QACE,UAAU;KACX,CACF,CAAC;IAEF,MAAM,KAAK,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,CAAC;IAE5B,OAAO,CACL,uBAAC,mBAAW,IACV,SAAS,EACP,KAAK,CAAC,CAAC;YACL,SAAS,CAAC,CAAC;YACX,mBAAmB,EAEvB,KAAK,EAAE,KAAsB,YAE5B,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,kBAAe,YAAY,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WebBaseHorse = exports.WebBaseCarousel = void 0;
|
|
7
|
-
var WebBaseCarousel_1 = require("./WebBaseCarousel");
|
|
8
|
-
Object.defineProperty(exports, "WebBaseCarousel", { enumerable: true, get: function () { return __importDefault(WebBaseCarousel_1).default; } });
|
|
9
|
-
var WebBaseHorse_1 = require("./WebBaseHorse");
|
|
10
|
-
Object.defineProperty(exports, "WebBaseHorse", { enumerable: true, get: function () { return __importDefault(WebBaseHorse_1).default; } });
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseCarousel/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAG2B;AAFzB,mIAAA,OAAO,OAAmB;AAG5B,+CAGwB;AAFtB,6HAAA,OAAO,OAAgB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const WebBaseGatewayContext_1 = __importDefault(require("./WebBaseGatewayContext"));
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const react_dom_1 = require("react-dom");
|
|
10
|
-
const WebBaseGateway = ({ children, gatewayId }) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const gatewayRegistry = (0, react_1.useContext)(WebBaseGatewayContext_1.default);
|
|
13
|
-
const ref = (_a = gatewayRegistry === null || gatewayRegistry === void 0 ? void 0 : gatewayRegistry.refs[gatewayId]) === null || _a === void 0 ? void 0 : _a.current;
|
|
14
|
-
if (ref) {
|
|
15
|
-
return (0, react_dom_1.createPortal)(children, ref);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: null }));
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
WebBaseGateway.displayName = 'WebBaseGateway';
|
|
22
|
-
exports.default = WebBaseGateway;
|
|
23
|
-
//# sourceMappingURL=WebBaseGateway.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebBaseGateway.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseGateway/WebBaseGateway.tsx"],"names":[],"mappings":";;;;;;AAAA,oFAA4D;AAI5D,iCAGe;AACf,yCAEmB;AAEnB,MAAM,cAAc,GAA2C,CAAC,EAC9D,QAAQ,EACR,SAAS,EACV,EAAE,EAAE;;IACH,MAAM,eAAe,GAAG,IAAA,kBAAU,EAAC,+BAAqB,CAAC,CAAC;IAE1D,MAAM,GAAG,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,CAAC,SAAS,CAAC,0CAAE,OAAO,CAAC;IAEtD,IACE,GAAG,EACH,CAAC;QACD,OAAO,IAAA,wBAAY,EACjB,QAAQ,EAGR,GAAG,CACJ,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,2DACG,IAAI,GACJ,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,kBAAe,cAAc,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_1 = require("react");
|
|
4
|
-
const WebBaseGatewayContext = (0, react_1.createContext)(null);
|
|
5
|
-
WebBaseGatewayContext.displayName = 'WebBaseGatewayContext';
|
|
6
|
-
exports.default = WebBaseGatewayContext;
|
|
7
|
-
//# sourceMappingURL=WebBaseGatewayContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebBaseGatewayContext.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseGateway/WebBaseGatewayContext.ts"],"names":[],"mappings":";;AAAA,iCAIe;AAEf,MAAM,qBAAqB,GAAG,IAAA,qBAAa,EAAoC,IAAI,CAAC,CAAC;AAErF,qBAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE5D,kBAAe,qBAAqB,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
const WebBaseGatewayContext_1 = __importDefault(require("./WebBaseGatewayContext"));
|
|
19
|
-
const react_1 = require("react");
|
|
20
|
-
const WebBaseGatewayProvider = ({ children }) => {
|
|
21
|
-
const [refs, setRefs] = (0, react_1.useState)({});
|
|
22
|
-
const addRef = (0, react_1.useCallback)((id, ref) => {
|
|
23
|
-
setRefs((currentRefs) => {
|
|
24
|
-
return Object.assign(Object.assign({}, currentRefs), { [id]: ref });
|
|
25
|
-
});
|
|
26
|
-
}, []);
|
|
27
|
-
const removeRef = (0, react_1.useCallback)((id) => {
|
|
28
|
-
setRefs((currentRefs) => {
|
|
29
|
-
const _a = currentRefs, _b = id, ref = _a[_b], filteredRefs = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
30
|
-
return filteredRefs;
|
|
31
|
-
});
|
|
32
|
-
}, []);
|
|
33
|
-
const value = (0, react_1.useMemo)(() => {
|
|
34
|
-
return {
|
|
35
|
-
addRef,
|
|
36
|
-
refs,
|
|
37
|
-
removeRef
|
|
38
|
-
};
|
|
39
|
-
}, [
|
|
40
|
-
addRef,
|
|
41
|
-
refs,
|
|
42
|
-
removeRef
|
|
43
|
-
]);
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(WebBaseGatewayContext_1.default.Provider, { value: value, children: children }));
|
|
45
|
-
};
|
|
46
|
-
WebBaseGatewayProvider.displayName = 'WebBaseGatewayProvider';
|
|
47
|
-
exports.default = WebBaseGatewayProvider;
|
|
48
|
-
//# sourceMappingURL=WebBaseGatewayProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebBaseGatewayProvider.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseGateway/WebBaseGatewayProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKA,oFAA4D;AAC5D,iCAQe;AAEf,MAAM,sBAAsB,GAAmD,CAAC,EAC9E,QAAQ,EACT,EAAE,EAAE;IACH,MAAM,CACJ,IAAI,EACJ,OAAO,CACR,GAAG,IAAA,gBAAQ,EAET,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,IAAA,mBAAW,EACxB,CACE,EAAU,EACV,GAAiD,EACjD,EAAE;QACF,OAAO,CACL,CACE,WAAW,EACX,EAAE;YACF,uCACK,WAAW,KACd,CAAC,EAAE,CAAC,EAAE,GAAG,IACT;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,IAAA,mBAAW,EAC3B,CACE,EAAU,EACV,EAAE;QACF,OAAO,CACL,CACE,WAAW,EACX,EAAE;YACF,MAII,KAAA,WAAW,EAFb,KAAC,EAAG,EAAE,GAAG,SAAA,EACN,YAAY,cAHX,uCAIL,CAAc,CAAC;YAEhB,OAAO,YAAY,CAAC;QACtB,CAAC,CACF,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE;QACH,OAAO;YACL,MAAM;YACN,IAAI;YACJ,SAAS;SACV,CAAC;IACJ,CAAC,EACD;QACE,MAAM;QACN,IAAI;QACJ,SAAS;KACV,CACF,CAAC;IAEF,OAAO,CACL,uBAAC,+BAAqB,CAAC,QAAQ,IAC7B,KAAK,EAAE,KAAK,YAEX,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAE9D,kBAAe,sBAAsB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WebBaseGatewayProvider = exports.WebBaseGatewayContext = exports.WebBaseGateway = void 0;
|
|
7
|
-
var WebBaseGateway_1 = require("./WebBaseGateway");
|
|
8
|
-
Object.defineProperty(exports, "WebBaseGateway", { enumerable: true, get: function () { return __importDefault(WebBaseGateway_1).default; } });
|
|
9
|
-
var WebBaseGatewayContext_1 = require("./WebBaseGatewayContext");
|
|
10
|
-
Object.defineProperty(exports, "WebBaseGatewayContext", { enumerable: true, get: function () { return __importDefault(WebBaseGatewayContext_1).default; } });
|
|
11
|
-
var WebBaseGatewayProvider_1 = require("./WebBaseGatewayProvider");
|
|
12
|
-
Object.defineProperty(exports, "WebBaseGatewayProvider", { enumerable: true, get: function () { return __importDefault(WebBaseGatewayProvider_1).default; } });
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Generics/WebBaseGateway/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAG0B;AAFxB,iIAAA,OAAO,OAAkB;AAG3B,iEAGiC;AAF/B,+IAAA,OAAO,OAAyB;AAGlC,mEAGkC;AAFhC,iJAAA,OAAO,OAA0B"}
|
package/dist/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebBaseGatewayProvider = exports.WebBaseGatewayContext = exports.WebBaseGateway = exports.WebBaseHorse = exports.WebBaseCarousel = void 0;
|
|
4
|
-
var WebBaseCarousel_1 = require("./Generics/WebBaseCarousel");
|
|
5
|
-
Object.defineProperty(exports, "WebBaseCarousel", { enumerable: true, get: function () { return WebBaseCarousel_1.WebBaseCarousel; } });
|
|
6
|
-
Object.defineProperty(exports, "WebBaseHorse", { enumerable: true, get: function () { return WebBaseCarousel_1.WebBaseHorse; } });
|
|
7
|
-
var WebBaseGateway_1 = require("./Generics/WebBaseGateway");
|
|
8
|
-
Object.defineProperty(exports, "WebBaseGateway", { enumerable: true, get: function () { return WebBaseGateway_1.WebBaseGateway; } });
|
|
9
|
-
Object.defineProperty(exports, "WebBaseGatewayContext", { enumerable: true, get: function () { return WebBaseGateway_1.WebBaseGatewayContext; } });
|
|
10
|
-
Object.defineProperty(exports, "WebBaseGatewayProvider", { enumerable: true, get: function () { return WebBaseGateway_1.WebBaseGatewayProvider; } });
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8DAKoC;AAJlC,kHAAA,eAAe,OAAA;AAEf,+GAAA,YAAY,OAAA;AAGd,4DAOmC;AANjC,gHAAA,cAAc,OAAA;AACd,uHAAA,qBAAqB,OAAA;AAGrB,wHAAA,sBAAsB,OAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|