ublo-lib 1.36.13 → 1.36.14
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/es/common/components/scrolling-carousel/scrolling-carousel.d.ts.map +1 -1
- package/es/common/components/scrolling-carousel/scrolling-carousel.js +7 -1
- package/es/esf/components/loyal-customers/content.d.ts +1 -1
- package/es/esf/components/loyal-customers/content.js +2 -2
- package/es/esf/components/loyal-customers/loyal-customers.d.ts.map +1 -1
- package/es/esf/components/loyal-customers/loyal-customers.js +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrolling-carousel.d.ts","sourceRoot":"","sources":["../../../../src/common/components/scrolling-carousel/scrolling-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAKF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"scrolling-carousel.d.ts","sourceRoot":"","sources":["../../../../src/common/components/scrolling-carousel/scrolling-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAKF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAwHvE"}
|
|
@@ -60,14 +60,20 @@ export default function ScrollingCarousel({ className, children }) {
|
|
|
60
60
|
}, []);
|
|
61
61
|
React.useEffect(() => {
|
|
62
62
|
const zone = zoneRef.current;
|
|
63
|
+
let observer = null;
|
|
63
64
|
if (!cmsMode && zone) {
|
|
64
|
-
|
|
65
|
+
observer = new MutationObserver(resetScroll);
|
|
65
66
|
observer.observe(zone, {
|
|
66
67
|
attributes: true,
|
|
67
68
|
childList: true,
|
|
68
69
|
subtree: true,
|
|
69
70
|
});
|
|
70
71
|
}
|
|
72
|
+
return () => {
|
|
73
|
+
if (observer) {
|
|
74
|
+
observer.disconnect();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
71
77
|
}, [cmsMode]);
|
|
72
78
|
React.useEffect(() => {
|
|
73
79
|
refreshControls();
|
|
@@ -4,7 +4,7 @@ export function getElements(product: any, selectors: any): {
|
|
|
4
4
|
details: any;
|
|
5
5
|
options: any;
|
|
6
6
|
button: any;
|
|
7
|
-
|
|
7
|
+
wrapper: any;
|
|
8
8
|
};
|
|
9
9
|
export function getData(product: any, selectors: any, levels: any, handleVariants: any, convertTableToSelect: any): {
|
|
10
10
|
title: string;
|
|
@@ -5,8 +5,8 @@ export const getElements = (product, selectors) => {
|
|
|
5
5
|
const details = product.querySelector(selectors.details);
|
|
6
6
|
const options = product.querySelector(selectors.options);
|
|
7
7
|
const button = product.querySelector(selectors.button);
|
|
8
|
-
const
|
|
9
|
-
return { title, price, details, options, button,
|
|
8
|
+
const wrapper = product.querySelector(`.${css.fieldWrapper}`);
|
|
9
|
+
return { title, price, details, options, button, wrapper };
|
|
10
10
|
};
|
|
11
11
|
export const getData = (product, selectors, levels, handleVariants, convertTableToSelect) => {
|
|
12
12
|
const { title, price, details, options } = getElements(product, selectors);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loyal-customers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/loyal-customers.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"loyal-customers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/loyal-customers.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;4CAuIC"}
|
|
@@ -29,8 +29,8 @@ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, class
|
|
|
29
29
|
setStudentData(productData);
|
|
30
30
|
}, [convertTableToSelect, handleVariants, levels, selectors]);
|
|
31
31
|
const init = React.useCallback((product) => {
|
|
32
|
-
const { options, button } = Content.getElements(product, selectors);
|
|
33
|
-
if (!options || !button)
|
|
32
|
+
const { options, button, wrapper } = Content.getElements(product, selectors);
|
|
33
|
+
if (!options || !button || wrapper)
|
|
34
34
|
return;
|
|
35
35
|
if (convertTableToSelect)
|
|
36
36
|
Content.createSelect(options);
|
|
@@ -38,18 +38,18 @@ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, class
|
|
|
38
38
|
button.addEventListener("click", button.callback);
|
|
39
39
|
}, [openStudentForm, selectors, convertTableToSelect]);
|
|
40
40
|
const cleanup = React.useCallback((product) => {
|
|
41
|
-
const { options, button,
|
|
41
|
+
const { options, button, wrapper } = Content.getElements(product, selectors);
|
|
42
42
|
if (!options || !button)
|
|
43
43
|
return;
|
|
44
44
|
if (convertTableToSelect) {
|
|
45
|
-
|
|
45
|
+
wrapper?.remove();
|
|
46
46
|
options.style.removeProperty("display");
|
|
47
47
|
}
|
|
48
48
|
button.removeEventListener("click", button.callback);
|
|
49
49
|
}, [selectors, convertTableToSelect]);
|
|
50
50
|
React.useEffect(() => {
|
|
51
51
|
const products = Array.from(document.querySelectorAll(selectors.block));
|
|
52
|
-
if (
|
|
52
|
+
if (cmsMode !== "editing" && products.length) {
|
|
53
53
|
products.forEach(init);
|
|
54
54
|
return () => products.forEach(cleanup);
|
|
55
55
|
}
|