@redneckz/wildless-cms-uni-blocks 0.14.898 → 0.14.900

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 (254) hide show
  1. package/bin/migration-scripts/0.14.900.js +18 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +287 -27
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
  6. package/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
  7. package/bundle/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  8. package/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
  9. package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
  10. package/bundle/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
  11. package/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
  12. package/bundle/components/ExchangeRateTile/calculateResult.d.ts +2 -0
  13. package/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
  14. package/bundle/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  15. package/bundle/components/ExchangeRateTile/renderInput.d.ts +11 -0
  16. package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
  17. package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  18. package/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
  19. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
  20. package/dist/components/Blocks.js +2 -0
  21. package/dist/components/Blocks.js.map +1 -1
  22. package/dist/components/Blocks.mobile.js +2 -0
  23. package/dist/components/Blocks.mobile.js.map +1 -1
  24. package/dist/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
  25. package/dist/components/ExchangeRateTile/CurrencyProps.js +10 -0
  26. package/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
  27. package/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  28. package/dist/components/ExchangeRateTile/CurrencyTable.js +23 -0
  29. package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  30. package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
  31. package/dist/components/ExchangeRateTile/CurrentLocation.js +10 -0
  32. package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  33. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
  34. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +73 -0
  35. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  36. package/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
  37. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +26 -0
  38. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
  39. package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
  40. package/dist/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
  41. package/dist/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
  42. package/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
  43. package/dist/components/ExchangeRateTile/calculateResult.js +11 -0
  44. package/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
  45. package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
  46. package/dist/components/ExchangeRateTile/callbackCurrencySelect.js +21 -0
  47. package/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
  48. package/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  49. package/dist/components/ExchangeRateTile/formatCurrency.js +10 -0
  50. package/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  51. package/dist/components/ExchangeRateTile/renderInput.d.ts +11 -0
  52. package/dist/components/ExchangeRateTile/renderInput.js +16 -0
  53. package/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
  54. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
  55. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +13 -0
  56. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  57. package/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  58. package/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  59. package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  60. package/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
  61. package/dist/components/OfficesAtmsMap/filters.js +18 -0
  62. package/dist/components/OfficesAtmsMap/filters.js.map +1 -1
  63. package/lib/common.css +1 -1
  64. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
  65. package/lib/components/Blocks.js +2 -0
  66. package/lib/components/Blocks.js.map +1 -1
  67. package/lib/components/Blocks.mobile.js +2 -0
  68. package/lib/components/Blocks.mobile.js.map +1 -1
  69. package/lib/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
  70. package/lib/components/ExchangeRateTile/CurrencyProps.js +8 -0
  71. package/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
  72. package/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  73. package/lib/components/ExchangeRateTile/CurrencyTable.js +21 -0
  74. package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  75. package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
  76. package/lib/components/ExchangeRateTile/CurrentLocation.js +8 -0
  77. package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  78. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
  79. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +71 -0
  80. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  81. package/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
  82. package/lib/components/ExchangeRateTile/ExchangeRateTile.fixture.d.ts +5 -0
  83. package/lib/components/ExchangeRateTile/ExchangeRateTile.fixture.mobile.d.ts +5 -0
  84. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +24 -0
  85. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
  86. package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
  87. package/lib/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
  88. package/lib/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
  89. package/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
  90. package/lib/components/ExchangeRateTile/calculateResult.js +7 -0
  91. package/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
  92. package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
  93. package/lib/components/ExchangeRateTile/callbackCurrencySelect.js +18 -0
  94. package/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
  95. package/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  96. package/lib/components/ExchangeRateTile/formatCurrency.js +7 -0
  97. package/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  98. package/lib/components/ExchangeRateTile/renderInput.d.ts +11 -0
  99. package/lib/components/ExchangeRateTile/renderInput.js +13 -0
  100. package/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
  101. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
  102. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +10 -0
  103. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  104. package/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  105. package/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  106. package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  107. package/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
  108. package/lib/components/OfficesAtmsMap/filters.js +18 -0
  109. package/lib/components/OfficesAtmsMap/filters.js.map +1 -1
  110. package/mobile/bundle/bundle.umd.js +287 -27
  111. package/mobile/bundle/bundle.umd.min.js +1 -1
  112. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
  113. package/mobile/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
  114. package/mobile/bundle/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  115. package/mobile/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
  116. package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
  117. package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
  118. package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
  119. package/mobile/bundle/components/ExchangeRateTile/calculateResult.d.ts +2 -0
  120. package/mobile/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
  121. package/mobile/bundle/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  122. package/mobile/bundle/components/ExchangeRateTile/renderInput.d.ts +11 -0
  123. package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
  124. package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  125. package/mobile/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
  126. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
  127. package/mobile/dist/components/Blocks.js +2 -0
  128. package/mobile/dist/components/Blocks.js.map +1 -1
  129. package/mobile/dist/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
  130. package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js +10 -0
  131. package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
  132. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  133. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +23 -0
  134. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  135. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
  136. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +10 -0
  137. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  138. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
  139. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +73 -0
  140. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  141. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
  142. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +26 -0
  143. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
  144. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
  145. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
  146. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
  147. package/mobile/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
  148. package/mobile/dist/components/ExchangeRateTile/calculateResult.js +11 -0
  149. package/mobile/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
  150. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
  151. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js +21 -0
  152. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
  153. package/mobile/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  154. package/mobile/dist/components/ExchangeRateTile/formatCurrency.js +10 -0
  155. package/mobile/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  156. package/mobile/dist/components/ExchangeRateTile/renderInput.d.ts +11 -0
  157. package/mobile/dist/components/ExchangeRateTile/renderInput.js +16 -0
  158. package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
  159. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
  160. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +13 -0
  161. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  162. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  163. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  164. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  165. package/mobile/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
  166. package/mobile/dist/components/OfficesAtmsMap/filters.js +18 -0
  167. package/mobile/dist/components/OfficesAtmsMap/filters.js.map +1 -1
  168. package/mobile/lib/common.css +1 -1
  169. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
  170. package/mobile/lib/components/Blocks.js +2 -0
  171. package/mobile/lib/components/Blocks.js.map +1 -1
  172. package/mobile/lib/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
  173. package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js +8 -0
  174. package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
  175. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  176. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +21 -0
  177. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  178. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
  179. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +8 -0
  180. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  181. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
  182. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +71 -0
  183. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  184. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
  185. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +24 -0
  186. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
  187. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
  188. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
  189. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
  190. package/mobile/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
  191. package/mobile/lib/components/ExchangeRateTile/calculateResult.js +7 -0
  192. package/mobile/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
  193. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
  194. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js +18 -0
  195. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
  196. package/mobile/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  197. package/mobile/lib/components/ExchangeRateTile/formatCurrency.js +7 -0
  198. package/mobile/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  199. package/mobile/lib/components/ExchangeRateTile/renderInput.d.ts +11 -0
  200. package/mobile/lib/components/ExchangeRateTile/renderInput.js +13 -0
  201. package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
  202. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
  203. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +10 -0
  204. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  205. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
  206. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
  207. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
  208. package/mobile/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
  209. package/mobile/lib/components/OfficesAtmsMap/filters.js +18 -0
  210. package/mobile/lib/components/OfficesAtmsMap/filters.js.map +1 -1
  211. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
  212. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
  213. package/mobile/src/components/Blocks.ts +2 -0
  214. package/mobile/src/components/ExchangeRateTile/CurrencyProps.ts +6 -0
  215. package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +64 -0
  216. package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +28 -0
  217. package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +155 -0
  218. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.example.json +12 -0
  219. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +60 -0
  220. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -0
  221. package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
  222. package/mobile/src/components/ExchangeRateTile/calculateResult.ts +9 -0
  223. package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +25 -0
  224. package/mobile/src/components/ExchangeRateTile/formatCurrency.ts +8 -0
  225. package/mobile/src/components/ExchangeRateTile/renderInput.tsx +43 -0
  226. package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +25 -0
  227. package/mobile/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
  228. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
  229. package/mobile/src/components/OfficesAtmsMap/filters.ts +24 -0
  230. package/package.json +2 -2
  231. package/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
  232. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +11 -11
  233. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +11 -11
  234. package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
  235. package/src/components/Blocks.mobile.ts +2 -0
  236. package/src/components/Blocks.ts +2 -0
  237. package/src/components/ExchangeRateTile/CurrencyProps.ts +6 -0
  238. package/src/components/ExchangeRateTile/CurrencyTable.tsx +64 -0
  239. package/src/components/ExchangeRateTile/CurrentLocation.tsx +28 -0
  240. package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +155 -0
  241. package/src/components/ExchangeRateTile/ExchangeRateTile.example.json +12 -0
  242. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.mobile.tsx +21 -0
  243. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +21 -0
  244. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +60 -0
  245. package/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -0
  246. package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
  247. package/src/components/ExchangeRateTile/calculateResult.ts +9 -0
  248. package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +25 -0
  249. package/src/components/ExchangeRateTile/formatCurrency.ts +8 -0
  250. package/src/components/ExchangeRateTile/renderInput.tsx +43 -0
  251. package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +25 -0
  252. package/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
  253. package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
  254. package/src/components/OfficesAtmsMap/filters.ts +24 -0
