@redneckz/wildless-cms-uni-blocks 0.14.78 → 0.14.80
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 +73 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -3
- package/bundle/components/OfficesAtmsMap/renderCurrency.d.ts +3 -0
- package/bundle/components/OfficesAtmsMap/renderCurrentDaySchedule.d.ts +3 -0
- package/bundle/components/OfficesAtmsMap/renderDay.d.ts +3 -0
- package/bundle/components/OfficesAtmsMap/renderFoldButton.d.ts +3 -0
- package/bundle/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -4
- package/dist/components/LinkDocs/LinkDocItem.js +3 -2
- package/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.js +8 -1
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/OfficesAtmsMap/Badge.js +1 -1
- package/dist/components/OfficesAtmsMap/Badge.js.map +1 -1
- package/dist/components/OfficesAtmsMap/CardRow.js +1 -1
- package/dist/components/OfficesAtmsMap/CardRow.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -3
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderAtmCard.js +8 -1
- package/dist/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderCurrency.d.ts +3 -0
- package/dist/components/OfficesAtmsMap/renderCurrency.js +7 -0
- package/dist/components/OfficesAtmsMap/renderCurrency.js.map +1 -0
- package/dist/components/OfficesAtmsMap/renderCurrentDaySchedule.d.ts +3 -0
- package/dist/components/OfficesAtmsMap/renderCurrentDaySchedule.js +16 -0
- package/dist/components/OfficesAtmsMap/renderCurrentDaySchedule.js.map +1 -0
- package/dist/components/OfficesAtmsMap/renderDay.d.ts +3 -0
- package/dist/components/OfficesAtmsMap/renderDay.js +13 -0
- package/dist/components/OfficesAtmsMap/renderDay.js.map +1 -0
- package/dist/components/OfficesAtmsMap/renderFiltrationForm.js +1 -1
- package/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderFoldButton.d.ts +3 -0
- package/dist/components/OfficesAtmsMap/renderFoldButton.js +9 -0
- package/dist/components/OfficesAtmsMap/renderFoldButton.js.map +1 -0
- package/dist/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -4
- package/dist/components/OfficesAtmsMap/renderOfficeCard.js +36 -26
- package/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/LinkDocs/LinkDocItem.js +3 -2
- package/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocs.js +8 -1
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/OfficesAtmsMap/Badge.js +1 -1
- package/lib/components/OfficesAtmsMap/Badge.js.map +1 -1
- package/lib/components/OfficesAtmsMap/CardRow.js +1 -1
- package/lib/components/OfficesAtmsMap/CardRow.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -3
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderAtmCard.js +8 -1
- package/lib/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderCurrency.d.ts +2 -0
- package/lib/components/OfficesAtmsMap/renderCurrency.js +4 -0
- package/lib/components/OfficesAtmsMap/renderCurrency.js.map +1 -0
- package/lib/components/OfficesAtmsMap/renderCurrentDaySchedule.d.ts +2 -0
- package/lib/components/OfficesAtmsMap/renderCurrentDaySchedule.js +13 -0
- package/lib/components/OfficesAtmsMap/renderCurrentDaySchedule.js.map +1 -0
- package/lib/components/OfficesAtmsMap/renderDay.d.ts +2 -0
- package/lib/components/OfficesAtmsMap/renderDay.js +10 -0
- package/lib/components/OfficesAtmsMap/renderDay.js.map +1 -0
- package/lib/components/OfficesAtmsMap/renderFiltrationForm.js +1 -1
- package/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderFoldButton.d.ts +3 -0
- package/lib/components/OfficesAtmsMap/renderFoldButton.js +6 -0
- package/lib/components/OfficesAtmsMap/renderFoldButton.js.map +1 -0
- package/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -4
- package/lib/components/OfficesAtmsMap/renderOfficeCard.js +34 -21
- package/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +77 -32
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -3
- package/mobile/bundle/components/OfficesAtmsMap/renderCurrency.d.ts +3 -0
- package/mobile/bundle/components/OfficesAtmsMap/renderCurrentDaySchedule.d.ts +3 -0
- package/mobile/bundle/components/OfficesAtmsMap/renderDay.d.ts +3 -0
- package/mobile/bundle/components/OfficesAtmsMap/renderFoldButton.d.ts +3 -0
- package/mobile/bundle/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -4
- package/mobile/dist/components/LinkDocs/LinkDocItem.js +3 -2
- package/mobile/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocs.js +8 -1
- package/mobile/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/Badge.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/Badge.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/CardRow.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/CardRow.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -3
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderAtmCard.js +8 -1
- package/mobile/dist/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderCurrency.d.ts +3 -0
- package/mobile/dist/components/OfficesAtmsMap/renderCurrency.js +7 -0
- package/mobile/dist/components/OfficesAtmsMap/renderCurrency.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/renderCurrentDaySchedule.d.ts +3 -0
- package/mobile/dist/components/OfficesAtmsMap/renderCurrentDaySchedule.js +16 -0
- package/mobile/dist/components/OfficesAtmsMap/renderCurrentDaySchedule.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/renderDay.d.ts +3 -0
- package/mobile/dist/components/OfficesAtmsMap/renderDay.js +13 -0
- package/mobile/dist/components/OfficesAtmsMap/renderDay.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.d.ts +3 -0
- package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.js +9 -0
- package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -4
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js +36 -26
- package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocItem.js +3 -2
- package/mobile/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocs.js +8 -1
- package/mobile/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/Badge.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/Badge.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/CardRow.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/CardRow.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -3
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderAtmCard.js +8 -1
- package/mobile/lib/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderCurrency.d.ts +3 -0
- package/mobile/lib/components/OfficesAtmsMap/renderCurrency.js +4 -0
- package/mobile/lib/components/OfficesAtmsMap/renderCurrency.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/renderCurrentDaySchedule.d.ts +3 -0
- package/mobile/lib/components/OfficesAtmsMap/renderCurrentDaySchedule.js +13 -0
- package/mobile/lib/components/OfficesAtmsMap/renderCurrentDaySchedule.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/renderDay.d.ts +3 -0
- package/mobile/lib/components/OfficesAtmsMap/renderDay.js +10 -0
- package/mobile/lib/components/OfficesAtmsMap/renderDay.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.d.ts +3 -0
- package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.js +6 -0
- package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -4
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js +34 -21
- package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
- package/mobile/src/components/LinkDocs/LinkDocItem.tsx +5 -3
- package/mobile/src/components/LinkDocs/LinkDocs.tsx +12 -1
- package/mobile/src/components/OfficesAtmsMap/Badge.tsx +1 -1
- package/mobile/src/components/OfficesAtmsMap/CardRow.tsx +1 -1
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapContent.ts +3 -3
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +2 -2
- package/mobile/src/components/OfficesAtmsMap/renderAtmCard.tsx +29 -10
- package/mobile/src/components/OfficesAtmsMap/renderCurrency.tsx +13 -0
- package/mobile/src/components/OfficesAtmsMap/renderCurrentDaySchedule.tsx +24 -0
- package/mobile/src/components/OfficesAtmsMap/renderDay.tsx +23 -0
- package/mobile/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +1 -1
- package/mobile/src/components/OfficesAtmsMap/renderFoldButton.tsx +17 -0
- package/mobile/src/components/OfficesAtmsMap/renderOfficeCard.tsx +72 -68
- package/package.json +1 -1
- package/src/components/LinkDocs/LinkDocItem.tsx +5 -3
- package/src/components/LinkDocs/LinkDocs.tsx +12 -1
- package/src/components/OfficesAtmsMap/Badge.tsx +1 -1
- package/src/components/OfficesAtmsMap/CardRow.tsx +1 -1
- package/src/components/OfficesAtmsMap/OfficesAtmsMapContent.ts +3 -3
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +2 -2
- package/src/components/OfficesAtmsMap/renderAtmCard.tsx +29 -10
- package/src/components/OfficesAtmsMap/renderCurrency.tsx +13 -0
- package/src/components/OfficesAtmsMap/renderCurrentDaySchedule.tsx +24 -0
- package/src/components/OfficesAtmsMap/renderDay.tsx +23 -0
- package/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +1 -1
- package/src/components/OfficesAtmsMap/renderFoldButton.tsx +17 -0
- package/src/components/OfficesAtmsMap/renderOfficeCard.tsx +72 -68
|
@@ -1,40 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
|
|
3
|
+
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
|
|
2
4
|
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
3
5
|
import { Text } from '../../ui-kit/Text/Text.js';
|
|
4
|
-
import { Badge } from './Badge.js';
|
|
5
6
|
import { CardCell } from './CardCell.js';
|
|
6
7
|
import { CardRow } from './CardRow.js';
|
|
7
8
|
import { getScheduleDescription } from './getScheduleDescription.js';
|
|
8
9
|
import { getWorkScheduleWeek } from './getWorkScheduleWeek.js';
|
|
9
10
|
import { renderAlternativeDay, renderBusinessSchedule } from './renderBusinessSchedule.js';
|
|
10
|
-
|
|
11
|
+
import { renderCurrency } from './renderCurrency.js';
|
|
12
|
+
import { renderCurrentDaySchedule } from './renderCurrentDaySchedule.js';
|
|
13
|
+
import { renderDay } from './renderDay.js';
|
|
14
|
+
import { renderFoldButton } from './renderFoldButton.js';
|
|
11
15
|
export const renderOfficeCard = ({ name, address, phone, fax, phoneBusiness, phoneNatural, phoneCallCentre, phoneCurrencyControl, workSchedule, exchangeRate, }, index) => {
|
|
12
16
|
if (!workSchedule) {
|
|
13
17
|
return null;
|
|
14
18
|
}
|
|
19
|
+
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
20
|
+
return (_jsxs("div", { className: "bg-white col-span-12 p-3xl sm:border-green sm:border", children: [_jsxs("div", { className: "sm:flex sm:justify-between", children: [_jsxs("div", { children: [_jsx(Text, { size: "text-h4", children: name }), address ? (_jsxs("div", { className: "flex pb-xl pt-xs gap-2xs", children: [_jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24" }), _jsx(Text, { size: "text-l", children: address })] })) : null] }), renderCurrentDaySchedule(workScheduleWeek)] }), _jsx("div", { className: "hidden sm:block", children: renderCardContent({
|
|
21
|
+
phone,
|
|
22
|
+
fax,
|
|
23
|
+
phoneBusiness,
|
|
24
|
+
phoneNatural,
|
|
25
|
+
phoneCallCentre,
|
|
26
|
+
phoneCurrencyControl,
|
|
27
|
+
workSchedule,
|
|
28
|
+
exchangeRate,
|
|
29
|
+
}) }), _jsx(Foldable, { className: "block sm:hidden", renderFoldableSection: ({ isUnfolded }) => {
|
|
30
|
+
return (_jsx(FoldableSection, { isUnfolded: isUnfolded, children: renderCardContent({
|
|
31
|
+
phone,
|
|
32
|
+
fax,
|
|
33
|
+
phoneBusiness,
|
|
34
|
+
phoneNatural,
|
|
35
|
+
phoneCallCentre,
|
|
36
|
+
phoneCurrencyControl,
|
|
37
|
+
workSchedule,
|
|
38
|
+
exchangeRate,
|
|
39
|
+
}) }));
|
|
40
|
+
},
|
|
41
|
+
//** TODO: remove styles with refactoring DefaultFoldButton*/
|
|
42
|
+
renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle }) })] }, String(index)));
|
|
43
|
+
};
|
|
44
|
+
const renderCardContent = ({ phone, fax, phoneBusiness, phoneNatural, phoneCallCentre, phoneCurrencyControl, workSchedule, exchangeRate, }) => {
|
|
15
45
|
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
16
46
|
const labelSchedule = workSchedule?.businessScheduleVisibleTag
|
|
17
47
|
? 'Для физических лиц'
|
|
18
48
|
: 'Для физических и юридических лиц';
|
|
19
|
-
return (_jsxs("div", {
|
|
49
|
+
return (_jsxs("div", { children: [_jsxs(CardRow, { className: "flex-wrap", children: [_jsx(CardCell, { label: "\u0424\u0430\u043A\u0441", value: fax }), _jsx(CardCell, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u0444\u0438\u043B\u0438\u0430\u043B\u0430", value: phone }), _jsx(CardCell, { label: "\u0414\u043B\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0439 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneBusiness }), _jsx(CardCell, { label: "\u041E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneNatural }), _jsx(CardCell, { label: "\u0414\u043B\u044F \u043A\u043E\u043D\u0441\u0443\u043B\u044C\u0442\u0430\u0446\u0438\u0439 \u043F\u043E \u0432\u0430\u043B\u044E\u0442\u043D\u043E\u043C\u0443 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E", value: phoneCurrencyControl }), _jsx(CardCell, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442-\u0446\u0435\u043D\u0442\u0440", value: phoneCallCentre })] }), workSchedule?.isMatchesPattern ? (_jsx(CardRow, { children: _jsx(CardCell, { label: labelSchedule, labelSize: "text-l", className: "w-full max-w-none", children: _jsx("div", { className: "flex flex-wrap gap-xs sm:justify-between pt-xs", children: workScheduleWeek?.map(renderDay) }) }) })) : (_jsxs(CardRow, { children: [_jsx(CardCell, { label: labelSchedule, labelSize: "text-l", children: _jsx("div", { className: "flex gap-1", children: workScheduleWeek?.map(renderAlternativeDay) }) }), getScheduleDescription(workScheduleWeek)] })), workSchedule?.businessScheduleVisibleTag
|
|
20
50
|
? renderBusinessSchedule(workSchedule?.businessScheduleDescription)
|
|
21
|
-
: null, exchangeRate?.currencies?.length ? (_jsx(CardRow, { className: "flex-wrap", children: exchangeRate?.currencies?.map(renderCurrency) })) : null] }
|
|
22
|
-
};
|
|
23
|
-
export const renderCurrency = ({ currency, buyExchangeRate, saleExchangeRate }, i) => (_jsxs("div", { className: "flex gap-lg h-full", children: [currency?.currency ? _jsx(CardCell, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", value: currency.currency }) : null, buyExchangeRate ? _jsx(CardCell, { label: "\u041A\u0443\u043F\u0438\u0442\u044C", value: String(buyExchangeRate) }) : null, saleExchangeRate ? _jsx(CardCell, { label: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C", value: String(saleExchangeRate) }) : null] }, String(i)));
|
|
24
|
-
//TODO: Add logic time https://github.com/redneckz/wildless-cms-uni-blocks/pull/1549
|
|
25
|
-
export const renderCurrentDaySchedule = (workScheduleWeek) => {
|
|
26
|
-
const [currentWeekDay] = workScheduleWeek?.slice(currentWeekDayIdx - 1) ?? [];
|
|
27
|
-
if (!currentWeekDay) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const { lunchHour, status, workTime, hasLunch } = currentWeekDay;
|
|
31
|
-
return status ? (_jsxs("div", { className: "flex gap-s items-start whitespace-nowrap", children: [workTime ? _jsx(Badge, { color: "green", children: workTime }) : null, lunchHour && hasLunch ? _jsx(Badge, { color: "yellow", children: `перерыв: ${lunchHour}` }) : null] })) : (_jsx(Badge, { color: "red", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }));
|
|
32
|
-
};
|
|
33
|
-
export const renderDay = ({ title, status, workTime, lunchHour, hasLunch }, index) => (_jsx(CardCell, { label: title, value: status && workTime ? workTime : '', subText: getSubTextLunch(lunchHour, hasLunch, status), subColor: !status || hasLunch ? 'text-error' : 'text-green-dark' }, String(index)));
|
|
34
|
-
const getSubTextLunch = (lunchHour, hasLunch = false, status = false) => {
|
|
35
|
-
if (!status) {
|
|
36
|
-
return 'Не работает';
|
|
37
|
-
}
|
|
38
|
-
return lunchHour && hasLunch ? `Перерыв ${lunchHour}` : lunchHour;
|
|
51
|
+
: null, exchangeRate?.currencies?.length ? (_jsx(CardRow, { className: "flex-wrap", children: exchangeRate?.currencies?.map(renderCurrency) })) : null] }));
|
|
39
52
|
};
|
|
40
53
|
//# sourceMappingURL=renderOfficeCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderOfficeCard.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/renderOfficeCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"renderOfficeCard.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/renderOfficeCard.tsx"],"names":[],"mappings":"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"}
|
|
@@ -2778,9 +2778,9 @@
|
|
|
2778
2778
|
if (isSingleTab) {
|
|
2779
2779
|
return renderCalculator(tabs[0]);
|
|
2780
2780
|
}
|
|
2781
|
-
return tabs.map((tab, index) => (jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: index === 0, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, children: renderCalculator(tab) })), renderFoldButton: renderFoldButton$
|
|
2781
|
+
return tabs.map((tab, index) => (jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: index === 0, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, children: renderCalculator(tab) })), renderFoldButton: renderFoldButton$3(tab) }, index.toString())));
|
|
2782
2782
|
};
|
|
2783
|
-
const renderFoldButton$
|
|
2783
|
+
const renderFoldButton$3 = (tab) => ({ isUnfolded, onToggle }) => {
|
|
2784
2784
|
const align = tab.nav?.align || 'text-left';
|
|
2785
2785
|
return (jsxs("button", { onClick: onToggle, className: "w-full p-xl bg-primary-main flex items-center border-b border-white", children: [jsx("div", { className: "w-11 h-11 bg-white rounded-md flex justify-center items-center", children: jsx(Icon, { name: tab.nav?.icon?.icon, iconVersion: "color", width: "24", height: "24" }) }), jsxs("div", { className: "flex-1 flex flex-col pl-s", children: [jsx(Text, { align: align, color: "text-white", children: tab.nav?.title }), jsx(Text, { align: align, size: "text-s", color: "text-white", font: "font-light", children: tab.nav?.description })] }), jsx(Icon, { name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', iconVersion: "white", width: "24", height: "24" })] }));
|
|
2786
2786
|
};
|
|
@@ -3119,9 +3119,9 @@
|
|
|
3119
3119
|
const cellsNode = cardCells.map(renderCardInfo);
|
|
3120
3120
|
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
3121
3121
|
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
3122
|
-
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, cardCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$
|
|
3122
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, cardCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$2 : null })) : null] }));
|
|
3123
3123
|
});
|
|
3124
|
-
const renderFoldButton$
|
|
3124
|
+
const renderFoldButton$2 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
3125
3125
|
|
|
3126
3126
|
const gradientStyle = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
3127
3127
|
const dividerStyle$1 = 'border-main-divider border-b';
|
|
@@ -3181,7 +3181,7 @@
|
|
|
3181
3181
|
|
|
3182
3182
|
const NotFound = JSX(({ title, description }) => (jsxs("div", { className: "bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center", children: [jsx(Img, { image: { icon: 'MagnifierIcon', iconVersion: 'normal' }, width: "120", height: "120" }), jsx(Headline, { title: title, description: description, headlineVersion: "S", isEmbedded: true, align: AlignStyles })] })));
|
|
3183
3183
|
|
|
3184
|
-
const ICONS = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
3184
|
+
const ICONS$1 = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
3185
3185
|
const resultsGridStyle = 'space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box';
|
|
3186
3186
|
const BaseFiltrationInner = JSX(({ label = '', blocksToRender = [], topItemsCount = 0, block, notFound, ...rest }) => {
|
|
3187
3187
|
const [visibleBlocks, hiddenBlocks] = topItemsCount > 0
|
|
@@ -3189,7 +3189,7 @@
|
|
|
3189
3189
|
: [blocksToRender, []];
|
|
3190
3190
|
return (jsxs("div", { children: [jsx("div", { className: style(blocksToRender.length ? 'hidden' : 'block'), children: notFound ? jsx(NotFound, { ...notFound }) : null }), jsxs("div", { className: style('space-y-2xs', blocksToRender.length ? '' : 'hidden'), children: [jsxs("div", { className: style(resultsGridStyle), children: [renderBlocksList(visibleBlocks, { ...rest.options, parent: block }), isOdd(visibleBlocks.length) ? jsx(AdTile, { className: "col-span-6" }) : null] }), jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => {
|
|
3191
3191
|
return (jsxs(FoldableSection, { className: style(resultsGridStyle), isUnfolded: isUnfolded, children: [renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }), isOdd(hiddenBlocks.length) ? jsx(AdTile, { className: "col-span-6" }) : null] }));
|
|
3192
|
-
}, renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { className: style(topItemsCount < 1 ? 'hidden' : ''), disabled: !hiddenBlocks?.length, label: label, icon: ICONS[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
|
|
3192
|
+
}, renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { className: style(topItemsCount < 1 ? 'hidden' : ''), disabled: !hiddenBlocks?.length, label: label, icon: ICONS$1[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
|
|
3193
3193
|
});
|
|
3194
3194
|
|
|
3195
3195
|
const isEmpty = (v) => v === null ||
|
|
@@ -3553,7 +3553,7 @@
|
|
|
3553
3553
|
version, ...rest }) => (jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: style('gap-lg', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren({
|
|
3554
3554
|
...rest,
|
|
3555
3555
|
extraProps: { className: 'w-full', padding: 'p-0' },
|
|
3556
|
-
}) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
|
|
3556
|
+
}) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton$1({
|
|
3557
3557
|
foldButtonVersion,
|
|
3558
3558
|
label,
|
|
3559
3559
|
labelIcon,
|
|
@@ -3564,7 +3564,7 @@
|
|
|
3564
3564
|
RollupItem.childrenTypes = {
|
|
3565
3565
|
exclude: ['RollupItem'],
|
|
3566
3566
|
};
|
|
3567
|
-
const renderFoldButton = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
|
|
3567
|
+
const renderFoldButton$1 = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
|
|
3568
3568
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
3569
3569
|
const icon = getIconName(isUnfolded);
|
|
3570
3570
|
return foldButtonVersion === 'accordion' ? (jsx(AccordionFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : (jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
|
|
@@ -3716,11 +3716,12 @@
|
|
|
3716
3716
|
};
|
|
3717
3717
|
|
|
3718
3718
|
const LinkDocItem = JSX(({ icon, text, href, target, fileFormat, fileSize }) => {
|
|
3719
|
-
const prefix =
|
|
3719
|
+
const prefix = fileSize && fileFormat ? ',' : '';
|
|
3720
3720
|
const size = fileSize ?? '';
|
|
3721
3721
|
const format = fileFormat ? String(fileFormat) : '';
|
|
3722
|
-
return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, jsx(Text, { color: "text-secondary-text", children: href && `${size
|
|
3722
|
+
return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, " ", addSpace(size, format), jsx(Text, { color: "text-secondary-text", children: href && `${size + prefix + format}` })] })) : null] }));
|
|
3723
3723
|
});
|
|
3724
|
+
const addSpace = (size, format) => (size || format ? jsx("span", { children: ",\u00A0" }) : '');
|
|
3724
3725
|
|
|
3725
3726
|
const linkIconStyle = 'min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md';
|
|
3726
3727
|
|
|
@@ -3742,9 +3743,16 @@
|
|
|
3742
3743
|
const fileSize = docBlockDef?.docType === 'Attachment'
|
|
3743
3744
|
? formatBytes(docBlockDef?.attachment?.fileSize || 0)
|
|
3744
3745
|
: docBlockDef?.fileSize;
|
|
3745
|
-
const fileFormat = docBlockDef?.docType
|
|
3746
|
+
const fileFormat = docBlockDef?.docType === 'Attachment' ? getExtFromHref(href) : docBlockDef?.fileFormat;
|
|
3746
3747
|
return (jsx("div", { role: "listitem", children: jsx(LinkDocItem, { text: docBlockDef?.text, target: docBlockDef?.target, href: href, fileFormat: fileFormat, fileSize: fileSize, icon: icon ? jsx(Img, { className: linkIconStyle, image: icon, width: "24", height: "24" }) : null }) }, String(i)));
|
|
3747
3748
|
};
|
|
3749
|
+
const getExtFromHref = (href) => {
|
|
3750
|
+
if (!href) {
|
|
3751
|
+
return '';
|
|
3752
|
+
}
|
|
3753
|
+
const index = href.lastIndexOf('.');
|
|
3754
|
+
return index !== -1 ? href.substring(index + 1) : '';
|
|
3755
|
+
};
|
|
3748
3756
|
|
|
3749
3757
|
const MobileAppTile = JSX(({ className, padding, align = 'text-left', buttons = [], description, image, items, qr, additionalDescription = '', title = 'Мобильное приложение', version = 'primary', ...rest }) => {
|
|
3750
3758
|
const containerStyle = version === 'secondary' ? 'p-m min-w-32' : 'min-w-24';
|
|
@@ -4071,7 +4079,7 @@
|
|
|
4071
4079
|
workAllTime: 'Круглосуточно',
|
|
4072
4080
|
billAcceptorEnable: 'Прием наличных',
|
|
4073
4081
|
};
|
|
4074
|
-
const renderFiltrationForm = (filters, { field, reset }) => (jsxs("div", { className: "pb-2xl", children: [filters?.length ? (jsx("div", { className: "flex flex-wrap gap-3xl pb-2xl", children: filters.map((key) => (jsx(Checkbox, { text: FILTRATION_LABELS[key], ...field(key) }, key))) })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, text: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", appendRight: jsx(Icon, { name: "CloseIcon", width: "16", height: "16" }) })] }));
|
|
4082
|
+
const renderFiltrationForm = (filters, { field, reset }) => (jsxs("div", { className: "pb-2xl", children: [filters?.length ? (jsx("div", { className: "flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl", children: filters.map((key) => (jsx(Checkbox, { text: FILTRATION_LABELS[key], ...field(key) }, key))) })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, text: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", appendRight: jsx(Icon, { name: "CloseIcon", width: "16", height: "16" }) })] }));
|
|
4075
4083
|
|
|
4076
4084
|
const defaultRenderCard = () => null;
|
|
4077
4085
|
const defaultFilterItems = () => [];
|
|
@@ -4084,7 +4092,7 @@
|
|
|
4084
4092
|
const lengthItems = filteredItems.length;
|
|
4085
4093
|
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "pt-6xl px-6xl", children: [jsxs("div", { className: "flex gap-xs pb-2xl", children: [jsx(Heading, { headingType: "h2", children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: `(${lengthItems})` })) : null] }), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, renderFiltrationForm(Object.keys(initFilterState), { field, reset })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, className: "h-full" }) }) })] }), filteredItems.map(renderCard)] }));
|
|
4086
4094
|
});
|
|
4087
|
-
const renderDescriptionBlock$1 = ({ description, list }) => description || list?.length ? (jsxs("div", { className: "p-xl mb-2xl border border-
|
|
4095
|
+
const renderDescriptionBlock$1 = ({ description, list }) => description || list?.length ? (jsxs("div", { className: "p-xl mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [description ? (jsx(Paragraph, { size: "text-l", font: "font-light", children: description })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pt-xs", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
|
|
4088
4096
|
|
|
4089
4097
|
const colorStyle = {
|
|
4090
4098
|
yellow: { border: 'border-yellow-light', text: 'text-yellow' },
|
|
@@ -4092,7 +4100,7 @@
|
|
|
4092
4100
|
gray: { border: 'border-gray', text: 'text-secondary-text' },
|
|
4093
4101
|
red: { border: 'border-error/30', text: 'text-error' },
|
|
4094
4102
|
};
|
|
4095
|
-
const Badge = JSX(({ className, children, color = 'gray' }) => (jsx("div", { className: style('p-s border border-gray rounded-md flex items-center', colorStyle[color].border, className), children: jsx(Text, { size: "text-m", color: colorStyle[color].text, children: children }) })));
|
|
4103
|
+
const Badge = JSX(({ className, children, color = 'gray' }) => (jsx("div", { className: style('p-s sm:border sm:border-gray rounded-md flex items-center', colorStyle[color].border, className), children: jsx(Text, { size: "text-m", color: colorStyle[color].text, children: children }) })));
|
|
4096
4104
|
|
|
4097
4105
|
const CardCell = JSX(({ value, subText, children, ...props }) => {
|
|
4098
4106
|
const textItems = (Array.isArray(value) ? value : value?.split(',') ?? []).filter(Boolean);
|
|
@@ -4104,7 +4112,11 @@
|
|
|
4104
4112
|
const renderCardCell = ({ label, labelSize = 'text-m', textItems, subColor, subText, className, children, }) => (jsxs("div", { className: style('flex gap-2xs flex-col h-full max-w-[300px]', className), children: [label ? (jsx(Text, { color: "text-secondary-text", font: "font-light", size: labelSize, children: label })) : null, children ||
|
|
4105
4113
|
textItems.filter(Boolean).map((text, i) => (jsx(Text, { size: "text-l", children: text.trim() }, String(i)))), subText ? (jsx(Text, { color: subColor, size: "text-m", children: subText })) : null] }));
|
|
4106
4114
|
|
|
4107
|
-
const CardRow = JSX(({ className, children }) => (jsx("div", { className: style('flex border-t border-solid border-main-divider py-xl gap-x-6xl gap-y-xl', className), children: children })));
|
|
4115
|
+
const CardRow = JSX(({ className, children }) => (jsx("div", { className: style('sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl', className), children: children })));
|
|
4116
|
+
|
|
4117
|
+
const ICONS = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
4118
|
+
const labels = ['Подробнее', 'Скрыть'];
|
|
4119
|
+
const renderFoldButton = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider", onClick: onToggle, children: [jsx("div", { className: "pr-m", children: labels[Number(isUnfolded)] }), jsx(Icon, { className: "text-primary-text", name: ICONS[Number(isUnfolded)], width: "16", height: "16" })] }));
|
|
4108
4120
|
|
|
4109
4121
|
const renderAtmCard = ({ location, address, billAcceptorType, terminalType, billAcceptorEnable, atmCode = '', atmAccess = '', workTime, }, index) => {
|
|
4110
4122
|
const additionalInfo = [
|
|
@@ -4123,7 +4135,11 @@
|
|
|
4123
4135
|
},
|
|
4124
4136
|
{ label: 'Регистрационный номер', value: atmCode },
|
|
4125
4137
|
];
|
|
4126
|
-
return (jsxs("div", { className: "bg-white col-span-12 p-3xl border-green border", children: [jsxs("div", { className: "flex justify-between", children: [
|
|
4138
|
+
return (jsxs("div", { className: "bg-white col-span-12 p-3xl sm:border-green sm:border", children: [jsxs("div", { className: "sm:flex sm:justify-between", children: [jsxs("div", { children: [jsx(Text, { size: "text-h4", children: capitalizedFirstLetter(location) }), address ? (jsxs("div", { className: "flex pb-xl pt-xs gap-2xs", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24" }), jsx(Text, { size: "text-l", children: address })] })) : null] }), jsx(Badge, { color: "green", children: capitalizedFirstLetter(workTime) })] }), jsx("div", { className: "hidden sm:block", children: jsx(CardRow, { className: "flex-wrap", children: additionalInfo?.map(renderInfo) }) }), jsx(Foldable, { className: "block sm:hidden", renderFoldableSection: ({ isUnfolded }) => {
|
|
4139
|
+
return (jsx(FoldableSection, { isUnfolded: isUnfolded, children: jsx(CardRow, { className: "flex-wrap", children: additionalInfo?.map(renderInfo) }) }));
|
|
4140
|
+
},
|
|
4141
|
+
//** TODO: Remove styles with refactoring DefaultFoldButton*/
|
|
4142
|
+
renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle }) })] }, String(index)));
|
|
4127
4143
|
};
|
|
4128
4144
|
const renderInfo = (item, index) => (jsx(CardCell, { ...item }, String(index)));
|
|
4129
4145
|
const capitalizedFirstLetter = (text) => text ? `${text?.charAt(0)?.toUpperCase()}${text?.slice(1)}` : '';
|
|
@@ -4245,20 +4261,9 @@
|
|
|
4245
4261
|
};
|
|
4246
4262
|
const renderAlternativeDay = ({ short, status }, index) => (jsx("div", { className: style('w-9 h-9 rounded-md flex items-center justify-center', status ? 'bg-green-more-light text-green-dark' : 'bg-error/30 text-error'), children: jsx(Text, { size: "text-xs", children: short }) }, String(index)));
|
|
4247
4263
|
|
|
4248
|
-
const currentWeekDayIdx = new Date().getDay();
|
|
4249
|
-
const renderOfficeCard = ({ name, address, phone, fax, phoneBusiness, phoneNatural, phoneCallCentre, phoneCurrencyControl, workSchedule, exchangeRate, }, index) => {
|
|
4250
|
-
if (!workSchedule) {
|
|
4251
|
-
return null;
|
|
4252
|
-
}
|
|
4253
|
-
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
4254
|
-
const labelSchedule = workSchedule?.businessScheduleVisibleTag
|
|
4255
|
-
? 'Для физических лиц'
|
|
4256
|
-
: 'Для физических и юридических лиц';
|
|
4257
|
-
return (jsxs("div", { className: "bg-white col-span-12 p-3xl border-green border", children: [jsxs("div", { className: "flex justify-between", children: [jsx(Text, { size: "text-h4", children: name }), renderCurrentDaySchedule(workScheduleWeek)] }), address ? (jsxs("div", { className: "flex pb-xl pt-xs gap-2xs", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24" }), jsx(Text, { size: "text-l", children: address })] })) : null, jsxs(CardRow, { className: "flex-wrap", children: [jsx(CardCell, { label: "\u0424\u0430\u043A\u0441", value: fax }), jsx(CardCell, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u0444\u0438\u043B\u0438\u0430\u043B\u0430", value: phone }), jsx(CardCell, { label: "\u0414\u043B\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0439 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneBusiness }), jsx(CardCell, { label: "\u041E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneNatural }), jsx(CardCell, { label: "\u0414\u043B\u044F \u043A\u043E\u043D\u0441\u0443\u043B\u044C\u0442\u0430\u0446\u0438\u0439 \u043F\u043E \u0432\u0430\u043B\u044E\u0442\u043D\u043E\u043C\u0443 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E", value: phoneCurrencyControl }), jsx(CardCell, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442-\u0446\u0435\u043D\u0442\u0440", value: phoneCallCentre })] }), workSchedule.isMatchesPattern ? (jsx(CardRow, { children: jsx(CardCell, { label: labelSchedule, labelSize: "text-l", className: "w-full max-w-none", children: jsx("div", { className: "flex flex-wrap gap-xs sm:justify-between pt-xs", children: workScheduleWeek?.map(renderDay) }) }) })) : (jsxs(CardRow, { children: [jsx(CardCell, { label: labelSchedule, labelSize: "text-l", children: jsx("div", { className: "flex gap-1", children: workScheduleWeek?.map(renderAlternativeDay) }) }), getScheduleDescription(workScheduleWeek)] })), workSchedule?.businessScheduleVisibleTag
|
|
4258
|
-
? renderBusinessSchedule(workSchedule?.businessScheduleDescription)
|
|
4259
|
-
: null, exchangeRate?.currencies?.length ? (jsx(CardRow, { className: "flex-wrap", children: exchangeRate?.currencies?.map(renderCurrency) })) : null] }, String(index)));
|
|
4260
|
-
};
|
|
4261
4264
|
const renderCurrency = ({ currency, buyExchangeRate, saleExchangeRate }, i) => (jsxs("div", { className: "flex gap-lg h-full", children: [currency?.currency ? jsx(CardCell, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", value: currency.currency }) : null, buyExchangeRate ? jsx(CardCell, { label: "\u041A\u0443\u043F\u0438\u0442\u044C", value: String(buyExchangeRate) }) : null, saleExchangeRate ? jsx(CardCell, { label: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C", value: String(saleExchangeRate) }) : null] }, String(i)));
|
|
4265
|
+
|
|
4266
|
+
const currentWeekDayIdx = new Date().getDay();
|
|
4262
4267
|
//TODO: Add logic time https://github.com/redneckz/wildless-cms-uni-blocks/pull/1549
|
|
4263
4268
|
const renderCurrentDaySchedule = (workScheduleWeek) => {
|
|
4264
4269
|
const [currentWeekDay] = workScheduleWeek?.slice(currentWeekDayIdx - 1) ?? [];
|
|
@@ -4268,13 +4273,53 @@
|
|
|
4268
4273
|
const { lunchHour, status, workTime, hasLunch } = currentWeekDay;
|
|
4269
4274
|
return status ? (jsxs("div", { className: "flex gap-s items-start whitespace-nowrap", children: [workTime ? jsx(Badge, { color: "green", children: workTime }) : null, lunchHour && hasLunch ? jsx(Badge, { color: "yellow", children: `перерыв: ${lunchHour}` }) : null] })) : (jsx(Badge, { color: "red", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }));
|
|
4270
4275
|
};
|
|
4271
|
-
|
|
4272
|
-
const getSubTextLunch = (lunchHour, hasLunch = false, status = false) => {
|
|
4276
|
+
|
|
4277
|
+
const getSubTextLunch = ({ lunchHour, hasLunch = false, status = false }) => {
|
|
4273
4278
|
if (!status) {
|
|
4274
4279
|
return 'Не работает';
|
|
4275
4280
|
}
|
|
4276
4281
|
return lunchHour && hasLunch ? `Перерыв ${lunchHour}` : lunchHour;
|
|
4277
4282
|
};
|
|
4283
|
+
const renderDay = ({ title, status, workTime, lunchHour, hasLunch }, index) => (jsx(CardCell, { label: title, value: status && workTime ? workTime : '', subText: getSubTextLunch({ lunchHour, hasLunch, status }), subColor: !status || hasLunch ? 'text-error' : 'text-green-dark' }, String(index)));
|
|
4284
|
+
|
|
4285
|
+
const renderOfficeCard = ({ name, address, phone, fax, phoneBusiness, phoneNatural, phoneCallCentre, phoneCurrencyControl, workSchedule, exchangeRate, }, index) => {
|
|
4286
|
+
if (!workSchedule) {
|
|
4287
|
+
return null;
|
|
4288
|
+
}
|
|
4289
|
+
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
4290
|
+
return (jsxs("div", { className: "bg-white col-span-12 p-3xl sm:border-green sm:border", children: [jsxs("div", { className: "sm:flex sm:justify-between", children: [jsxs("div", { children: [jsx(Text, { size: "text-h4", children: name }), address ? (jsxs("div", { className: "flex pb-xl pt-xs gap-2xs", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24" }), jsx(Text, { size: "text-l", children: address })] })) : null] }), renderCurrentDaySchedule(workScheduleWeek)] }), jsx("div", { className: "hidden sm:block", children: renderCardContent({
|
|
4291
|
+
phone,
|
|
4292
|
+
fax,
|
|
4293
|
+
phoneBusiness,
|
|
4294
|
+
phoneNatural,
|
|
4295
|
+
phoneCallCentre,
|
|
4296
|
+
phoneCurrencyControl,
|
|
4297
|
+
workSchedule,
|
|
4298
|
+
exchangeRate,
|
|
4299
|
+
}) }), jsx(Foldable, { className: "block sm:hidden", renderFoldableSection: ({ isUnfolded }) => {
|
|
4300
|
+
return (jsx(FoldableSection, { isUnfolded: isUnfolded, children: renderCardContent({
|
|
4301
|
+
phone,
|
|
4302
|
+
fax,
|
|
4303
|
+
phoneBusiness,
|
|
4304
|
+
phoneNatural,
|
|
4305
|
+
phoneCallCentre,
|
|
4306
|
+
phoneCurrencyControl,
|
|
4307
|
+
workSchedule,
|
|
4308
|
+
exchangeRate,
|
|
4309
|
+
}) }));
|
|
4310
|
+
},
|
|
4311
|
+
//** TODO: remove styles with refactoring DefaultFoldButton*/
|
|
4312
|
+
renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle }) })] }, String(index)));
|
|
4313
|
+
};
|
|
4314
|
+
const renderCardContent = ({ phone, fax, phoneBusiness, phoneNatural, phoneCallCentre, phoneCurrencyControl, workSchedule, exchangeRate, }) => {
|
|
4315
|
+
const workScheduleWeek = getWorkScheduleWeek(workSchedule);
|
|
4316
|
+
const labelSchedule = workSchedule?.businessScheduleVisibleTag
|
|
4317
|
+
? 'Для физических лиц'
|
|
4318
|
+
: 'Для физических и юридических лиц';
|
|
4319
|
+
return (jsxs("div", { children: [jsxs(CardRow, { className: "flex-wrap", children: [jsx(CardCell, { label: "\u0424\u0430\u043A\u0441", value: fax }), jsx(CardCell, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u0444\u0438\u043B\u0438\u0430\u043B\u0430", value: phone }), jsx(CardCell, { label: "\u0414\u043B\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0439 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneBusiness }), jsx(CardCell, { label: "\u041E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446", value: phoneNatural }), jsx(CardCell, { label: "\u0414\u043B\u044F \u043A\u043E\u043D\u0441\u0443\u043B\u044C\u0442\u0430\u0446\u0438\u0439 \u043F\u043E \u0432\u0430\u043B\u044E\u0442\u043D\u043E\u043C\u0443 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E", value: phoneCurrencyControl }), jsx(CardCell, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442-\u0446\u0435\u043D\u0442\u0440", value: phoneCallCentre })] }), workSchedule?.isMatchesPattern ? (jsx(CardRow, { children: jsx(CardCell, { label: labelSchedule, labelSize: "text-l", className: "w-full max-w-none", children: jsx("div", { className: "flex flex-wrap gap-xs sm:justify-between pt-xs", children: workScheduleWeek?.map(renderDay) }) }) })) : (jsxs(CardRow, { children: [jsx(CardCell, { label: labelSchedule, labelSize: "text-l", children: jsx("div", { className: "flex gap-1", children: workScheduleWeek?.map(renderAlternativeDay) }) }), getScheduleDescription(workScheduleWeek)] })), workSchedule?.businessScheduleVisibleTag
|
|
4320
|
+
? renderBusinessSchedule(workSchedule?.businessScheduleDescription)
|
|
4321
|
+
: null, exchangeRate?.currencies?.length ? (jsx(CardRow, { className: "flex-wrap", children: exchangeRate?.currencies?.map(renderCurrency) })) : null] }));
|
|
4322
|
+
};
|
|
4278
4323
|
|
|
4279
4324
|
const EMPTY_VALUE$1 = [];
|
|
4280
4325
|
function useOffices(regionCode) {
|
|
@@ -5390,7 +5435,7 @@
|
|
|
5390
5435
|
|
|
5391
5436
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
5392
5437
|
|
|
5393
|
-
const packageVersion = "0.14.
|
|
5438
|
+
const packageVersion = "0.14.79";
|
|
5394
5439
|
|
|
5395
5440
|
exports.Blocks = Blocks;
|
|
5396
5441
|
exports.ContentPage = ContentPage;
|