@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
@@ -6,7 +6,11 @@ export function useSafeDepositRental(useAsyncData) {
6
6
  }
7
7
  async function fetchSafeDepositRental() {
8
8
  try {
9
- const response = await fetch(SAFE_DEPOSIT_RENTAL_URL);
9
+ const response = await fetch(SAFE_DEPOSIT_RENTAL_URL, {
10
+ headers: {
11
+ 'Content-Type': 'application/json',
12
+ },
13
+ });
10
14
  return await response.json();
11
15
  }
12
16
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"useSafeDepositRental.js","sourceRoot":"","sources":["../../src/hooks/useSafeDepositRental.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG,kCAAkC,CAAC;AAEnE,MAAM,UAAU,oBAAoB,CAAC,YAA2B;IAC9D,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IAE/E,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,sBAAsB;IACnC,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAEtD,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;KAC9B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACpB;AACH,CAAC"}
1
+ {"version":3,"file":"useSafeDepositRental.js","sourceRoot":"","sources":["../../src/hooks/useSafeDepositRental.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG,kCAAkC,CAAC;AAEnE,MAAM,UAAU,oBAAoB,CAAC,YAA2B;IAC9D,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IAE/E,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,sBAAsB;IACnC,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,uBAAuB,EAAE;YACpD,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAC;QAEH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;KAC9B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACpB;AACH,CAAC"}
@@ -2231,6 +2231,10 @@
2231
2231
  ]
2232
2232
  }
2233
2233
  },
2234
+ {
2235
+ "type": "SafeDepositRental",
2236
+ "style": ["col-span-12"]
2237
+ },
2234
2238
 