@@ -0,0 +1,8 @@
1
+ import { Currency } from './CurrencyProps';
2
+
3
+ const currencyNumberFormat = new Intl.NumberFormat('ru', {
4
+ style: 'currency',
5
+ currency: Currency.RUB,
6
+ });
7
+
8
+ export const formatCurrency = (value?: number) => (value ? currencyNumberFormat.format(value) : '');
@@ -0,0 +1,43 @@
1
+ import { type ControlProps } from '../../model/ControlProps';
2
+ import { type PlaceholderProps } from '../../model/PlaceholderProps';
3
+ import { Input } from '../../ui-kit/Input/Input';
4
+ import { type Option } from '../../ui-kit/Select/Option';
5
+ import { Select } from '../../ui-kit/Select/Select';
6
+ import { type Currency } from './CurrencyProps';
7
+ import { type ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
8
+
9
+ interface InputProps extends PlaceholderProps, ControlProps<string> {
10
+ rates: ExchangeCurrencyItem[];
11
+ selected: string;
12
+ setSelected: (value: Currency) => void;
13
+ }
14
+
15
+ export function renderInput(props: InputProps) {
16
+ const { placeholder, rates, selected, value, onChange, setSelected } = props;
17
+ const ratesOptions: Option[] = rates.map((_) => ({
18
+ key: _?.currency?.currency ?? '',
19
+ text: _?.currency?.currency ?? '',
20
+ }));
21
+ const selectedValue: Option = { key: selected, text: selected };
22
+
23
+ return (
24
+ <div className="relative flex">
25
+ <Input
26
+ className="shrink-0 text-l w-full appearance-none -mr-20"
27
+ placeholder={placeholder}
28
+ type="text"
29
+ value={value}
30
+ onChange={onChange}
31
+ />
32
+ {ratesOptions.length ? (
33
+ <Select
34
+ className="absolute right-0"
35
+ isBorder={false}
36
+ onChange={(_) => setSelected(_.key as Currency)}
37
+ options={ratesOptions}
38
+ value={selectedValue}
39
+ />
40
+ ) : null}
41
+ </div>
42
+ );
43
+ }
@@ -0,0 +1,25 @@
1
+ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
+ import { API_BASE_URI } from '../../api/apiBaseUrl';
3
+ import { type ExchangeCurrencyItem } from '../../components/ExchangeRateTile/ExchangeCurrencyCalculator';
4
+ import { type Region } from '../../hooks/useRegions';
5
+ import { fetchJSONUnsafe, type FetchJSONUnsafeType } from '../../utils/fetchJSON';
6
+
7
+ export interface ExchangeData {
8
+ exchangeRate?: {
9
+ currencies?: ExchangeCurrencyItem[];
10
+ };
11
+ address?: string;
12
+ }
13
+
14
+ const EXCHANGE_RATES_URL = `${API_BASE_URI}/exchangerates`;
15
+
16
+ export function useFetchExchangeRateData(currentRegion: Region) {
17
+ const regionCode = currentRegion?.code || '000';
18
+
19
+ const { data } = useAsyncData(
20
+ EXCHANGE_RATES_URL + `?regionCode=${regionCode}`,
21
+ fetchJSONUnsafe as FetchJSONUnsafeType<ExchangeData>,
22
+ );
23
+
24
+ return data || {};
25
+ }
@@ -8,8 +8,32 @@ import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
8
8
  import { Foldable } from '../../ui-kit/Foldable/Foldable';
9
9
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
10
10
  import { Icon } from '../../ui-kit/Icon/Icon';
11
+ import { Text } from '../../ui-kit/Text/Text';
11
12
 
12
13
  const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
14
+ const VISIBLE_FILTERS = [
15
+ 'workingSaturday',
16
+ 'premiumService',
17
+ 'privateBanking',
18
+ 'remoteWorkplace',
19
+ 'serviceDisabledPeople',
20
+ 'transferringDataToBiometricSystem',
21
+ ];
22
+ const PRECIOUS_METALS_FILTERS = [
23
+ 'sellingCoins',
24
+ 'buyingCoins',
25
+ 'bullionOperations',
26
+ 'preciousMetalsOperations',
27
+ ];
28
+ const DISABLED_SERVICE_FILTERS = [
29
+ 'hasAccessibilitySign',
30
+ 'equippedWithRamp',
31
+ 'equippedWithLift',
32
+ 'equippedWithElevator',
33
+ 'equippedWithStairclimber',
34
+ 'hasHelpMeButton',
35
+ ];
36
+ const VISIBLE_ATMS_FILTERS_NUM = 6;
13
37
 
14
38
  export interface RenderFiltrationFormProps {
15
39
  filters: string[];
@@ -18,18 +42,25 @@ export interface RenderFiltrationFormProps {
18
42
  labels: Record<string, string>;
19
43
  }
20
44
 
21
- export const FiltrationForm = JSX<RenderFiltrationFormProps>(
22
- ({ filters, field: { field, reset }, onlyOffice, labels }) => {
23
- const visibleFiltersNum = onlyOffice ? 5 : 6;
45
+ type getFilterProps = {
46
+ onlyOffice?: boolean;
47
+ filtersCheckbox?: filtersCheckboxType[];
48
+ };
24
49
 
25
- const filtersCheckbox = (filters || []).map((key) => (
50
+ type filtersCheckboxType = {
51
+ key: string;
52
+ };
53
+
54
+ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
55
+ ({ filters = [], field: { field, reset }, onlyOffice, labels }) => {
56
+ const filtersCheckbox = filters.map((key) => (
26
57
  <Checkbox key={key} text={labels[key]} {...field(key)} />
27
58
  ));
28
59
 
29
- const [visibleFilters, hiddenFilters] =
30
- visibleFiltersNum > 0
31
- ? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
32
- : [filtersCheckbox, []];
60
+ const [visibleFilters, hiddenPreciousMetalsFilters, hiddenDisabledServiceFilters] = getFilters({
61
+ onlyOffice,
62
+ filtersCheckbox,
63
+ });
33
64
 
34
65
  const [isUnfolded, { toggle }] = useBool(false);
35
66
 
@@ -40,11 +71,8 @@ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
40
71
  <Foldable>
41
72
  <div>
42
73
  <div className={COMMON_FILTERS_STYLES}>{visibleFilters}</div>
43
- <FoldableSection className={COMMON_FILTERS_STYLES} isUnfolded={isUnfolded}>
44
- {hiddenFilters}
45
- </FoldableSection>
46
74
  </div>
47
- <div className="flex space-x-lg">
75
+ <div className="flex space-x-lg pb-2xl">
48
76
  {onlyOffice ? (
49
77
  <DefaultFoldButton
50
78
  label={isUnfolded ? 'Меньше фильтров' : 'Больше фильтров'}
@@ -59,6 +87,15 @@ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
59
87
  <Icon name="CloseIcon" size="small" />
60
88
  </Button>
61
89
  </div>
90
+ <div>
91
+ <FoldableSection isUnfolded={isUnfolded}>
92
+ {renderFoldableSubsection('Драгоценные металлы', hiddenPreciousMetalsFilters)}
93
+ {renderFoldableSubsection(
94
+ 'Специальные возможности',
95
+ hiddenDisabledServiceFilters,
96
+ )}
97
+ </FoldableSection>
98
+ </div>
62
99
  </Foldable>
63
100
  </div>
64
101
  ) : null}
@@ -66,3 +103,45 @@ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
66
103
  );
67
104
  },
68
105
  );
106
+
107
+ const getFilters = ({ onlyOffice = false, filtersCheckbox = [] }: getFilterProps) => {
108
+ return onlyOffice ? getOfficeFilters(filtersCheckbox) : getAtmsFilters(filtersCheckbox);
109
+ };
110
+
111
+ const getOfficeFilters = (filtersCheckbox: filtersCheckboxType[]) => {
112
+ const visibleFilters: filtersCheckboxType[] = [];
113
+ const preciousMetalsFilters: filtersCheckboxType[] = [];
114
+ const disabledServiceFilters: filtersCheckboxType[] = [];
115
+
116
+ for (const item of filtersCheckbox) {
117
+ if (VISIBLE_FILTERS.includes(item.key)) {
118
+ visibleFilters.push(item);
119
+ }
120
+ if (PRECIOUS_METALS_FILTERS.includes(item.key)) {
121
+ preciousMetalsFilters.push(item);
122
+ }
123
+ if (DISABLED_SERVICE_FILTERS.includes(item.key)) {
124
+ disabledServiceFilters.push(item);
125
+ }
126
+ }
127
+
128
+ return [visibleFilters, preciousMetalsFilters, disabledServiceFilters];
129
+ };
130
+
131
+ const getAtmsFilters = (filtersCheckbox: filtersCheckboxType[]) => [
132
+ filtersCheckbox.slice(0, VISIBLE_ATMS_FILTERS_NUM),
133
+ filtersCheckbox.slice(VISIBLE_ATMS_FILTERS_NUM),
134
+ ];
135
+
136
+ const renderFoldableSubsection = (text: string, filters: filtersCheckboxType[] = []) => {
137
+ return (
138
+ <div>
139
+ {filters.length > 0 ? (
140
+ <div className="space-y-s">
141
+ <Text>{text}</Text>
142
+ <div className={COMMON_FILTERS_STYLES}>{filters}</div>
143
+ </div>
144
+ ) : null}
145
+ </div>
146
+ );
147
+ };
@@ -82,6 +82,12 @@ export interface Branch {
82
82
  preciousMetalsOperations?: false;
83
83
  transferringDataToBiometricSystem?: false;
84
84
  serviceDisabledPeople?: false;
85
+ hasAccessibilitySign?: boolean;
86
+ equippedWithRamp?: boolean;
87
+ equippedWithLift?: boolean;
88
+ equippedWithElevator?: boolean;
89
+ equippedWithStairclimber?: boolean;
90
+ hasHelpMeButton?: boolean;
85
91
  }
86
92
 
87
93
  export interface RemoteWorkplace extends DescriptionProps {
@@ -18,6 +18,12 @@ export const INITIAL_FILTRATION_STATE = {
18
18
  bullionOperations: false,
19
19
  preciousMetalsOperations: false,
20
20
  transferringDataToBiometricSystem: false,
21
+ hasAccessibilitySign: false,
22
+ equippedWithRamp: false,
23
+ equippedWithLift: false,
24
+ equippedWithElevator: false,
25
+ equippedWithStairclimber: false,
26
+ hasHelpMeButton: false,
21
27
  ...ATMS_INITIAL_FILTRATION_STATE,
22
28
  };
23
29
 
@@ -39,6 +45,12 @@ export const FILTRATION_LABELS = {
39
45
  serviceDisabledPeople: 'Для маломобильных граждан',
40
46
  workAllTime: 'Круглосуточно',
41
47
  workingSaturday: 'Открыты по субботам',
48
+ hasAccessibilitySign: 'Без барьеров',
49
+ equippedWithRamp: 'Есть пандус',
50
+ equippedWithLift: 'Есть подъёмник',
51
+ equippedWithElevator: 'Есть лифт',
52
+ equippedWithStairclimber: 'Есть лестницеход',
53
+ hasHelpMeButton: 'Есть кнопка «HELP ME»',
42
54
  };
43
55
 
44
56
  const FILTRATION_PREDICATES_ATMS = {
@@ -71,4 +83,16 @@ export const FILTRATION_PREDICATES = {
71
83
  Boolean('preciousMetalsOperations' in item && item.preciousMetalsOperations),
72
84
  transferringDataToBiometricSystem: (item: Branch | RemoteWorkplace) =>
73
85
  Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
86
+ hasAccessibilitySign: (item: Branch | RemoteWorkplace) =>
87
+ Boolean('hasAccessibilitySign' in item && item.hasAccessibilitySign),
88
+ equippedWithRamp: (item: Branch | RemoteWorkplace) =>
89
+ Boolean('equippedWithRamp' in item && item.equippedWithRamp),
90
+ equippedWithLift: (item: Branch | RemoteWorkplace) =>
91
+ Boolean('equippedWithLift' in item && item.equippedWithLift),
92
+ equippedWithElevator: (item: Branch | RemoteWorkplace) =>
93
+ Boolean('equippedWithElevator' in item && item.equippedWithElevator),
94
+ equippedWithStairclimber: (item: Branch | RemoteWorkplace) =>
95
+ Boolean('equippedWithStairclimber' in item && item.equippedWithStairclimber),
96
+ hasHelpMeButton: (item: Branch | RemoteWorkplace) =>
97
+ Boolean('hasHelpMeButton' in item && item.hasHelpMeButton),
74
98
  };