@redneckz/wildless-cms-uni-blocks 0.14.261 → 0.14.263
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/bundle.umd.js +6 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
- package/bundle/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
- package/bundle/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
- package/bundle/data/StickyMobileData.d.ts +2 -2
- package/dist/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
- package/dist/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +22 -42
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +17 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
- package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
- package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +15 -0
- package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
- package/dist/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
- package/dist/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/dist/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/dist/data/StickyMobileData.d.ts +2 -2
- package/lib/common.css +1 -1
- package/lib/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
- package/lib/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +23 -43
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +15 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
- package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
- package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +12 -0
- package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
- package/lib/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
- package/lib/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/lib/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/lib/data/StickyMobileData.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +54 -52
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
- package/mobile/bundle/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
- package/mobile/bundle/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
- package/mobile/bundle/data/StickyMobileData.d.ts +2 -2
- package/mobile/dist/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
- package/mobile/dist/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +22 -42
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +17 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
- package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
- package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +15 -0
- package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
- package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
- package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/mobile/dist/data/StickyMobileData.d.ts +2 -2
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
- package/mobile/lib/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +23 -43
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +15 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
- package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
- package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +12 -0
- package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
- package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
- package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
- package/mobile/lib/data/StickyMobileData.d.ts +2 -2
- package/mobile/src/components/OfficesAtmsMap/renderWorkSchedule.tsx +12 -5
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +27 -67
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +39 -0
- package/mobile/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +54 -0
- package/mobile/src/components/StickyBottomMenu/useBurgerMenuDialog.tsx +1 -2
- package/mobile/src/data/StickyMobileData.ts +2 -2
- package/package.json +1 -1
- package/src/components/OfficesAtmsMap/renderWorkSchedule.tsx +12 -5
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +27 -67
- package/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +39 -0
- package/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +54 -0
- package/src/components/StickyBottomMenu/useBurgerMenuDialog.tsx +1 -2
- package/src/data/StickyMobileData.ts +2 -2
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
import { useCallback,
|
|
3
|
-
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
2
|
+
import { useCallback, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
3
|
import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
|
|
5
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
6
|
-
import { Dialog } from '../../ui-kit/DialogManager/Dialog.js';
|
|
7
|
-
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
8
5
|
import { UniBlock } from '../../UniBlock/UniBlock.js';
|
|
9
6
|
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger.js';
|
|
10
7
|
import { StickyBottomMenuItem } from './StickyBottomMenuItem.js';
|
|
8
|
+
import { useBottomMenuItemDialog } from './useBottomMenuItemDialog.js';
|
|
11
9
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog.js';
|
|
12
10
|
const EMPTY_MENU = [];
|
|
13
|
-
// eslint-disable-next-line max-lines-per-function
|
|
14
11
|
export const StickyBottomMenu = UniBlock(({ sticky, ...rest }) => {
|
|
15
12
|
const { menuItems = EMPTY_MENU } = sticky ?? {};
|
|
16
13
|
const [isBurgerMenuDialogOpen, { toggle, close, openDialog }] = useBurgerMenuDialog(rest.options?.page?.sitemap ?? {});
|
|
@@ -19,56 +16,39 @@ export const StickyBottomMenu = UniBlock(({ sticky, ...rest }) => {
|
|
|
19
16
|
const rightItems = menuItems.slice(middleIdx);
|
|
20
17
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
21
18
|
const [currentItemPosition, setCurrentItemPosition] = useState('');
|
|
22
|
-
const
|
|
23
|
-
const closePopupDialog = useCallback(() => {
|
|
24
|
-
setPopupDialogClosed();
|
|
19
|
+
const closeDialog = useCallback(() => {
|
|
25
20
|
setActiveIndex(-1);
|
|
26
21
|
setCurrentItemPosition('');
|
|
27
22
|
close();
|
|
28
23
|
}, [close]);
|
|
29
24
|
const menuRef = useRef(null);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
const dialogRef = useOutsideClick(closeDialog);
|
|
26
|
+
const [{ openBottomMenuItemDialog }] = useBottomMenuItemDialog({
|
|
27
|
+
menuRef,
|
|
28
|
+
dialogRef,
|
|
29
|
+
closeDialog,
|
|
30
|
+
openDialog,
|
|
31
|
+
leftItems,
|
|
32
|
+
rightItems,
|
|
33
|
+
});
|
|
34
|
+
const handleMenuBurgerClick = useCallback((e) => {
|
|
35
|
+
closeDialog();
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
toggle();
|
|
38
|
+
}, [closeDialog, toggle]);
|
|
38
39
|
const handleMenuItemClick = useCallback((index, itemsPosition) => {
|
|
39
40
|
setCurrentItemPosition(itemsPosition);
|
|
40
41
|
setActiveIndex(index);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (!popupDialogRef.current.shadowRoot) {
|
|
48
|
-
popupDialogRef.current?.attachShadow({ mode: 'open' });
|
|
49
|
-
}
|
|
50
|
-
const shadowRoot = popupDialogRef.current.shadowRoot;
|
|
51
|
-
if (!shadowRoot) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (currentItemPosition === 'left') {
|
|
55
|
-
shadowRoot.innerHTML = leftItems[activeIndex]?.__html || '';
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
shadowRoot.innerHTML = rightItems[activeIndex]?.__html || '';
|
|
59
|
-
}
|
|
60
|
-
}, [activeIndex, currentItemPosition, popupDialogState]);
|
|
61
|
-
return (_jsx(BlockWrapper, { className: "h-[74px] z-[100] relative", defaultPadding: "p-0", ...rest, children: _jsxs("div", { ref: menuRef, className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(handleMenuItemClick, 'left', { activeIndex, currentItemPosition })), _jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: (e) => {
|
|
62
|
-
closePopupDialog();
|
|
63
|
-
e.stopPropagation();
|
|
64
|
-
toggle();
|
|
65
|
-
} }), rightItems.map(renderMenuItem(handleMenuItemClick, 'right', { activeIndex, currentItemPosition }))] }) }));
|
|
42
|
+
close();
|
|
43
|
+
openBottomMenuItemDialog(index, itemsPosition);
|
|
44
|
+
}, [close, openBottomMenuItemDialog]);
|
|
45
|
+
return (_jsx(BlockWrapper, { className: "h-[74px] z-[100] relative", defaultPadding: "p-0", ...rest, children: _jsxs("div", { ref: menuRef, className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(handleMenuItemClick, 'left', { activeIndex, currentItemPosition })), _jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: (e) => handleMenuBurgerClick(e) }), rightItems.map(renderMenuItem(handleMenuItemClick, 'right', { activeIndex, currentItemPosition }))] }) }));
|
|
66
46
|
});
|
|
67
|
-
const renderMenuItem = (
|
|
47
|
+
const renderMenuItem = (onClick, itemsPosition, currentActiveItem) => (_, i, arr) => {
|
|
68
48
|
return (_jsx(StickyBottomMenuItem, { item: _, isActive: arr[currentActiveItem.activeIndex]?.title === _?.title &&
|
|
69
49
|
currentActiveItem.currentItemPosition === itemsPosition, onClick: (e) => {
|
|
70
50
|
e.stopPropagation();
|
|
71
|
-
|
|
51
|
+
onClick(i, itemsPosition);
|
|
72
52
|
} }, _.title || String(i)));
|
|
73
53
|
};
|
|
74
54
|
//# sourceMappingURL=StickyBottomMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenu.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"StickyBottomMenu.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { type PreventableEvent } from '../../ui-kit/PreventableEvent';
|
|
3
|
+
export interface StickyBottomMenuDialogProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
head?: VNode;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
onClick?: (e: PreventableEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const StickyBottomMenuDialog: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuDialogProps, any, any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
+
import { CloseButton } from '../../ui-kit/DialogManager/CloseButton.js';
|
|
5
|
+
import { useDialogManager } from '../../ui-kit/DialogManager/useDialogManager.js';
|
|
6
|
+
import { style } from '../../utils/style.js';
|
|
7
|
+
export const StickyBottomMenuDialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
8
|
+
const { close } = useDialogManager();
|
|
9
|
+
const handleClose = useCallback(() => {
|
|
10
|
+
close();
|
|
11
|
+
onClose && onClose();
|
|
12
|
+
}, [onClose]);
|
|
13
|
+
return (_jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white p-0 rounded-xl mt-[20%]', className), role: "dialog", children: [_jsxs("div", { className: "sticky py-xl top-0 rounded-xl bg-white z-10", children: [_jsx(CloseButton, { className: "absolute top-1.5 right-0", onClose: handleClose }), _jsx("div", { className: "container", children: head })] }), _jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=StickyBottomMenuDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAS1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CACvC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;IAClD,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAErC,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,KAAK,EAAE,CAAC;QACR,OAAO,IAAI,OAAO,EAAE,CAAC;IACvB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,eACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,KAAK,CAAC,sDAAsD,EAAE,SAAS,CAAC,EACnF,IAAI,EAAC,QAAQ,aAEb,eAAK,SAAS,EAAC,6CAA6C,aAC1D,KAAC,WAAW,IAAC,SAAS,EAAC,0BAA0B,EAAC,OAAO,EAAE,WAAW,GAAI,EAC1E,cAAK,SAAS,EAAC,WAAW,YAAE,IAAI,GAAO,IACnC,EACN,cAAK,SAAS,EAAC,kBAAkB,YAAE,QAAQ,GAAO,IAC9C,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type StickyMenuItem } from '../../data/StickyMobileData';
|
|
2
|
+
import { type VNode } from '../../model/VNode';
|
|
3
|
+
import { type DialogOptions } from '../../ui-kit/DialogManager/useDialogManager';
|
|
4
|
+
interface BottomMenuItemDialog {
|
|
5
|
+
menuRef?: {
|
|
6
|
+
current: HTMLDivElement | null;
|
|
7
|
+
};
|
|
8
|
+
dialogRef?: {
|
|
9
|
+
current: HTMLDivElement | null;
|
|
10
|
+
};
|
|
11
|
+
closeDialog: () => void;
|
|
12
|
+
openDialog: (dialog: VNode, options: DialogOptions) => void;
|
|
13
|
+
leftItems: StickyMenuItem[];
|
|
14
|
+
rightItems: StickyMenuItem[];
|
|
15
|
+
}
|
|
16
|
+
export declare const useBottomMenuItemDialog: ({ menuRef, dialogRef, closeDialog, openDialog, leftItems, rightItems, }: BottomMenuItemDialog) => {
|
|
17
|
+
openBottomMenuItemDialog: (index: number, itemsPosition: string) => void;
|
|
18
|
+
}[];
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
3
|
+
import { StickyBottomMenuDialog } from './StickyBottomMenuDialog.js';
|
|
4
|
+
export const useBottomMenuItemDialog = ({ menuRef, dialogRef, closeDialog, openDialog, leftItems, rightItems, }) => {
|
|
5
|
+
const openBottomMenuItemDialog = (index, itemsPosition) => {
|
|
6
|
+
const requiredArray = itemsPosition === 'left' ? leftItems : rightItems;
|
|
7
|
+
const menuDimensions = menuRef?.current?.getBoundingClientRect();
|
|
8
|
+
openDialog(_jsx(StickyBottomMenuDialog, { onClick: (e) => e.stopPropagation(), onClose: closeDialog, head: _jsx("div", { className: "flex items-center px-xl", children: _jsx(Heading, { as: "h4", title: requiredArray[index].title }) }), children: _jsx("div", { className: "bg-white pb-20 pt-1 text-l", ref: dialogRef, children: _jsx("iframe", { src: requiredArray[index]?.src, className: "min-h-[90vh]", width: menuDimensions?.width || 0 }) }) }), { id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title });
|
|
9
|
+
};
|
|
10
|
+
return [{ openBottomMenuItemDialog }];
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useBottomMenuItemDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBottomMenuItemDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAelE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,GACW,EAAE,EAAE;IACzB,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAE,aAAqB,EAAE,EAAE;QACxE,MAAM,aAAa,GAAG,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;QACxE,MAAM,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;QACjE,UAAU,CACR,KAAC,sBAAsB,IACrB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACnC,OAAO,EAAE,WAAW,EACpB,IAAI,EACF,cAAK,SAAS,EAAC,yBAAyB,YACtC,KAAC,OAAO,IAAC,EAAE,EAAC,IAAI,EAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,GAAI,GAClD,YAGR,cAAK,SAAS,EAAC,4BAA4B,EAAC,GAAG,EAAE,SAAS,YACxD,iBACE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,GAAG,EAC9B,SAAS,EAAC,cAAc,EACxB,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC,GACjC,GACE,GACiB,EACzB,EAAE,EAAE,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CACpF,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC"}
|
|
@@ -3,7 +3,6 @@ import { type DialogOptions } from '../../ui-kit/DialogManager/useDialogManager'
|
|
|
3
3
|
import { type BurgerMenuDialogProps } from './BurgerMenuDialog';
|
|
4
4
|
export declare const BURGER_MENU_DIALOG_ID = "burgerMenuDialog";
|
|
5
5
|
export declare const useBurgerMenuDialog: (props: BurgerMenuDialogProps) => [boolean, {
|
|
6
|
-
open: () => void;
|
|
7
6
|
close: () => void;
|
|
8
7
|
toggle: () => void;
|
|
9
8
|
openDialog: (dialog: VNode, options: DialogOptions) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBurgerMenuDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/useBurgerMenuDialog.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC;AAElF,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAA4B,
|
|
1
|
+
{"version":3,"file":"useBurgerMenuDialog.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/useBurgerMenuDialog.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC;AAElF,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAA4B,EAQ5B,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEjE,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,YAAY,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAEtE,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAC,gBAAgB,OAAK,KAAK,GAAI,EAAE,EAAE,EAAE,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC9F,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,IAAI,gBAAgB,EAAE;YACpB,QAAQ,EAAE,CAAC;SACZ;aAAM;YACL,IAAI,EAAE,CAAC;SACR;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC"}
|
|
@@ -5,8 +5,8 @@ import { type Picture } from '../model/Picture';
|
|
|
5
5
|
export interface StickyMenuItem {
|
|
6
6
|
/** @title Название */
|
|
7
7
|
title?: string;
|
|
8
|
-
/** @title
|
|
9
|
-
|
|
8
|
+
/** @title Адрес страницы меню */
|
|
9
|
+
src?: string;
|
|
10
10
|
/** @title Иконка */
|
|
11
11
|
icon?: Picture;
|
|
12
12
|
}
|
|
@@ -5,6 +5,7 @@ import { type WorkSchedule } from './OfficesAtmsMapProps';
|
|
|
5
5
|
export const renderWorkSchedule = (workSchedule?: WorkSchedule) => {
|
|
6
6
|
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
7
7
|
const timeOfWork = workSchedule ? getDateDescription(workScheduleWeek) : '';
|
|
8
|
+
const businessTimeOfWork = workSchedule ? workSchedule.businessScheduleDescription : '';
|
|
8
9
|
|
|
9
10
|
if (!workSchedule) {
|
|
10
11
|
return null;
|
|
@@ -14,18 +15,24 @@ export const renderWorkSchedule = (workSchedule?: WorkSchedule) => {
|
|
|
14
15
|
return renderMatchingTimeOfWork(timeOfWork);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
if (
|
|
18
|
+
if (
|
|
19
|
+
workSchedule.businessScheduleVisibleTag &&
|
|
20
|
+
workSchedule.businessScheduleDescription === null
|
|
21
|
+
) {
|
|
18
22
|
return renderIndividualTimeOfWork(timeOfWork);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
return renderDefaultTimeOfWork(timeOfWork);
|
|
25
|
+
return renderDefaultTimeOfWork(timeOfWork, businessTimeOfWork);
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
const renderIndividualTimeOfWork = (timeOfWork: string[] | '') =>
|
|
25
29
|
`<p><b>Режим обслуживания физ.лиц:<br/></b>${timeOfWork}</p>`;
|
|
26
30
|
|
|
27
|
-
const renderDefaultTimeOfWork = (timeOfWork: string[] | '') =>
|
|
28
|
-
`<p><b>Режим обслуживания физ.лиц:<br/></b>${timeOfWork}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${timeOfWork}</p>`;
|
|
29
|
-
|
|
30
31
|
const renderMatchingTimeOfWork = (timeOfWork: string[] | '') =>
|
|
31
32
|
`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${timeOfWork}</p>`;
|
|
33
|
+
|
|
34
|
+
const renderDefaultTimeOfWork = (
|
|
35
|
+
timeOfWork: string[] | '',
|
|
36
|
+
businessTimeOfWork: string | undefined,
|
|
37
|
+
) =>
|
|
38
|
+
`<p><b>Режим обслуживания физ.лиц:<br/></b>${timeOfWork}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${businessTimeOfWork}</p>`;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { useCallback,
|
|
2
|
-
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
1
|
+
import { useCallback, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
|
|
4
3
|
import { type StickyMenuItem } from '../../data/StickyMobileData';
|
|
5
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
7
|
-
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
+
import { type PreventableEvent } from '../../ui-kit/PreventableEvent';
|
|
8
6
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
9
7
|
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger';
|
|
10
8
|
import { StickyBottomMenuItem } from './StickyBottomMenuItem';
|
|
11
9
|
import { type StickyBottomMenuProps } from './StickyBottomMenuProps';
|
|
10
|
+
import { useBottomMenuItemDialog } from './useBottomMenuItemDialog';
|
|
12
11
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog';
|
|
13
12
|
|
|
14
13
|
const EMPTY_MENU = [];
|
|
@@ -18,7 +17,6 @@ interface CurrentActiveItem {
|
|
|
18
17
|
currentItemPosition: string;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
// eslint-disable-next-line max-lines-per-function
|
|
22
20
|
export const StickyBottomMenu = UniBlock<StickyBottomMenuProps>(({ sticky, ...rest }) => {
|
|
23
21
|
const { menuItems = EMPTY_MENU } = sticky ?? {};
|
|
24
22
|
const [isBurgerMenuDialogOpen, { toggle, close, openDialog }] = useBurgerMenuDialog(
|
|
@@ -31,78 +29,44 @@ export const StickyBottomMenu = UniBlock<StickyBottomMenuProps>(({ sticky, ...re
|
|
|
31
29
|
|
|
32
30
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
33
31
|
const [currentItemPosition, setCurrentItemPosition] = useState<string>('');
|
|
34
|
-
const [popupDialogState, { setFalse: setPopupDialogClosed, setTrue: setPopupDialogOpened }] =
|
|
35
|
-
useBool();
|
|
36
32
|
|
|
37
|
-
const
|
|
38
|
-
setPopupDialogClosed();
|
|
33
|
+
const closeDialog = useCallback(() => {
|
|
39
34
|
setActiveIndex(-1);
|
|
40
35
|
setCurrentItemPosition('');
|
|
41
36
|
close();
|
|
42
37
|
}, [close]);
|
|
43
38
|
|
|
44
39
|
const menuRef = useRef<HTMLDivElement | null>(null);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
title={itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title}
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
}
|
|
65
|
-
>
|
|
66
|
-
<div className="bg-white pb-24 pt-1 text-l" ref={popupDialogRef}></div>
|
|
67
|
-
</Dialog>,
|
|
68
|
-
{
|
|
69
|
-
id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title,
|
|
70
|
-
},
|
|
71
|
-
);
|
|
40
|
+
const dialogRef = useOutsideClick<HTMLDivElement>(closeDialog);
|
|
41
|
+
|
|
42
|
+
const [{ openBottomMenuItemDialog }] = useBottomMenuItemDialog({
|
|
43
|
+
menuRef,
|
|
44
|
+
dialogRef,
|
|
45
|
+
closeDialog,
|
|
46
|
+
openDialog,
|
|
47
|
+
leftItems,
|
|
48
|
+
rightItems,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const handleMenuBurgerClick = useCallback(
|
|
52
|
+
(e: PreventableEvent) => {
|
|
53
|
+
closeDialog();
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
toggle();
|
|
72
56
|
},
|
|
73
|
-
[
|
|
57
|
+
[closeDialog, toggle],
|
|
74
58
|
);
|
|
75
59
|
|
|
76
60
|
const handleMenuItemClick = useCallback(
|
|
77
61
|
(index: number, itemsPosition: string) => {
|
|
78
62
|
setCurrentItemPosition(itemsPosition);
|
|
79
63
|
setActiveIndex(index);
|
|
80
|
-
|
|
64
|
+
close();
|
|
65
|
+
openBottomMenuItemDialog(index, itemsPosition);
|
|
81
66
|
},
|
|
82
|
-
[
|
|
67
|
+
[close, openBottomMenuItemDialog],
|
|
83
68
|
);
|
|
84
69
|
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (!popupDialogRef.current) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (!popupDialogRef.current.shadowRoot) {
|
|
91
|
-
popupDialogRef.current?.attachShadow({ mode: 'open' });
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const shadowRoot = popupDialogRef.current.shadowRoot;
|
|
95
|
-
if (!shadowRoot) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (currentItemPosition === 'left') {
|
|
100
|
-
shadowRoot.innerHTML = leftItems[activeIndex]?.__html || '';
|
|
101
|
-
} else {
|
|
102
|
-
shadowRoot.innerHTML = rightItems[activeIndex]?.__html || '';
|
|
103
|
-
}
|
|
104
|
-
}, [activeIndex, currentItemPosition, popupDialogState]);
|
|
105
|
-
|
|
106
70
|
return (
|
|
107
71
|
<BlockWrapper className="h-[74px] z-[100] relative" defaultPadding="p-0" {...rest}>
|
|
108
72
|
<div
|
|
@@ -114,11 +78,7 @@ export const StickyBottomMenu = UniBlock<StickyBottomMenuProps>(({ sticky, ...re
|
|
|
114
78
|
)}
|
|
115
79
|
<StickyBottomMenuBurger
|
|
116
80
|
isActive={isBurgerMenuDialogOpen}
|
|
117
|
-
onClick={(e) =>
|
|
118
|
-
closePopupDialog();
|
|
119
|
-
e.stopPropagation();
|
|
120
|
-
toggle();
|
|
121
|
-
}}
|
|
81
|
+
onClick={(e) => handleMenuBurgerClick(e)}
|
|
122
82
|
/>
|
|
123
83
|
{rightItems.map(
|
|
124
84
|
renderMenuItem(handleMenuItemClick, 'right', { activeIndex, currentItemPosition }),
|
|
@@ -130,7 +90,7 @@ export const StickyBottomMenu = UniBlock<StickyBottomMenuProps>(({ sticky, ...re
|
|
|
130
90
|
|
|
131
91
|
const renderMenuItem =
|
|
132
92
|
(
|
|
133
|
-
|
|
93
|
+
onClick: (index: number, itemsPosition: string) => void,
|
|
134
94
|
itemsPosition: string,
|
|
135
95
|
currentActiveItem: CurrentActiveItem,
|
|
136
96
|
) =>
|
|
@@ -145,7 +105,7 @@ const renderMenuItem =
|
|
|
145
105
|
}
|
|
146
106
|
onClick={(e) => {
|
|
147
107
|
e.stopPropagation();
|
|
148
|
-
|
|
108
|
+
onClick(i, itemsPosition);
|
|
149
109
|
}}
|
|
150
110
|
/>
|
|
151
111
|
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { type VNode } from '../../model/VNode';
|
|
4
|
+
import { CloseButton } from '../../ui-kit/DialogManager/CloseButton';
|
|
5
|
+
import { useDialogManager } from '../../ui-kit/DialogManager/useDialogManager';
|
|
6
|
+
import { type PreventableEvent } from '../../ui-kit/PreventableEvent';
|
|
7
|
+
import { style } from '../../utils/style';
|
|
8
|
+
|
|
9
|
+
export interface StickyBottomMenuDialogProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
head?: VNode;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
onClick?: (e: PreventableEvent) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const StickyBottomMenuDialog = JSX<StickyBottomMenuDialogProps>(
|
|
17
|
+
({ className, head, children, onClose, onClick }) => {
|
|
18
|
+
const { close } = useDialogManager();
|
|
19
|
+
|
|
20
|
+
const handleClose = useCallback(() => {
|
|
21
|
+
close();
|
|
22
|
+
onClose && onClose();
|
|
23
|
+
}, [onClose]);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
onClick={onClick}
|
|
28
|
+
className={style('relative min-h-full bg-white p-0 rounded-xl mt-[20%]', className)}
|
|
29
|
+
role="dialog"
|
|
30
|
+
>
|
|
31
|
+
<div className="sticky py-xl top-0 rounded-xl bg-white z-10">
|
|
32
|
+
<CloseButton className="absolute top-1.5 right-0" onClose={handleClose} />
|
|
33
|
+
<div className="container">{head}</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div className="container pb-6xl">{children}</div>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type StickyMenuItem } from '../../data/StickyMobileData';
|
|
2
|
+
import { type VNode } from '../../model/VNode';
|
|
3
|
+
import { type DialogOptions } from '../../ui-kit/DialogManager/useDialogManager';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
+
import { StickyBottomMenuDialog } from './StickyBottomMenuDialog';
|
|
6
|
+
|
|
7
|
+
interface BottomMenuItemDialog {
|
|
8
|
+
menuRef?: {
|
|
9
|
+
current: HTMLDivElement | null;
|
|
10
|
+
};
|
|
11
|
+
dialogRef?: {
|
|
12
|
+
current: HTMLDivElement | null;
|
|
13
|
+
};
|
|
14
|
+
closeDialog: () => void;
|
|
15
|
+
openDialog: (dialog: VNode, options: DialogOptions) => void;
|
|
16
|
+
leftItems: StickyMenuItem[];
|
|
17
|
+
rightItems: StickyMenuItem[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const useBottomMenuItemDialog = ({
|
|
21
|
+
menuRef,
|
|
22
|
+
dialogRef,
|
|
23
|
+
closeDialog,
|
|
24
|
+
openDialog,
|
|
25
|
+
leftItems,
|
|
26
|
+
rightItems,
|
|
27
|
+
}: BottomMenuItemDialog) => {
|
|
28
|
+
const openBottomMenuItemDialog = (index: number, itemsPosition: string) => {
|
|
29
|
+
const requiredArray = itemsPosition === 'left' ? leftItems : rightItems;
|
|
30
|
+
const menuDimensions = menuRef?.current?.getBoundingClientRect();
|
|
31
|
+
openDialog(
|
|
32
|
+
<StickyBottomMenuDialog
|
|
33
|
+
onClick={(e) => e.stopPropagation()}
|
|
34
|
+
onClose={closeDialog}
|
|
35
|
+
head={
|
|
36
|
+
<div className="flex items-center px-xl">
|
|
37
|
+
<Heading as="h4" title={requiredArray[index].title} />
|
|
38
|
+
</div>
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
<div className="bg-white pb-20 pt-1 text-l" ref={dialogRef}>
|
|
42
|
+
<iframe
|
|
43
|
+
src={requiredArray[index]?.src}
|
|
44
|
+
className="min-h-[90vh]"
|
|
45
|
+
width={menuDimensions?.width || 0}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</StickyBottomMenuDialog>,
|
|
49
|
+
{ id: itemsPosition === 'left' ? leftItems[index].title : rightItems[index].title },
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return [{ openBottomMenuItemDialog }];
|
|
54
|
+
};
|
|
@@ -11,7 +11,6 @@ export const useBurgerMenuDialog = (
|
|
|
11
11
|
): [
|
|
12
12
|
boolean,
|
|
13
13
|
{
|
|
14
|
-
open: () => void;
|
|
15
14
|
close: () => void;
|
|
16
15
|
toggle: () => void;
|
|
17
16
|
openDialog: (dialog: VNode, options: DialogOptions) => void;
|
|
@@ -31,5 +30,5 @@ export const useBurgerMenuDialog = (
|
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
return [isBurgerMenuOpen, {
|
|
33
|
+
return [isBurgerMenuOpen, { close, toggle, openDialog }];
|
|
35
34
|
};
|
|
@@ -6,8 +6,8 @@ import { type Picture } from '../model/Picture';
|
|
|
6
6
|
export interface StickyMenuItem {
|
|
7
7
|
/** @title Название */
|
|
8
8
|
title?: string;
|
|
9
|
-
/** @title
|
|
10
|
-
|
|
9
|
+
/** @title Адрес страницы меню */
|
|
10
|
+
src?: string;
|
|
11
11
|
/** @title Иконка */
|
|
12
12
|
icon?: Picture;
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { type WorkSchedule } from './OfficesAtmsMapProps';
|
|
|
5
5
|
export const renderWorkSchedule = (workSchedule?: WorkSchedule) => {
|
|
6
6
|
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
7
7
|
const timeOfWork = workSchedule ? getDateDescription(workScheduleWeek) : '';
|
|
8
|
+
const businessTimeOfWork = workSchedule ? workSchedule.businessScheduleDescription : '';
|
|
8
9
|
|
|
9
10
|
if (!workSchedule) {
|
|
10
11
|
return null;
|
|
@@ -14,18 +15,24 @@ export const renderWorkSchedule = (workSchedule?: WorkSchedule) => {
|
|
|
14
15
|
return renderMatchingTimeOfWork(timeOfWork);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
if (
|
|
18
|
+
if (
|
|
19
|
+
workSchedule.businessScheduleVisibleTag &&
|
|
20
|
+
workSchedule.businessScheduleDescription === null
|
|
21
|
+
) {
|
|
18
22
|
return renderIndividualTimeOfWork(timeOfWork);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
return renderDefaultTimeOfWork(timeOfWork);
|
|
25
|
+
return renderDefaultTimeOfWork(timeOfWork, businessTimeOfWork);
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
const renderIndividualTimeOfWork = (timeOfWork: string[] | '') =>
|
|
25
29
|
`<p><b>Режим обслуживания физ.лиц:<br/></b>${timeOfWork}</p>`;
|
|
26
30
|
|
|
27
|
-
const renderDefaultTimeOfWork = (timeOfWork: string[] | '') =>
|
|
28
|
-
`<p><b>Режим обслуживания физ.лиц:<br/></b>${timeOfWork}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${timeOfWork}</p>`;
|
|
29
|
-
|
|
30
31
|
const renderMatchingTimeOfWork = (timeOfWork: string[] | '') =>
|
|
31
32
|
`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${timeOfWork}</p>`;
|
|
33
|
+
|
|
34
|
+
const renderDefaultTimeOfWork = (
|
|
35
|
+
timeOfWork: string[] | '',
|
|
36
|
+
businessTimeOfWork: string | undefined,
|
|
37
|
+
) =>
|
|
38
|
+
`<p><b>Режим обслуживания физ.лиц:<br/></b>${timeOfWork}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${businessTimeOfWork}</p>`;
|