@redneckz/wildless-cms-uni-blocks 0.6.27 → 0.6.28
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 +27 -22
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficeMap/useOfficeMap.d.ts +56 -2
- package/dist/components/OfficeMap/OfficeMap.js +4 -2
- package/dist/components/OfficeMap/OfficeMap.js.map +1 -1
- package/dist/components/OfficeMap/useOfficeMap.d.ts +56 -2
- package/dist/components/OfficeMap/useOfficeMap.js +4 -1
- package/dist/components/OfficeMap/useOfficeMap.js.map +1 -1
- package/lib/components/OfficeMap/OfficeMap.js +4 -2
- package/lib/components/OfficeMap/OfficeMap.js.map +1 -1
- package/lib/components/OfficeMap/useOfficeMap.d.ts +56 -2
- package/lib/components/OfficeMap/useOfficeMap.js +4 -1
- package/lib/components/OfficeMap/useOfficeMap.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficeMap/useOfficeMap.d.ts +56 -2
- package/mobile/dist/components/OfficeMap/OfficeMap.js +4 -2
- package/mobile/dist/components/OfficeMap/OfficeMap.js.map +1 -1
- package/mobile/dist/components/OfficeMap/useOfficeMap.d.ts +56 -2
- package/mobile/dist/components/OfficeMap/useOfficeMap.js +4 -1
- package/mobile/dist/components/OfficeMap/useOfficeMap.js.map +1 -1
- package/mobile/lib/components/OfficeMap/OfficeMap.js +4 -2
- package/mobile/lib/components/OfficeMap/OfficeMap.js.map +1 -1
- package/mobile/lib/components/OfficeMap/useOfficeMap.d.ts +56 -2
- package/mobile/lib/components/OfficeMap/useOfficeMap.js +4 -1
- package/mobile/lib/components/OfficeMap/useOfficeMap.js.map +1 -1
- package/mobile/src/components/OfficeMap/OfficeMap.tsx +4 -2
- package/mobile/src/components/OfficeMap/useOfficeMap.ts +4 -1
- package/package.json +1 -1
- package/src/components/OfficeMap/OfficeMap.tsx +4 -2
- package/src/components/OfficeMap/useOfficeMap.ts +4 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -2462,6 +2462,25 @@
|
|
|
2462
2462
|
const getArraySumAndAverage = (arr) => arr.reduce((a, b) => a + b) / arr.length;
|
|
2463
2463
|
const normalizePoints = (points) => (points ? points.map((_) => _.coords) : null);
|
|
2464
2464
|
|
|
2465
|
+
// Добавлено для проверки
|
|
2466
|
+
const nearbyOffices = [
|
|
2467
|
+
{ title: 'Деловой центр', time: '1 мин', distance: '~30 м.', icon: 'MetroIcon' },
|
|
2468
|
+
{ title: 'Выставочная', time: '5 мин', distance: '~120 м.', icon: 'MetroIcon' },
|
|
2469
|
+
{ title: 'Деловой центр', time: '8 мин', distance: '~350 м.', icon: 'MetroIcon' },
|
|
2470
|
+
];
|
|
2471
|
+
|
|
2472
|
+
const renderCurrentDaySchedule = ({ lunchHour, status, workTime }) => {
|
|
2473
|
+
const hasTime = /\d+/gi.test(lunchHour);
|
|
2474
|
+
const lunchHourText = hasTime ? `Перерыв ${lunchHour}` : lunchHour;
|
|
2475
|
+
return status ? (jsxs("div", { className: "flex", children: [jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-primary-main border-green-light mr-4", children: workTime ? workTime : null }), jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-golden border-golden", children: lunchHour ? lunchHourText : null })] })) : (jsx("div", { className: "flex", children: jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-error border-error", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }) }));
|
|
2476
|
+
};
|
|
2477
|
+
const renderNearbyOffice = ({ icon, title, distance, time }, index) => (jsxs("div", { className: "flex mr-4", children: [jsx(Icon, { name: icon, width: "16", height: "16", asSVG: true, className: "mr-1" }), title ? jsxs("span", { className: "text-m", children: [title, "\u00A0"] }) : null, jsxs("span", { className: "text-m-light", children: [distance ? ` (${distance})` : null, time ? `, ${time}` : null] })] }, `nearbyOffice${index}`));
|
|
2478
|
+
const renderDay = ({ title, status, workTime, lunchHour, description }, inx) => (jsxs("div", { className: "flex flex-col pb-3 border-b border-solid border-main-divider mb-3 last:border-0", children: [jsxs("div", { className: "flex justify-between items-center w-full pb-1 text-l text-primary-text", children: [jsx("div", { children: title }), status ? null : jsx("div", { className: "text-m-light text-error", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }), status && workTime ? jsx("div", { children: workTime }) : null] }), status && lunchHour ? renderLunchHour(lunchHour) : null, description ? (jsx("div", { className: "pb-1 text-s-light text-secondary-text", children: description })) : null] }, `day${inx}`));
|
|
2479
|
+
const renderLunchHour = (lunchHour) => {
|
|
2480
|
+
const hasTime = /\d+/gi.test(lunchHour);
|
|
2481
|
+
return hasTime ? (jsxs("div", { className: "flex justify-between items-center w-full pb-1 text-m-light text-error", children: [jsx("div", { children: "\u041F\u0435\u0440\u0435\u0440\u044B\u0432" }), jsx("div", { children: lunchHour })] })) : (jsx("div", { className: "flex justify-between items-center w-full pb-1 text-m-light text-primary-main", children: jsx("div", { children: lunchHour }) }));
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2465
2484
|
const OFFICE_MAP = {
|
|
2466
2485
|
id: 123,
|
|
2467
2486
|
branchType: {
|
|
@@ -2542,31 +2561,14 @@
|
|
|
2542
2561
|
safeBoxCaseVolumes: null,
|
|
2543
2562
|
};
|
|
2544
2563
|
|
|
2545
|
-
// Добавлено для проверки
|
|
2546
|
-
const nearbyOffices = [
|
|
2547
|
-
{ title: 'Деловой центр', time: '1 мин', distance: '~30 м.', icon: 'MetroIcon' },
|
|
2548
|
-
{ title: 'Выставочная', time: '5 мин', distance: '~120 м.', icon: 'MetroIcon' },
|
|
2549
|
-
{ title: 'Деловой центр', time: '8 мин', distance: '~350 м.', icon: 'MetroIcon' },
|
|
2550
|
-
];
|
|
2551
|
-
|
|
2552
|
-
const renderCurrentDaySchedule = ({ lunchHour, status, workTime }) => {
|
|
2553
|
-
const hasTime = /\d+/gi.test(lunchHour);
|
|
2554
|
-
const lunchHourText = hasTime ? `Перерыв ${lunchHour}` : lunchHour;
|
|
2555
|
-
return status ? (jsxs("div", { className: "flex", children: [jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-primary-main border-green-light mr-4", children: workTime ? workTime : null }), jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-golden border-golden", children: lunchHour ? lunchHourText : null })] })) : (jsx("div", { className: "flex", children: jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-error border-error", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }) }));
|
|
2556
|
-
};
|
|
2557
|
-
const renderNearbyOffice = ({ icon, title, distance, time }, index) => (jsxs("div", { className: "flex mr-4", children: [jsx(Icon, { name: icon, width: "16", height: "16", asSVG: true, className: "mr-1" }), title ? jsxs("span", { className: "text-m", children: [title, "\u00A0"] }) : null, jsxs("span", { className: "text-m-light", children: [distance ? ` (${distance})` : null, time ? `, ${time}` : null] })] }, `nearbyOffice${index}`));
|
|
2558
|
-
const renderDay = ({ title, status, workTime, lunchHour, description }, inx) => (jsxs("div", { className: "flex flex-col pb-3 border-b border-solid border-main-divider mb-3 last:border-0", children: [jsxs("div", { className: "flex justify-between items-center w-full pb-1 text-l text-primary-text", children: [jsx("div", { children: title }), status ? null : jsx("div", { className: "text-m-light text-error", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }), status && workTime ? jsx("div", { children: workTime }) : null] }), status && lunchHour ? renderLunchHour(lunchHour) : null, description ? (jsx("div", { className: "pb-1 text-s-light text-secondary-text", children: description })) : null] }, `day${inx}`));
|
|
2559
|
-
const renderLunchHour = (lunchHour) => {
|
|
2560
|
-
const hasTime = /\d+/gi.test(lunchHour);
|
|
2561
|
-
return hasTime ? (jsxs("div", { className: "flex justify-between items-center w-full pb-1 text-m-light text-error", children: [jsx("div", { children: "\u041F\u0435\u0440\u0435\u0440\u044B\u0432" }), jsx("div", { children: lunchHour })] })) : (jsx("div", { className: "flex justify-between items-center w-full pb-1 text-m-light text-primary-main", children: jsx("div", { children: lunchHour }) }));
|
|
2562
|
-
};
|
|
2563
|
-
|
|
2564
2564
|
const OFFICE_MAP_URL = '/api/v1/branches';
|
|
2565
2565
|
// TODO: regionCode - внутренний идентификатор банка. Не соответствует государственной нумерации регионов РФ
|
|
2566
2566
|
// TODO: Список регионов можно получить через api/v1/regions
|
|
2567
2567
|
function useOfficeMap(regionCode) {
|
|
2568
2568
|
const { data } = useAsyncData(regionCode ? `${OFFICE_MAP_URL}?regionCode=${regionCode}` : undefined, fetchOfficeMap);
|
|
2569
|
-
|
|
2569
|
+
console.warn('WARNING!!! Hook useOfficeMap RETURN MOCK object for testing!');
|
|
2570
|
+
console.log('Hook useOfficeMap get this data:', data);
|
|
2571
|
+
return OFFICE_MAP;
|
|
2570
2572
|
}
|
|
2571
2573
|
const fetchOfficeMap = (url) => {
|
|
2572
2574
|
if (!url) {
|
|
@@ -2576,7 +2578,10 @@
|
|
|
2576
2578
|
};
|
|
2577
2579
|
|
|
2578
2580
|
const OfficeMap = JSX(({ className = '' }) => {
|
|
2579
|
-
|
|
2581
|
+
// TODO: useOfficeMap endpoint had use /api/v1/branches. This endpoint now is`t correct/
|
|
2582
|
+
// TODO: useOfficeMap has return MOCK OBJECT!
|
|
2583
|
+
// TODO: Fix this when endpoint /api/v1/branches (or new endpoint) had returning right data
|
|
2584
|
+
const resultOfficeMap = useOfficeMap('000');
|
|
2580
2585
|
const { name, address, gpsLatitude, gpsLongitude, workSchedule } = resultOfficeMap;
|
|
2581
2586
|
const { workingMonday, workingTuesday, workingWednesday, workingThursday, workingFriday, workingSaturday, workingSunday, } = workSchedule;
|
|
2582
2587
|
const { workTime, lunchHour, workTimeSaturday, lunchHourSaturday } = workSchedule;
|
|
@@ -3611,7 +3616,7 @@
|
|
|
3611
3616
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
3612
3617
|
}
|
|
3613
3618
|
|
|
3614
|
-
const packageVersion = "0.6.
|
|
3619
|
+
const packageVersion = "0.6.28";
|
|
3615
3620
|
|
|
3616
3621
|
exports.Blocks = Blocks;
|
|
3617
3622
|
exports.ContentPage = ContentPage;
|