@redneckz/wildless-cms-uni-blocks 0.13.13 → 0.13.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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +17 -7
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/bundle/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/bundle/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/bundle/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/bundle/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/bundle/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/bundle/hooks/useSWRResource.d.ts +7 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/dist/components/Footer/Footer.js +4 -2
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js +3 -3
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/dist/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/dist/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/dist/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/dist/components/StickyBottomMenu/RenderItem.js +11 -7
- package/dist/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/dist/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/dist/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/dist/hooks/useSWRResource.d.ts +7 -1
- package/dist/hooks/useSWRResource.js +8 -2
- package/dist/hooks/useSWRResource.js.map +1 -1
- package/dist/services/sitemap/useSitemap.js +1 -1
- package/dist/services/sitemap/useSitemap.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/lib/components/Footer/Footer.js +4 -2
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js +3 -3
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/lib/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/lib/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/lib/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/lib/components/StickyBottomMenu/RenderItem.js +11 -7
- package/lib/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/lib/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/lib/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/lib/hooks/useSWRResource.d.ts +7 -1
- package/lib/hooks/useSWRResource.js +8 -2
- package/lib/hooks/useSWRResource.js.map +1 -1
- package/lib/services/sitemap/useSitemap.js +1 -1
- package/lib/services/sitemap/useSitemap.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +124 -111
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/mobile/bundle/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/mobile/bundle/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/mobile/bundle/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/mobile/bundle/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/mobile/bundle/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/mobile/bundle/hooks/useSWRResource.d.ts +7 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/mobile/dist/components/Footer/Footer.js +3 -3
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js +11 -7
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/mobile/dist/hooks/useSWRResource.d.ts +7 -1
- package/mobile/dist/hooks/useSWRResource.js +8 -2
- package/mobile/dist/hooks/useSWRResource.js.map +1 -1
- package/mobile/dist/services/sitemap/useSitemap.js +1 -1
- package/mobile/dist/services/sitemap/useSitemap.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/mobile/lib/components/Footer/Footer.js +3 -3
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js +11 -7
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/mobile/lib/hooks/useSWRResource.d.ts +7 -1
- package/mobile/lib/hooks/useSWRResource.js +8 -2
- package/mobile/lib/hooks/useSWRResource.js.map +1 -1
- package/mobile/lib/services/sitemap/useSitemap.js +1 -1
- package/mobile/lib/services/sitemap/useSitemap.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +6 -3
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +40 -32
- package/mobile/src/components/Footer/Footer.tsx +3 -3
- package/mobile/src/components/StickyBottomMenu/ActiveSubMenu.tsx +3 -2
- package/mobile/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +8 -5
- package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +27 -15
- package/mobile/src/components/StickyBottomMenu/RenderItem.tsx +14 -11
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +1 -2
- package/mobile/src/components/StickyBottomMenu/TopItemMobile.tsx +12 -24
- package/mobile/src/components/StickyBottomMenu/renderMenuItems.tsx +1 -1
- package/mobile/src/hooks/useSWRResource.ts +19 -6
- package/mobile/src/services/sitemap/useSitemap.ts +1 -1
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +6 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +6 -3
- package/src/components/ApplicationForm/ApplicationFormContent.ts +40 -32
- package/src/components/Footer/Footer.mobile.tsx +3 -3
- package/src/components/Footer/Footer.tsx +4 -5
- package/src/components/Header/Header.tsx +1 -2
- package/src/components/StickyBottomMenu/ActiveSubMenu.tsx +3 -2
- package/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +8 -5
- package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +27 -15
- package/src/components/StickyBottomMenu/RenderItem.tsx +14 -11
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +1 -2
- package/src/components/StickyBottomMenu/TopItemMobile.tsx +12 -24
- package/src/components/StickyBottomMenu/renderMenuItems.tsx +1 -1
- package/src/hooks/useSWRResource.ts +19 -6
- package/src/icons/IconName.ts +2 -2
- package/src/services/sitemap/useSitemap.ts +1 -1
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +6 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useSWRResource } from '../../hooks/useSWRResource.js';
|
|
2
2
|
import { projectSettings } from '../../ProjectSettings.js';
|
|
3
|
-
export const useSitemap = (fallback) => useSWRResource(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
3
|
+
export const useSitemap = (fallback) => useSWRResource(projectSettings.SITEMAP || 'sitemap', { fallback });
|
|
4
4
|
//# sourceMappingURL=useSitemap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSitemap.js","sourceRoot":"","sources":["../../../src/services/sitemap/useSitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAmB,EAAE,EAAE,CAChD,cAAc,CAAc,eAAe,CAAC,OAAO,IAAI,SAAS,EAAE,QAAQ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"useSitemap.js","sourceRoot":"","sources":["../../../src/services/sitemap/useSitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAmB,EAAE,EAAE,CAChD,cAAc,CAAc,eAAe,CAAC,OAAO,IAAI,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC"}
|
|
@@ -41,7 +41,11 @@ export const useSwipeListScroll = ({ itemCount, onVisibleIndicesChange, }) => {
|
|
|
41
41
|
}, [itemCount, canScrollRight]);
|
|
42
42
|
const scrollTo = useCallback((idx) => {
|
|
43
43
|
if (containerRef?.current) {
|
|
44
|
-
containerRef.current.children[idx]?.scrollIntoView(
|
|
44
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
45
|
+
behavior: 'smooth',
|
|
46
|
+
block: 'nearest',
|
|
47
|
+
inline: 'center',
|
|
48
|
+
});
|
|
45
49
|
}
|
|
46
50
|
}, [containerRef]);
|
|
47
51
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwipeListScroll.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/useSwipeListScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAiBhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAwB,EACxD,SAAS,EACT,sBAAsB,GACD,EAAkE,EAAE;IACzF,MAAM,YAAY,GAAG,MAAM,CAAW,IAAI,CAAC,CAAC;IAE5C,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACnE,MAAM,0BAA0B,GAAG,WAAW,CAC5C,CAAC,OAAiB,EAAE,EAAE;QACpB,iBAAiB,CAAC,CAAC,WAAW,EAAE,EAAE,CAChC,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAC7D,CAAC;QACF,sBAAsB,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,cAAc,CAAC,MAAM;QAChD,CAAC,CAAC,CAAC,KAAK,EAAU,CAAC,cAAc,CAAC,EAAE,KAAK,EAAU,CAAC,cAAc,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEb,MAAM,aAAa,GAAG,QAAQ,GAAG,CAAC,CAAC;IACnC,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,CAAC,CAAC;IAEhD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;YACzB,OAAO;SACR;QAED,IAAI,aAAa,EAAE;YACjB,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;SAC/C;aAAM;YACL,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACnC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;IAE/B,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;YACzB,OAAO;SACR;QAED,IAAI,cAAc,EAAE;YAClB,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;SAC9C;aAAM;YACL,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACrC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEhC,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,
|
|
1
|
+
{"version":3,"file":"useSwipeListScroll.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/useSwipeListScroll.ts"],"names":[],"mappings":"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"}
|
|
@@ -1146,8 +1146,12 @@
|
|
|
1146
1146
|
|
|
1147
1147
|
const EMPTY_VALUE$1 = {};
|
|
1148
1148
|
const DEFAULT_FOLDER_NAME = 'wcms-resources';
|
|
1149
|
-
function useSWRResource(filename,
|
|
1150
|
-
const {
|
|
1149
|
+
function useSWRResource(filename, options = {}) {
|
|
1150
|
+
const { fallback = EMPTY_VALUE$1, folderName = DEFAULT_FOLDER_NAME, setBasePath = false } = options;
|
|
1151
|
+
const path = joinPath(setBasePath ? projectSettings.BASE_PATH : '', folderName, `${filename}.json`);
|
|
1152
|
+
const { data } = useAsyncData(filename ? path : null, fetchJSONUnsafe, {
|
|
1153
|
+
fallback,
|
|
1154
|
+
});
|
|
1151
1155
|
return data || EMPTY_VALUE$1;
|
|
1152
1156
|
}
|
|
1153
1157
|
|
|
@@ -1549,7 +1553,11 @@
|
|
|
1549
1553
|
}, [itemCount, canScrollRight]);
|
|
1550
1554
|
const scrollTo = useCallback((idx) => {
|
|
1551
1555
|
if (containerRef?.current) {
|
|
1552
|
-
containerRef.current.children[idx]?.scrollIntoView(
|
|
1556
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
1557
|
+
behavior: 'smooth',
|
|
1558
|
+
block: 'nearest',
|
|
1559
|
+
inline: 'center',
|
|
1560
|
+
});
|
|
1553
1561
|
}
|
|
1554
1562
|
}, [containerRef]);
|
|
1555
1563
|
return [
|
|
@@ -2988,7 +2996,7 @@
|
|
|
2988
2996
|
return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
|
|
2989
2997
|
};
|
|
2990
2998
|
|
|
2991
|
-
const useSitemap = (fallback) => useSWRResource(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
2999
|
+
const useSitemap = (fallback) => useSWRResource(projectSettings.SITEMAP || 'sitemap', { fallback });
|
|
2992
3000
|
|
|
2993
3001
|
const linkListStyles = '';
|
|
2994
3002
|
|
|
@@ -3083,7 +3091,7 @@
|
|
|
3083
3091
|
const Footer = JSX(({ className, ...rest }) => {
|
|
3084
3092
|
const fallback = rest.options?.page?.fallback;
|
|
3085
3093
|
const { topItems } = useSitemap(fallback);
|
|
3086
|
-
const { relatedEnterprises, contacts, socialMedia, mobileApps, horizontalNavigationTitle, documents, } = useSWRResource(projectSettings.FOOTER || 'footer', fallback);
|
|
3094
|
+
const { relatedEnterprises, contacts, socialMedia, mobileApps, horizontalNavigationTitle, documents, } = useSWRResource(projectSettings.FOOTER || 'footer', { fallback });
|
|
3087
3095
|
return (jsxs(BlockWrapper, { tag: "footer", className: className, ...rest, children: [jsx("div", { className: "mb-lg pb-xs border-b border-main-divider", children: topItems?.map((item, i) => (jsx(RollupItem, { label: item?.text, labelIcon: item?.icon, children: jsx(LinkList, { items: item.items }) }, String(i)))) }), jsx(Contacts, { className: "overflow-hidden", items: contacts }), jsxs("div", { className: "mt-xl", children: [jsx(SocialMedia, { className: "mb-xl", media: socialMedia, buttonSize: "stretched", children: "\u0421\u043E\u0446\u0441\u0435\u0442\u0438" }), jsx(Text, { size: "text-s", font: "font-light", color: "text-secondary-text", children: "\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }), jsx("div", { className: "mt-xs", children: mobileApps?.map(renderButton) })] }), jsx(HorizontalNavigation, { className: "py-lg border-y border-main-divider", title: horizontalNavigationTitle, links: relatedEnterprises }), jsx(TextInformation, { links: documents })] }));
|
|
3088
3096
|
});
|
|
3089
3097
|
const renderButton = ({ href = '/' }, i) => {
|
|
@@ -3718,6 +3726,16 @@
|
|
|
3718
3726
|
return (jsx("div", { className: style(iconAreaSize, containerStyle, 'z-10 mr-s flex justify-center content-center'), children: jsx("span", { className: "flex self-center text-h4 text-secondary-text group-data-secondary:text-white", children: checkCanRenderIcon(step?.icon) ? (jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, width: iconSize, height: iconSize })) : (jsx("span", { children: i + 1 })) }) }));
|
|
3719
3727
|
};
|
|
3720
3728
|
|
|
3729
|
+
const isHrefActive = (router) => ({ href }) => withoutQuery(isURL(href) ? router.href : router.pathname).startsWith(withoutQuery(href));
|
|
3730
|
+
|
|
3731
|
+
const isTopItemActive = (router) => isHrefActive(projectSettings.BASE_PATH ? { pathname: projectSettings.BASE_PATH } : router);
|
|
3732
|
+
|
|
3733
|
+
function useActiveRoute(items = []) {
|
|
3734
|
+
const router = useRouter();
|
|
3735
|
+
const activeIndex = items.findIndex(isTopItemActive(router));
|
|
3736
|
+
return [activeIndex, items[activeIndex]];
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3721
3739
|
const useLatestEvent = (eventBus, type, initialEvent) => {
|
|
3722
3740
|
const [latestEvent, setLatestEvent] = useState(initialEvent || null);
|
|
3723
3741
|
useEffect(() => eventBus.subscribe(type, (_) => setLatestEvent(_)), [eventBus, type]);
|
|
@@ -3762,6 +3780,79 @@
|
|
|
3762
3780
|
|
|
3763
3781
|
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
3764
3782
|
|
|
3783
|
+
const Dialog = JSX(({ className, head, children, onClose }) => {
|
|
3784
|
+
const { close } = useDialogManager();
|
|
3785
|
+
const handleClose = useCallback(() => {
|
|
3786
|
+
close();
|
|
3787
|
+
onClose && onClose();
|
|
3788
|
+
}, [onClose]);
|
|
3789
|
+
return (jsxs("div", { className: style('relative min-h-full bg-white p-5', className), children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
3790
|
+
});
|
|
3791
|
+
|
|
3792
|
+
const REGIONS_URL = '/api/v1/regions';
|
|
3793
|
+
function useRegions() {
|
|
3794
|
+
const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
|
|
3795
|
+
return data || [];
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
const groupBy = (list, keyGetter) => {
|
|
3799
|
+
const result = new Map();
|
|
3800
|
+
for (const item of list) {
|
|
3801
|
+
const key = keyGetter(item);
|
|
3802
|
+
const group = result.get(key) || [];
|
|
3803
|
+
result.set(key, [...group, item]);
|
|
3804
|
+
}
|
|
3805
|
+
return result;
|
|
3806
|
+
};
|
|
3807
|
+
|
|
3808
|
+
const renderForeignOffices = (foreignOffices) => foreignOffices?.length ? (jsxs("div", { className: "border-t border-main-divider mt-2xs pt-2xs", children: [jsx("div", { className: "mb-m", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: "\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0437\u0430 \u0440\u0443\u0431\u0435\u0436\u043E\u043C:" }) }), jsx("div", { className: "flex gap-5xl", children: foreignOffices.map((office, i) => (jsx(ForeignOffice, { ...office }, String(i)))) })] })) : null;
|
|
3809
|
+
const ForeignOffice = JSX(({ icon, ...rest }) => {
|
|
3810
|
+
const link = useLink();
|
|
3811
|
+
const { text, target, href, onClick } = link(rest);
|
|
3812
|
+
return (jsxs("div", { className: "flex gap-s", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: text })) : null] }));
|
|
3813
|
+
});
|
|
3814
|
+
|
|
3815
|
+
const renderRegion = (onChangeLocation) => (region) => (jsx("div", { className: "mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
|
|
3816
|
+
onChangeLocation && onChangeLocation(region);
|
|
3817
|
+
}, children: region.name || '' }) }, region.id));
|
|
3818
|
+
|
|
3819
|
+
const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
|
|
3820
|
+
|
|
3821
|
+
const SearchBar$1 = JSX(({ className, searchTerm, onSearch }) => {
|
|
3822
|
+
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: `h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border
|
|
3823
|
+
outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text`, value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
3824
|
+
});
|
|
3825
|
+
|
|
3826
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
3827
|
+
const LocationDialog = JSX(() => {
|
|
3828
|
+
const { defaultLocation, foreignOffices } = useSitemap();
|
|
3829
|
+
const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
|
|
3830
|
+
const [query, setQuery] = useState('');
|
|
3831
|
+
const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
|
|
3832
|
+
const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
|
|
3833
|
+
const { close } = useDialogManager();
|
|
3834
|
+
const handleChangeLocation = useCallback((region) => {
|
|
3835
|
+
selectCurrentLocation(region);
|
|
3836
|
+
close();
|
|
3837
|
+
}, []);
|
|
3838
|
+
return (jsxs(Dialog, { head: jsxs("div", { children: [currentLocation ? (jsxs("div", { className: "mb-s", children: [jsx(Text, { size: "text-l", font: "font-light", children: "\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:\u00A0" }), jsx("button", { onClick: () => selectCurrentLocation(currentLocation), children: jsx(Text, { color: "text-primary-main", children: currentLocation.name }) })] })) : null, jsx(SearchBar$1, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
3839
|
+
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
3840
|
+
.map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-2 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
|
|
3841
|
+
});
|
|
3842
|
+
const regionFirstLetter = (region) => region.name?.charAt(0) || '';
|
|
3843
|
+
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
3844
|
+
...region,
|
|
3845
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
|
|
3846
|
+
}));
|
|
3847
|
+
|
|
3848
|
+
const useLocationDialog = () => {
|
|
3849
|
+
const { open, close } = useDialogManager();
|
|
3850
|
+
return {
|
|
3851
|
+
open: (options = {}) => open(jsx(LocationDialog, {}), options),
|
|
3852
|
+
close,
|
|
3853
|
+
};
|
|
3854
|
+
};
|
|
3855
|
+
|
|
3765
3856
|
const SearchInput = JSX(({ className, value, autoFocus, onChange, onFocus }) => {
|
|
3766
3857
|
const handleChange = useCallback((ev) => {
|
|
3767
3858
|
onChange && onChange(ev.target?.value || '');
|
|
@@ -3855,15 +3946,6 @@
|
|
|
3855
3946
|
};
|
|
3856
3947
|
const fetchSearchIndex = async (...basePathList) => (await Promise.allSettled(basePathList.map((basePath) => fetchJSON(joinPath(basePath, '/', SEARCH_INDEX_FILENAME))))).map((_) => (_.status === 'fulfilled' ? _.value : {}));
|
|
3857
3948
|
|
|
3858
|
-
const Dialog = JSX(({ className, head, children, onClose }) => {
|
|
3859
|
-
const { close } = useDialogManager();
|
|
3860
|
-
const handleClose = useCallback(() => {
|
|
3861
|
-
close();
|
|
3862
|
-
onClose && onClose();
|
|
3863
|
-
}, [onClose]);
|
|
3864
|
-
return (jsxs("div", { className: style('relative min-h-full bg-white p-5', className), children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
3865
|
-
});
|
|
3866
|
-
|
|
3867
3949
|
const Sitemap = JSX(({ className, topItems }) => {
|
|
3868
3950
|
const link = useLink({ isRemote: true });
|
|
3869
3951
|
return (jsx("div", { className: style('flex items-start justify-between', className), children: topItems?.map(link).map(renderColumn) }));
|
|
@@ -3917,7 +3999,7 @@
|
|
|
3917
3999
|
};
|
|
3918
4000
|
|
|
3919
4001
|
const MIN_QUERY_LEN = 3;
|
|
3920
|
-
const SearchBar
|
|
4002
|
+
const SearchBar = JSX(({ className }) => {
|
|
3921
4003
|
const [value, setValue] = useState('');
|
|
3922
4004
|
const resetQueryOnDialogClose = useCallback(() => setValue(''), []);
|
|
3923
4005
|
const { open } = useSearchDialog();
|
|
@@ -3931,129 +4013,60 @@
|
|
|
3931
4013
|
});
|
|
3932
4014
|
const isQueryLongEnough = (_) => _ && _.length >= MIN_QUERY_LEN;
|
|
3933
4015
|
|
|
3934
|
-
const
|
|
3935
|
-
|
|
3936
|
-
const
|
|
3937
|
-
return data || [];
|
|
3938
|
-
}
|
|
3939
|
-
|
|
3940
|
-
const groupBy = (list, keyGetter) => {
|
|
3941
|
-
const result = new Map();
|
|
3942
|
-
for (const item of list) {
|
|
3943
|
-
const key = keyGetter(item);
|
|
3944
|
-
const group = result.get(key) || [];
|
|
3945
|
-
result.set(key, [...group, item]);
|
|
3946
|
-
}
|
|
3947
|
-
return result;
|
|
3948
|
-
};
|
|
3949
|
-
|
|
3950
|
-
const renderForeignOffices = (foreignOffices) => foreignOffices?.length ? (jsxs("div", { className: "border-t border-main-divider mt-2xs pt-2xs", children: [jsx("div", { className: "mb-m", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: "\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0437\u0430 \u0440\u0443\u0431\u0435\u0436\u043E\u043C:" }) }), jsx("div", { className: "flex gap-5xl", children: foreignOffices.map((office, i) => (jsx(ForeignOffice, { ...office }, String(i)))) })] })) : null;
|
|
3951
|
-
const ForeignOffice = JSX(({ icon, ...rest }) => {
|
|
3952
|
-
const link = useLink();
|
|
3953
|
-
const { text, target, href, onClick } = link(rest);
|
|
3954
|
-
return (jsxs("div", { className: "flex gap-s", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: text })) : null] }));
|
|
3955
|
-
});
|
|
3956
|
-
|
|
3957
|
-
const renderRegion = (onChangeLocation) => (region) => (jsx("div", { className: "mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
|
|
3958
|
-
onChangeLocation && onChangeLocation(region);
|
|
3959
|
-
}, children: region.name || '' }) }, region.id));
|
|
3960
|
-
|
|
3961
|
-
const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
|
|
3962
|
-
|
|
3963
|
-
const SearchBar = JSX(({ className, searchTerm, onSearch }) => {
|
|
3964
|
-
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: `h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border
|
|
3965
|
-
outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text`, value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
3966
|
-
});
|
|
3967
|
-
|
|
3968
|
-
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
3969
|
-
const LocationDialog = JSX(() => {
|
|
3970
|
-
const { defaultLocation, foreignOffices } = useSitemap();
|
|
3971
|
-
const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
|
|
3972
|
-
const [query, setQuery] = useState('');
|
|
3973
|
-
const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
|
|
3974
|
-
const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
|
|
3975
|
-
const { close } = useDialogManager();
|
|
3976
|
-
const handleChangeLocation = useCallback((region) => {
|
|
3977
|
-
selectCurrentLocation(region);
|
|
3978
|
-
close();
|
|
3979
|
-
}, []);
|
|
3980
|
-
return (jsxs(Dialog, { head: jsxs("div", { children: [currentLocation ? (jsxs("div", { className: "mb-s", children: [jsx(Text, { size: "text-l", font: "font-light", children: "\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:\u00A0" }), jsx("button", { onClick: () => selectCurrentLocation(currentLocation), children: jsx(Text, { color: "text-primary-main", children: currentLocation.name }) })] })) : null, jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
3981
|
-
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
3982
|
-
.map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-2 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
|
|
3983
|
-
});
|
|
3984
|
-
const regionFirstLetter = (region) => region.name?.charAt(0) || '';
|
|
3985
|
-
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
3986
|
-
...region,
|
|
3987
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
|
|
3988
|
-
}));
|
|
3989
|
-
|
|
3990
|
-
const useLocationDialog = () => {
|
|
3991
|
-
const { open, close } = useDialogManager();
|
|
3992
|
-
return {
|
|
3993
|
-
open: (options = {}) => open(jsx(LocationDialog, {}), options),
|
|
3994
|
-
close,
|
|
3995
|
-
};
|
|
3996
|
-
};
|
|
3997
|
-
|
|
3998
|
-
const TopItemMobile = ({ item, i, isActive }) => {
|
|
3999
|
-
const link = useLink();
|
|
4000
|
-
const { href, target, onClick } = link(item);
|
|
4001
|
-
return (jsxs("a", { href: href, target: target, onClick: onClick, className: "relative", "aria-label": item.text, children: [jsx("span", { className: style('whitespace-nowrap', isActive ? 'text-primary-main' : ''), children: item.text }), isActive ? (jsx("div", { className: "absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" })) : null] }, String(i)));
|
|
4002
|
-
};
|
|
4003
|
-
|
|
4004
|
-
const ActiveSubMenuItem = JSX(({ item, i }) => {
|
|
4005
|
-
const link = useLink();
|
|
4016
|
+
const ActiveSubMenuItem = JSX(({ item, basePath }) => {
|
|
4017
|
+
const isAnotherPortal = projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
4018
|
+
const link = useLink({ isRemote: isAnotherPortal, basePath });
|
|
4006
4019
|
const { href, target, onClick } = link(item);
|
|
4007
|
-
return (jsxs("a", { className: "py-3 text-h5 font-light flex justify-between cursor-pointer", href: href, target: target, onClick: onClick, children: [item.text, jsx(Img, { image: { icon: 'ChevronLeftIcon', iconVersion: 'black' }, width: "24", height: "24", className: "text-secondary-text rotate-180 opacity-30" })] }
|
|
4020
|
+
return (jsxs("a", { className: "py-3 text-h5 font-light flex justify-between cursor-pointer", href: href, target: target, onClick: onClick, children: [item.text, jsx(Img, { image: { icon: 'ChevronLeftIcon', iconVersion: 'black' }, width: "24", height: "24", className: "text-secondary-text rotate-180 opacity-30" })] }));
|
|
4008
4021
|
});
|
|
4009
4022
|
|
|
4010
|
-
const ActiveSubMenu = JSX(({ activeMenuSubItems }) => {
|
|
4011
|
-
return activeMenuSubItems ? (jsx("div", { className: "mb-5", children: activeMenuSubItems.map((_, i) => (jsx(ActiveSubMenuItem, { item: _,
|
|
4023
|
+
const ActiveSubMenu = JSX(({ activeMenuSubItems, basePath }) => {
|
|
4024
|
+
return activeMenuSubItems ? (jsx("div", { className: "mb-5", children: activeMenuSubItems.map((_, i) => (jsx(ActiveSubMenuItem, { item: _, basePath: basePath }, String(i)))) })) : null;
|
|
4012
4025
|
});
|
|
4013
4026
|
|
|
4014
|
-
const
|
|
4015
|
-
|
|
4016
|
-
const isTopItemActive = (router) => isHrefActive(projectSettings.BASE_PATH ? { pathname: projectSettings.BASE_PATH } : router);
|
|
4017
|
-
|
|
4018
|
-
function useActiveRoute(items = []) {
|
|
4019
|
-
const router = useRouter();
|
|
4020
|
-
const activeIndex = items.findIndex(isTopItemActive(router));
|
|
4021
|
-
return [activeIndex, items[activeIndex]];
|
|
4022
|
-
}
|
|
4027
|
+
const TopItemMobile = ({ item, isActive, onClick }) => (jsxs("button", { type: "button", onClick: onClick, children: [jsx("span", { className: style('whitespace-nowrap', isActive ? 'text-primary-main' : ''), children: item.text }), isActive ? (jsx("div", { className: "absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" })) : null] }));
|
|
4023
4028
|
|
|
4024
4029
|
const BurgerMenuDialog = JSX((props) => {
|
|
4025
4030
|
const { topItems, officesLink, defaultLocation } = useSitemap(props.options?.page?.fallback);
|
|
4026
4031
|
const [location] = useLocation(defaultLocation);
|
|
4027
4032
|
const locationDialog = useLocationDialog();
|
|
4028
4033
|
const openLocationDialog = useCallback(() => locationDialog.open(), []);
|
|
4029
|
-
const itemCount = Array.isArray(topItems) ? topItems.length : 0;
|
|
4030
4034
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
4031
|
-
itemCount,
|
|
4035
|
+
itemCount: topItems?.length ?? 0,
|
|
4032
4036
|
});
|
|
4033
|
-
const [
|
|
4037
|
+
const [activeIndex] = useActiveRoute(topItems);
|
|
4038
|
+
const [activeTopItemIndex, setActiveTopItemIndex] = useState(activeIndex);
|
|
4039
|
+
const activeRoute = useMemo(() => topItems?.[activeTopItemIndex], [topItems, activeTopItemIndex]);
|
|
4034
4040
|
const activeMenuSubItems = activeRoute?.items || [];
|
|
4041
|
+
useEffect(() => {
|
|
4042
|
+
setActiveTopItemIndex(activeIndex);
|
|
4043
|
+
}, [activeIndex]);
|
|
4035
4044
|
useEffect(() => {
|
|
4036
4045
|
if (activeTopItemIndex > 0) {
|
|
4037
4046
|
scroll.scrollTo(activeTopItemIndex);
|
|
4038
4047
|
}
|
|
4039
4048
|
}, [activeTopItemIndex, scroll]);
|
|
4040
|
-
|
|
4049
|
+
const handleTopItemClick = useCallback((idx) => setActiveTopItemIndex(idx), []);
|
|
4050
|
+
return (jsx(Dialog, { head: jsx("div", { className: "flex items-center", children: jsx(Heading, { as: "h4", title: "\u041C\u0435\u043D\u044E" }) }), children: jsxs("div", { className: "flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md", children: [jsx("div", { className: "w-full mb-3", children: jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: 0, gap: 20, className: "pb-3", children: topItems?.map((item, i) => (jsx(TopItemMobile, { item: item, isActive: activeTopItemIndex === i, onClick: () => handleTopItemClick(i) }, String(i)))) }) }), jsxs("div", { className: "relative grow overflow-auto", children: [jsx(ActiveSubMenu, { activeMenuSubItems: activeMenuSubItems, basePath: activeRoute?.href }), jsx(SearchBar, { className: "grow mb-5" }), renderOfficeLink(officesLink), jsxs("div", { className: "flex items-center text-s cursor-pointer", onClick: openLocationDialog, children: [jsx(Img, { image: { icon: 'GeolocationIcon', iconVersion: 'black' }, width: "24", height: "24", className: "text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md" }), jsxs("div", { className: "flex flex-col items-start", children: [jsx(Text, { size: "text-h5", children: location.name }), jsx(Text, { color: "text-secondary-text", size: "text-s", children: "\u0412\u0430\u0448\u0430 \u043B\u043E\u043A\u0430\u0446\u0438\u044F" })] })] })] })] }) }));
|
|
4041
4051
|
});
|
|
4042
4052
|
const renderOfficeLink = (officesLink) => officesLink ? (jsxs("a", { className: "flex items-center mb-3", href: officesLink, rel: "noopener noreferrer", "aria-label": "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", children: [jsx(Img, { image: { icon: 'MapOpenedIcon', iconVersion: 'black' }, width: "24", height: "24", className: "text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md" }), jsx("span", { children: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B" })] })) : null;
|
|
4043
4053
|
|
|
4044
|
-
const RenderItem = JSX(({ item,
|
|
4045
|
-
const
|
|
4054
|
+
const RenderItem = JSX(({ item, onClick }) => {
|
|
4055
|
+
const isAnotherPortal = projectSettings?.BASE_PATH
|
|
4056
|
+
? !item.url?.startsWith(projectSettings?.BASE_PATH)
|
|
4057
|
+
: true;
|
|
4058
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
4046
4059
|
const { href, target, onClick: handleClick, } = link({
|
|
4047
4060
|
href: item.url,
|
|
4048
4061
|
target: '_self',
|
|
4049
4062
|
});
|
|
4050
4063
|
return (jsxs("a", { className: style(item.isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-[10px] cursor-pointer`), onClick: () => (item?.icon?.icon === 'BurgerIcon' && onClick ? onClick() : handleClick()), href: href, target: target, children: [jsx(Img, { className: "w-6 h-6", image: {
|
|
4051
|
-
icon: item
|
|
4052
|
-
iconVersion: item
|
|
4053
|
-
} }), item.title] }
|
|
4064
|
+
icon: item?.icon?.icon,
|
|
4065
|
+
iconVersion: item?.icon?.iconVersion || 'black',
|
|
4066
|
+
} }), item.title] }));
|
|
4054
4067
|
});
|
|
4055
4068
|
|
|
4056
|
-
const renderMenuItems = (menuItems, onClick) => (jsx(BlockWrapper, { className: "sticky bottom-0 left-0 right-0 bg-transparent z-[100]", padding: "p-0", children: jsx("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: menuItems.map((_, i) => (jsx(RenderItem, { item: _,
|
|
4069
|
+
const renderMenuItems = (menuItems, onClick) => (jsx(BlockWrapper, { className: "sticky bottom-0 left-0 right-0 bg-transparent z-[100]", padding: "p-0", children: jsx("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: menuItems.map((_, i) => (jsx(RenderItem, { item: _, onClick: onClick }, String(i)))) }) }));
|
|
4057
4070
|
|
|
4058
4071
|
function useList(initialList = []) {
|
|
4059
4072
|
const [list, setList] = useState(initialList);
|
|
@@ -4114,7 +4127,7 @@
|
|
|
4114
4127
|
};
|
|
4115
4128
|
|
|
4116
4129
|
const StickyBottomMenu = JSX(({ ...rest }) => {
|
|
4117
|
-
const { menuItems = [] } = useSWRResource(projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', rest.options?.page?.fallback, 'portal-resources');
|
|
4130
|
+
const { menuItems = [] } = useSWRResource(projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', { fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true });
|
|
4118
4131
|
const [isBurgerMenuDialogOpen, { toggle }] = useBurgerMenuDialog();
|
|
4119
4132
|
const burgerMenu = {
|
|
4120
4133
|
title: 'Меню',
|
|
@@ -4502,7 +4515,7 @@
|
|
|
4502
4515
|
|
|
4503
4516
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
4504
4517
|
|
|
4505
|
-
const packageVersion = "0.13.
|
|
4518
|
+
const packageVersion = "0.13.14";
|
|
4506
4519
|
|
|
4507
4520
|
exports.Blocks = Blocks;
|
|
4508
4521
|
exports.ContentPage = ContentPage;
|