@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.
Files changed (52) hide show
  1. package/bundle/bundle.umd.js +63 -19
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/ExchangeRateTile/renderInput.js +1 -1
  4. package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  5. package/dist/components/GroupBlock/GroupBlockTabs.js +1 -1
  6. package/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  7. package/dist/components/SafeDepositRental/SafeDepositRental.js +61 -2
  8. package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  9. package/dist/hooks/useSafeDepositRental.js +5 -1
  10. package/dist/hooks/useSafeDepositRental.js.map +1 -1
  11. package/lib/common.css +1 -1
  12. package/lib/components/ExchangeRateTile/renderInput.js +1 -1
  13. package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  14. package/lib/components/GroupBlock/GroupBlockTabs.js +1 -1
  15. package/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  16. package/lib/components/SafeDepositRental/SafeDepositRental.js +61 -2
  17. package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  18. package/lib/hooks/useSafeDepositRental.js +5 -1
  19. package/lib/hooks/useSafeDepositRental.js.map +1 -1
  20. package/mobile/bundle/bundle.umd.js +1 -1
  21. package/mobile/bundle/bundle.umd.min.js +1 -1
  22. package/mobile/dist/components/ExchangeRateTile/renderInput.js +1 -1
  23. package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  24. package/mobile/dist/components/GroupBlock/GroupBlockTabs.js +1 -1
  25. package/mobile/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  26. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +61 -2
  27. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  28. package/mobile/dist/hooks/useSafeDepositRental.js +5 -1
  29. package/mobile/dist/hooks/useSafeDepositRental.js.map +1 -1
  30. package/mobile/lib/components/ExchangeRateTile/renderInput.js +1 -1
  31. package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  32. package/mobile/lib/components/GroupBlock/GroupBlockTabs.js +1 -1
  33. package/mobile/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  34. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +61 -2
  35. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  36. package/mobile/lib/hooks/useSafeDepositRental.js +5 -1
  37. package/mobile/lib/hooks/useSafeDepositRental.js.map +1 -1
  38. package/mobile/src/components/ContentPage/ContentPage.page.json +4 -0
  39. package/mobile/src/components/ExchangeRateTile/renderInput.tsx +2 -2
  40. package/mobile/src/components/GroupBlock/GroupBlockTabs.tsx +1 -1
  41. package/mobile/src/components/SafeDepositRental/SafeDepositRental.example.json +3 -0
  42. package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +62 -2
  43. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +256 -0
  44. package/mobile/src/hooks/useSafeDepositRental.ts +5 -1
  45. package/package.json +1 -1
  46. package/src/components/ContentPage/ContentPage.page.json +4 -0
  47. package/src/components/ExchangeRateTile/renderInput.tsx +2 -2
  48. package/src/components/GroupBlock/GroupBlockTabs.tsx +1 -1
  49. package/src/components/SafeDepositRental/SafeDepositRental.example.json +3 -0
  50. package/src/components/SafeDepositRental/SafeDepositRental.tsx +62 -2
  51. package/src/components/__snapshots__/Blocks.spec.tsx.snap +256 -0
  52. package/src/hooks/useSafeDepositRental.ts +5 -1
@@ -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-4 bg-transparent", value: selected, onChange: (_) => setSelected(_), children: rates.map((_, i) => (jsx(SelectOption, { value: _.code, children: _.code }, String(i)))) })) : null] }));
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 = useSafeDepositRental(context.useAsyncData);
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