@redneckz/wildless-cms-uni-blocks 0.3.93 → 0.3.95
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 +63 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ExchangeRateTile/renderInput.js +1 -1
- package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/dist/components/GroupBlock/GroupBlockTabs.js +1 -1
- package/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRental.js +61 -2
- package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/dist/hooks/useSafeDepositRental.js +5 -1
- package/dist/hooks/useSafeDepositRental.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ExchangeRateTile/renderInput.js +1 -1
- package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/lib/components/GroupBlock/GroupBlockTabs.js +1 -1
- package/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRental.js +61 -2
- package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/lib/hooks/useSafeDepositRental.js +5 -1
- package/lib/hooks/useSafeDepositRental.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/renderInput.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlockTabs.js +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +61 -2
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/dist/hooks/useSafeDepositRental.js +5 -1
- package/mobile/dist/hooks/useSafeDepositRental.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/renderInput.js +1 -1
- package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlockTabs.js +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +61 -2
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/lib/hooks/useSafeDepositRental.js +5 -1
- package/mobile/lib/hooks/useSafeDepositRental.js.map +1 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +4 -0
- package/mobile/src/components/ExchangeRateTile/renderInput.tsx +2 -2
- package/mobile/src/components/GroupBlock/GroupBlockTabs.tsx +1 -1
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.example.json +3 -0
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +62 -2
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +256 -0
- package/mobile/src/hooks/useSafeDepositRental.ts +5 -1
- package/package.json +1 -1
- package/src/components/ContentPage/ContentPage.page.json +4 -0
- package/src/components/ExchangeRateTile/renderInput.tsx +2 -2
- package/src/components/GroupBlock/GroupBlockTabs.tsx +1 -1
- package/src/components/SafeDepositRental/SafeDepositRental.example.json +3 -0
- package/src/components/SafeDepositRental/SafeDepositRental.tsx +62 -2
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +256 -0
- package/src/hooks/useSafeDepositRental.ts +5 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -1827,7 +1827,7 @@
|
|
|
1827
1827
|
|
|
1828
1828
|
function renderInput(props) {
|
|
1829
1829
|
const { placeholder, rates, selected, value, setValue, setSelected } = props;
|
|
1830
|
-
return (jsxs("div", { className: "relative flex items-center", children: [jsx(Input, { className: "h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12", placeholder: placeholder, type: "text", value: value, onChange: setValue }), rates.length ? (jsx(Select, { className: "h-9 -translate-x-
|
|
1830
|
+
return (jsxs("div", { className: "relative flex items-center", children: [jsx(Input, { className: "shrink-0 h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12", placeholder: placeholder, type: "text", value: value, onChange: setValue }), rates.length ? (jsx(Select, { className: "shrink-0 w-20 h-9 -translate-x-8 bg-transparent", value: selected, onChange: (_) => setSelected(_), children: rates.map((_, i) => (jsx(SelectOption, { value: _.code, children: _.code }, String(i)))) })) : null] }));
|
|
1831
1831
|
}
|
|
1832
1832
|
|
|
1833
1833
|
const ExchangeCurrencyCalculator = JSX(({ context, className = '', currencyRatesBuy, currencyRatesSell, button }) => {
|
|
@@ -2123,7 +2123,7 @@
|
|
|
2123
2123
|
${isActive
|
|
2124
2124
|
? 'bg-white/30 text-white'
|
|
2125
2125
|
: 'bg-main-divider text-secondary-text group-hover:text-primary-main'}`;
|
|
2126
|
-
return (jsxs("div", { className: `flex-1 flex items-center justify-center cursor-pointer ${tabBg}`, role: "tab", onClick: () => onTabClick(tab.tag), "aria-selected": isActive, children: [tab?.title ? jsx("div", { className: tabText, children: tab.title }) : null, isShowCounter ? (jsx("div", { className: `flex items-center justify-center ${counterBlockStyle}`, children: tab.count })) : null] }, String(i)));
|
|
2126
|
+
return (jsxs("div", { className: `flex-1 flex items-center justify-center cursor-pointer m-1 ${tabBg}`, role: "tab", onClick: () => onTabClick(tab.tag), "aria-selected": isActive, children: [tab?.title ? jsx("div", { className: tabText, children: tab.title }) : null, isShowCounter ? (jsx("div", { className: `flex items-center justify-center ${counterBlockStyle}`, children: tab.count })) : null] }, String(i)));
|
|
2127
2127
|
};
|
|
2128
2128
|
|
|
2129
2129
|
const GroupBlock = JSX(({ className = '', tabs, context, groupBlocks = [], isShowCounter, ...rest }) => {
|
|
@@ -2587,22 +2587,6 @@
|
|
|
2587
2587
|
}) }));
|
|
2588
2588
|
};
|
|
2589
2589
|
|
|
2590
|
-
const SAFE_DEPOSIT_RENTAL_URL = '/api/v1/safe-deposit-rental.json';
|
|
2591
|
-
function useSafeDepositRental(useAsyncData) {
|
|
2592
|
-
const { data } = useAsyncData(SAFE_DEPOSIT_RENTAL_URL, fetchSafeDepositRental);
|
|
2593
|
-
const result = data || [];
|
|
2594
|
-
return result;
|
|
2595
|
-
}
|
|
2596
|
-
async function fetchSafeDepositRental() {
|
|
2597
|
-
try {
|
|
2598
|
-
const response = await fetch(SAFE_DEPOSIT_RENTAL_URL);
|
|
2599
|
-
return await response.json();
|
|
2600
|
-
}
|
|
2601
|
-
catch (err) {
|
|
2602
|
-
console.error(err);
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
2590
|
const Radio = JSX(({ name, text, value, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer", children: [jsx("input", { className: "appearance-none flex justify-center items-center w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main", type: "radio", value: value, name: name, checked: checked, onChange: onChange }), text ? jsx("span", { className: "font-sans ml-3 text-m-base cursor-pointer", children: text }) : null] }) })));
|
|
2607
2591
|
|
|
2608
2592
|
const SafeDepositRentalForm = ({ cities, cellDimensions, cellOptions, days, setDays, context, }) => {
|
|
@@ -2691,9 +2675,69 @@
|
|
|
2691
2675
|
};
|
|
2692
2676
|
|
|
2693
2677
|
const DEFAULT_DAYS = 26;
|
|
2678
|
+
const DATA = {
|
|
2679
|
+
cities: [
|
|
2680
|
+
{
|
|
2681
|
+
city: 'Москва',
|
|
2682
|
+
offices: [
|
|
2683
|
+
{
|
|
2684
|
+
office: 'МоскваОфис1',
|
|
2685
|
+
rate: 1,
|
|
2686
|
+
},
|
|
2687
|
+
{
|
|
2688
|
+
office: 'МоскваОфис2',
|
|
2689
|
+
rate: 2,
|
|
2690
|
+
},
|
|
2691
|
+
{
|
|
2692
|
+
office: 'МоскваОфис3',
|
|
2693
|
+
rate: 3,
|
|
2694
|
+
},
|
|
2695
|
+
],
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
city: 'Краснодар',
|
|
2699
|
+
offices: [
|
|
2700
|
+
{
|
|
2701
|
+
office: 'КраснодарОфис1',
|
|
2702
|
+
rate: 2,
|
|
2703
|
+
},
|
|
2704
|
+
{
|
|
2705
|
+
office: 'КраснодарОфис2',
|
|
2706
|
+
rate: 4,
|
|
2707
|
+
},
|
|
2708
|
+
{
|
|
2709
|
+
office: 'КраснодарОфис3',
|
|
2710
|
+
rate: 6,
|
|
2711
|
+
},
|
|
2712
|
+
],
|
|
2713
|
+
},
|
|
2714
|
+
],
|
|
2715
|
+
cellDimensions: [
|
|
2716
|
+
{
|
|
2717
|
+
dimension: 'маленькая',
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
dimension: 'средняя',
|
|
2721
|
+
},
|
|
2722
|
+
{
|
|
2723
|
+
dimension: 'большая',
|
|
2724
|
+
},
|
|
2725
|
+
],
|
|
2726
|
+
cellOptions: [
|
|
2727
|
+
{
|
|
2728
|
+
option: '125x225x375',
|
|
2729
|
+
},
|
|
2730
|
+
{
|
|
2731
|
+
option: '200x300x400',
|
|
2732
|
+
},
|
|
2733
|
+
{
|
|
2734
|
+
option: '300x400x500',
|
|
2735
|
+
},
|
|
2736
|
+
],
|
|
2737
|
+
};
|
|
2694
2738
|
const SafeDepositRental = JSX(({ context, className = '', ...rest }) => {
|
|
2695
2739
|
const [days, setDays] = context.useState(DEFAULT_DAYS);
|
|
2696
|
-
const data =
|
|
2740
|
+
const data = DATA;
|
|
2697
2741
|
return (jsxs(BlockWrapper, { context: context, className: `bg-white px-8 py-12 ${className}`, ...rest, children: [jsxs("div", { className: "flex justify-between align-top mb-6", children: [data?.cities?.length ? (jsx(SafeDepositRentalForm, { ...data, days: days, setDays: setDays, context: context })) : null, jsx(SafeDepositRentalTotal, { days: days })] }), jsx("p", { className: "text-button font-light text-secondary-text", children: "\u0410\u0440\u0435\u043D\u0434\u0430 \u0421\u042F, \u0432 \u0441\u043B\u0443\u0447\u0430\u0435 \u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u044B \u043A\u0443\u043F\u043B\u0438-\u043F\u0440\u043E\u0434\u0430\u0436\u0438, \u0441 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C \u043D\u0430\u043B\u0438\u0447\u043D\u044B\u0445 \u0434\u0435\u043D\u0435\u0433 \u0438\u043B\u0438 \u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u044B \u0438\u043F\u043E\u0442\u0435\u0447\u043D\u043E\u0439 \u0441\u0434\u0435\u043B\u043A\u0438" })] }));
|
|
2698
2742
|
});
|
|
2699
2743
|
|