2235
2239
  {
2236
2240
  "type": "Footer",
@@ -19,7 +19,7 @@ export function renderInput(props: InputProps) {
19
19
  return (
20
20
  <div className="relative flex items-center">
21
21
  <Input
22
- className="h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12"
22
+ className="shrink-0 h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12"
23
23
  placeholder={placeholder}
24
24
  type="text"
25
25
  value={value}
@@ -27,7 +27,7 @@ export function renderInput(props: InputProps) {
27
27
  />
28
28
  {rates.length ? (
29
29
  <Select
30
- className="h-9 -translate-x-4 bg-transparent"
30
+ className="shrink-0 w-20 h-9 -translate-x-8 bg-transparent"
31
31
  value={selected}
32
32
  onChange={(_) => setSelected(_ as Currency)}
33
33
  >
@@ -41,7 +41,7 @@ const renderTab =
41
41
  return (
42
42
  <div
43
43
  key={String(i)}
44
- className={`flex-1 flex items-center justify-center cursor-pointer ${tabBg}`}
44
+ className={`flex-1 flex items-center justify-center cursor-pointer m-1 ${tabBg}`}
45
45
  role="tab"
46
46
  onClick={() => onTabClick(tab.tag)}
47
47
  aria-selected={isActive}
@@ -0,0 +1,3 @@
1
+ {
2
+ "title": "Аренда сейфовых ячеек"
3
+ }
@@ -1,5 +1,4 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useSafeDepositRental } from '../../hooks/useSafeDepositRental';
3
2
  import type { UniBlockProps } from '../../types';
4
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
4
  import type { SafeDepositRentalContent } from './SafeDepositRentalContent';
@@ -10,10 +9,71 @@ export interface SafeDepositRentalProps extends SafeDepositRentalContent, UniBlo
10
9
 
11
10
  const DEFAULT_DAYS = 26;
12
11
 
12
+ const DATA = {
13
+ cities: [
14
+ {
15
+ city: 'Москва',
16
+ offices: [
17
+ {
18
+ office: 'МоскваОфис1',
19
+ rate: 1,
20
+ },
21
+ {
22
+ office: 'МоскваОфис2',
23
+ rate: 2,
24
+ },
25
+ {
26
+ office: 'МоскваОфис3',
27
+ rate: 3,
28
+ },
29
+ ],
30
+ },
31
+ {
32
+ city: 'Краснодар',
33
+ offices: [
34
+ {
35
+ office: 'КраснодарОфис1',
36
+ rate: 2,
37
+ },
38
+ {
39
+ office: 'КраснодарОфис2',
40
+ rate: 4,
41
+ },
42
+ {
43
+ office: 'КраснодарОфис3',
44
+ rate: 6,
45
+ },
46
+ ],
47
+ },
48
+ ],
49
+ cellDimensions: [
50
+ {
51
+ dimension: 'маленькая',
52
+ },
53
+ {
54
+ dimension: 'средняя',
55
+ },
56
+ {
57
+ dimension: 'большая',
58
+ },
59
+ ],
60
+ cellOptions: [
61
+ {
62
+ option: '125x225x375',
63
+ },
64
+ {
65
+ option: '200x300x400',
66
+ },
67
+ {
68
+ option: '300x400x500',
69
+ },
70
+ ],
71
+ };
72
+
13
73
  export const SafeDepositRental = JSX<SafeDepositRentalProps>(
14
74
  ({ context, className = '', ...rest }) => {
15
75
  const [days, setDays] = context.useState(DEFAULT_DAYS);
16
- const data = useSafeDepositRental(context.useAsyncData);
76
+ const data = DATA;
17
77
 
18
78
  return (
19
79
  <BlockWrapper context={context} className={`bg-white px-8 py-12 ${className}`} {...rest}>
@@ -825,6 +825,262 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
825
825
  <div
826
826
  class="flex justify-between align-top mb-6"
827
827
  >
828
+ <div
829
+ class="flex-1 mr-9"
830
+ >
831
+ <div
832
+ class="flex justify-between mb-6"
833
+ >
834
+ <div
835
+ class="w-full mr-4"
836
+ >
837
+ <div>
838
+ <span
839
+ class="block font-light text-m mb-2"
840
+ >
841
+ Город
842
+ </span>
843
+ <select
844
+ class="appearance-none h-14 border border-gray p-4 rounded-md text-m-sm w-full cursor-pointer"
845
+ style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
846
+ >
847
+ <option
848
+ class=""
849
+ value="Москва"
850
+ >
851
+ Москва
852
+ </option>
853
+ <option
854
+ class=""
855
+ value="Краснодар"
856
+ >
857
+ Краснодар
858
+ </option>
859
+ </select>
860
+ </div>
861
+ </div>
862
+ <div
863
+ class="w-full"
864
+ >
865
+ <div>
866
+ <span
867
+ class="block font-light text-m mb-2"
868
+ >
869
+ Отделение
870
+ </span>
871
+ <select
872
+ class="appearance-none h-14 border border-gray p-4 rounded-md text-m-sm w-full cursor-pointer"
873
+ style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
874
+ >
875
+ <option
876
+ class=""
877
+ value="МоскваОфис1"
878
+ >
879
+ МоскваОфис1
880
+ </option>
881
+ <option
882
+ class=""
883
+ value="МоскваОфис2"
884
+ >
885
+ МоскваОфис2
886
+ </option>
887
+ <option
888
+ class=""
889
+ value="МоскваОфис3"
890
+ >
891
+ МоскваОфис3
892
+ </option>
893
+ </select>
894
+ </div>
895
+ </div>
896
+ </div>
897
+ <div
898
+ class="mb-6"
899
+ >
900
+ <span
901
+ class="block font-light text-m mb-[3px]"
902
+ >
903
+ Срок аренды
904
+ </span>
905
+ <div>
906
+ <label
907
+ class="block relative"
908
+ >
909
+ <input
910
+ class="m-0 mt-[5px] font-sans text-h3 w-full h-14 border border-solid border-main-stroke rounded-md
911
+ outline-none p-0 pl-4 box-border text-primary-text"
912
+ value="26"
913
+ />
914
+ <div
915
+ class="absolute inset-x-0 bottom-[-4px] px-4 leading-[18px]"
916
+ >
917
+ <input
918
+ class="box-border w-full m-0 cursor-pointer slider"
919
+ max="365"
920
+ min="1"
921
+ step="1"
922
+ style="background-size: 6.87% 100%;"
923
+ type="range"
924
+ value="26"
925
+ />
926
+ </div>
927
+ </label>
928
+ <div
929
+ class="flex justify-between my-3"
930
+ >
931
+ <span
932
+ class="text-sm leading-[14px] text-secondary-text pl-4"
933
+ >
934
+ От 1 дня
935
+ </span>
936
+ <span
937
+ class="text-sm leading-[14px] text-secondary-text pl-4"
938
+ >
939
+ До 365 дней
940
+ </span>
941
+ </div>
942
+ </div>
943
+ </div>
944
+ <div
945
+ class="flex justify-between mb-6"
946
+ >
947
+ <div
948
+ class="mr-4 w-full"
949
+ >
950
+ <div>
951
+ <span
952
+ class="block font-light text-m mb-2"
953
+ >
954
+ Размер ячейки
955
+ </span>
956
+ <select
957
+ class="appearance-none h-14 border border-gray p-4 rounded-md text-m-sm w-full cursor-pointer"
958
+ style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
959
+ >
960
+ <option
961
+ class=""
962
+ value="маленькая"
963
+ >
964
+ маленькая
965
+ </option>
966
+ <option
967
+ class=""
968
+ value="средняя"
969
+ >
970
+ средняя
971
+ </option>
972
+ <option
973
+ class=""
974
+ value="большая"
975
+ >
976
+ большая
977
+ </option>
978
+ </select>
979
+ </div>
980
+ </div>
981
+ <div
982
+ class="w-full"
983
+ >
984
+ <div>
985
+ <span
986
+ class="block font-light text-m mb-2"
987
+ >
988
+ Параметры ячейки, мм (ВхШхД)
989
+ </span>
990
+ <select
991
+ class="appearance-none h-14 border border-gray p-4 rounded-md text-m-sm w-full cursor-pointer"
992
+ style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
993
+ >
994
+ <option
995
+ class=""
996
+ value="125x225x375"
997
+ >
998
+ 125x225x375
999
+ </option>
1000
+ <option
1001
+ class=""
1002
+ value="200x300x400"
1003
+ >
1004
+ 200x300x400
1005
+ </option>
1006
+ <option
1007
+ class=""
1008
+ value="300x400x500"
1009
+ >
1010
+ 300x400x500
1011
+ </option>
1012
+ </select>
1013
+ </div>
1014
+ </div>
1015
+ </div>
1016
+ <span
1017
+ class="text-secondary-text font-light"
1018
+ >
1019
+ Тип договора
1020
+ </span>
1021
+ <div
1022
+ class="flex justify-between items-center mt-5"
1023
+ >
1024
+ <div>
1025
+ <div
1026
+ class="mb-2"
1027
+ >
1028
+ <label
1029
+ class="flex items-center relative cursor-pointer"
1030
+ >
1031
+ <input
1032
+ checked=""
1033
+ class="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"
1034
+ name="contractType"
1035
+ type="radio"
1036
+ value="option1"
1037
+ />
1038
+ <span
1039
+ class="font-sans ml-3 text-m-base cursor-pointer"
1040
+ >
1041
+ Простое хранение
1042
+ </span>
1043
+ </label>
1044
+ </div>
1045
+ <div>
1046
+ <label
1047
+ class="flex items-center relative cursor-pointer"
1048
+ >
1049
+ <input
1050
+ class="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"
1051
+ name="contractType"
1052
+ type="radio"
1053
+ value="option2"
1054
+ />
1055
+ <span
1056
+ class="font-sans ml-3 text-m-base cursor-pointer"
1057
+ >
1058
+ Сделка с недвижимостью
1059
+ </span>
1060
+ </label>
1061
+ </div>
1062
+ </div>
1063
+ <a
1064
+ class="text-center font-sans select-none inline-block cursor-pointer no-underline focus:border-primary-focus focus:border text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active rounded-md "
1065
+ role="button"
1066
+ >
1067
+ <div
1068
+ class="flex items-center justify-center gap-2 py-4 px-9 "
1069
+ >
1070
+ <div>
1071
+ <div
1072
+ class="text-xs text-left"
1073
+ />
1074
+ <div
1075
+ class="text-left text-l"
1076
+ >
1077
+ Офисы на карте
1078
+ </div>
1079
+ </div>
1080
+ </div>
1081
+ </a>
1082
+ </div>
1083
+ </div>
828
1084
  <div
829
1085
  class="flex flex-col justify-between"
830
1086
  >
@@ -12,7 +12,11 @@ export function useSafeDepositRental(useAsyncData: AsyncDataHook) {
12
12
 
13
13
  async function fetchSafeDepositRental(): Promise<any | undefined> {
14
14
  try {
15
- const response = await fetch(SAFE_DEPOSIT_RENTAL_URL);
15
+ const response = await fetch(SAFE_DEPOSIT_RENTAL_URL, {
16
+ headers: {
17
+ 'Content-Type': 'application/json',
18
+ },
19
+ });
16
20
 
17
21
  return await response.json();
18
22
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.93",
3
+ "version": "0.3.95",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -2231,6 +2231,10 @@
2231
2231
  ]
2232
2232
  }
2233
2233
  },
2234
+ {
2235
+ "type": "SafeDepositRental",
2236
+ "style": ["col-span-12"]
2237
+ },
2234
2238
 
2235
2239
  {
2236
2240
  "type": "Footer",
@@ -19,7 +19,7 @@ export function renderInput(props: InputProps) {
19
19
  return (
20
20
  <div className="relative flex items-center">
21
21
  <Input
22
- className="h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12"
22
+ className="shrink-0 h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12"
23
23
  placeholder={placeholder}
24
24
  type="text"
25
25
  value={value}
@@ -27,7 +27,7 @@ export function renderInput(props: InputProps) {
27
27
  />
28
28
  {rates.length ? (
29
29
  <Select
30
- className="h-9 -translate-x-4 bg-transparent"
30
+ className="shrink-0 w-20 h-9 -translate-x-8 bg-transparent"
31
31
  value={selected}
32
32
  onChange={(_) => setSelected(_ as Currency)}
33
33
  >
@@ -41,7 +41,7 @@ const renderTab =
41
41
  return (
42
42
  <div
43
43
  key={String(i)}
44
- className={`flex-1 flex items-center justify-center cursor-pointer ${tabBg}`}
44
+ className={`flex-1 flex items-center justify-center cursor-pointer m-1 ${tabBg}`}
45
45
  role="tab"
46
46
  onClick={() => onTabClick(tab.tag)}
47
47
  aria-selected={isActive}
@@ -0,0 +1,3 @@
1
+ {
2
+ "title": "Аренда сейфовых ячеек"
3
+ }
@@ -1,5 +1,4 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useSafeDepositRental } from '../../hooks/useSafeDepositRental';
3
2
  import type { UniBlockProps } from '../../types';
4
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
4
  import type { SafeDepositRentalContent } from './SafeDepositRentalContent';
@@ -10,10 +9,71 @@ export interface SafeDepositRentalProps extends SafeDepositRentalContent, UniBlo
10
9
 
11
10
  const DEFAULT_DAYS = 26;
12
11
 
12
+ const DATA = {
13
+ cities: [
14
+ {
15
+ city: 'Москва',
16
+ offices: [
17
+ {
18
+ office: 'МоскваОфис1',
19
+ rate: 1,
20
+ },
21
+ {
22
+ office: 'МоскваОфис2',
23
+ rate: 2,
24
+ },
25
+ {
26
+ office: 'МоскваОфис3',
27
+ rate: 3,
28
+ },
29
+ ],
30
+ },
31
+ {
32
+ city: 'Краснодар',
33
+ offices: [
34
+ {
35
+ office: 'КраснодарОфис1',
36
+ rate: 2,
37
+ },
38
+ {
39
+ office: 'КраснодарОфис2',
40
+ rate: 4,
41
+ },
42
+ {
43
+ office: 'КраснодарОфис3',
44
+ rate: 6,
45
+ },
46
+ ],
47
+ },
48
+ ],
49
+ cellDimensions: [
50
+ {
51
+ dimension: 'маленькая',
52
+ },
53
+ {
54
+ dimension: 'средняя',
55
+ },
56
+ {
57
+ dimension: 'большая',
58
+ },
59
+ ],
60
+ cellOptions: [
61
+ {
62
+ option: '125x225x375',
63
+ },
64
+ {
65
+ option: '200x300x400',
66
+ },
67
+ {
68
+ option: '300x400x500',
69
+ },
70
+ ],
71
+ };
72
+
13
73
  export const SafeDepositRental = JSX<SafeDepositRentalProps>(
14
74
  ({ context, className = '', ...rest }) => {
15
75
  const [days, setDays] = context.useState(DEFAULT_DAYS);
16
- const data = useSafeDepositRental(context.useAsyncData);
76
+ const data = DATA;
17
77
 
18
78
  return (
19
79
  <BlockWrapper context={context} className={`bg-white px-8 py-12 ${className}`} {...rest}>