@redneckz/wildless-cms-uni-blocks 0.14.288 → 0.14.290

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 (261) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +95 -85
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
  5. package/bundle/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
  6. package/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
  7. package/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
  8. package/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
  9. package/bundle/components/LinkDocs/LinkDocsContent.d.ts +2 -1
  10. package/bundle/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
  11. package/bundle/data/SitemapData.d.ts +5 -5
  12. package/bundle/hooks/useAspects/handleAspects.d.ts +10 -0
  13. package/bundle/hooks/useForm.d.ts +4 -4
  14. package/bundle/model/AspectsProps.d.ts +4 -4
  15. package/bundle/model/LinkProps.d.ts +2 -3
  16. package/bundle/model/LogoType.d.ts +1 -3
  17. package/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
  18. package/bundle/utils/dataAttributes.d.ts +2 -2
  19. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -6
  20. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  21. package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
  22. package/dist/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
  23. package/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  24. package/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
  25. package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  26. package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
  27. package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
  28. package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
  29. package/dist/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
  30. package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  31. package/dist/components/LinkDocs/LinkDocItem.js +3 -2
  32. package/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
  33. package/dist/components/LinkDocs/LinkDocs.js +1 -1
  34. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  35. package/dist/components/LinkDocs/LinkDocsContent.d.ts +2 -1
  36. package/dist/components/LinkDocs/linkDocsContentExample.js +8 -0
  37. package/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
  38. package/dist/components/TabsLayout/TabsLayoutButton.js +2 -1
  39. package/dist/components/TabsLayout/TabsLayoutButton.js.map +1 -1
  40. package/dist/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
  41. package/dist/data/SitemapData.d.ts +5 -5
  42. package/dist/hooks/useAspects/applyAspects.js +2 -3
  43. package/dist/hooks/useAspects/applyAspects.js.map +1 -1
  44. package/dist/hooks/useAspects/handleAspects.d.ts +10 -0
  45. package/dist/hooks/useAspects/handleAspects.js +10 -0
  46. package/dist/hooks/useAspects/handleAspects.js.map +1 -0
  47. package/dist/hooks/useForm.d.ts +4 -4
  48. package/dist/hooks/useForm.js +4 -4
  49. package/dist/hooks/useForm.js.map +1 -1
  50. package/dist/model/AspectsProps.d.ts +4 -4
  51. package/dist/model/LinkProps.d.ts +2 -3
  52. package/dist/model/LogoType.d.ts +1 -3
  53. package/dist/ui-kit/InputRange/InputRange.js +2 -2
  54. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  55. package/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
  56. package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  57. package/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
  58. package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  59. package/dist/ui-kit/PhoneInput/PhoneInput.js +1 -1
  60. package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  61. package/dist/utils/dataAttributes.d.ts +2 -2
  62. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +14 -7
  63. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  64. package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
  65. package/lib/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
  66. package/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  67. package/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
  68. package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  69. package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
  70. package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
  71. package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
  72. package/lib/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
  73. package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  74. package/lib/components/LinkDocs/LinkDocItem.js +3 -2
  75. package/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
  76. package/lib/components/LinkDocs/LinkDocs.js +1 -1
  77. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  78. package/lib/components/LinkDocs/LinkDocsContent.d.ts +2 -1
  79. package/lib/components/LinkDocs/linkDocsContentExample.js +8 -0
  80. package/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
  81. package/lib/components/TabsLayout/TabsLayoutButton.js +2 -1
  82. package/lib/components/TabsLayout/TabsLayoutButton.js.map +1 -1
  83. package/lib/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
  84. package/lib/data/SitemapData.d.ts +5 -5
  85. package/lib/hooks/useAspects/applyAspects.js +2 -3
  86. package/lib/hooks/useAspects/applyAspects.js.map +1 -1
  87. package/lib/hooks/useAspects/handleAspects.d.ts +10 -0
  88. package/lib/hooks/useAspects/handleAspects.js +7 -0
  89. package/lib/hooks/useAspects/handleAspects.js.map +1 -0
  90. package/lib/hooks/useForm.d.ts +4 -4
  91. package/lib/hooks/useForm.js +4 -4
  92. package/lib/hooks/useForm.js.map +1 -1
  93. package/lib/model/AspectsProps.d.ts +4 -4
  94. package/lib/model/LinkProps.d.ts +2 -3
  95. package/lib/model/LogoType.d.ts +1 -3
  96. package/lib/ui-kit/InputRange/InputRange.js +2 -2
  97. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  98. package/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
  99. package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  100. package/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
  101. package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  102. package/lib/ui-kit/PhoneInput/PhoneInput.js +1 -1
  103. package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  104. package/lib/utils/dataAttributes.d.ts +2 -2
  105. package/mobile/bundle/bundle.umd.js +93 -83
  106. package/mobile/bundle/bundle.umd.min.js +1 -1
  107. package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
  108. package/mobile/bundle/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
  109. package/mobile/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
  110. package/mobile/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
  111. package/mobile/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
  112. package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +2 -1
  113. package/mobile/bundle/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
  114. package/mobile/bundle/data/SitemapData.d.ts +5 -5
  115. package/mobile/bundle/hooks/useAspects/handleAspects.d.ts +10 -0
  116. package/mobile/bundle/hooks/useForm.d.ts +4 -4
  117. package/mobile/bundle/model/AspectsProps.d.ts +4 -4
  118. package/mobile/bundle/model/LinkProps.d.ts +2 -3
  119. package/mobile/bundle/model/LogoType.d.ts +1 -3
  120. package/mobile/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
  121. package/mobile/bundle/utils/dataAttributes.d.ts +2 -2
  122. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -6
  123. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  124. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
  125. package/mobile/dist/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
  126. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  127. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
  128. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  129. package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
  130. package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
  131. package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
  132. package/mobile/dist/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
  133. package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  134. package/mobile/dist/components/LinkDocs/LinkDocItem.js +3 -2
  135. package/mobile/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
  136. package/mobile/dist/components/LinkDocs/LinkDocs.js +1 -1
  137. package/mobile/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  138. package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +2 -1
  139. package/mobile/dist/components/LinkDocs/linkDocsContentExample.js +8 -0
  140. package/mobile/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
  141. package/mobile/dist/components/TabsLayout/TabsLayoutButton.js +2 -1
  142. package/mobile/dist/components/TabsLayout/TabsLayoutButton.js.map +1 -1
  143. package/mobile/dist/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
  144. package/mobile/dist/data/SitemapData.d.ts +5 -5
  145. package/mobile/dist/hooks/useAspects/applyAspects.js +2 -3
  146. package/mobile/dist/hooks/useAspects/applyAspects.js.map +1 -1
  147. package/mobile/dist/hooks/useAspects/handleAspects.d.ts +10 -0
  148. package/mobile/dist/hooks/useAspects/handleAspects.js +10 -0
  149. package/mobile/dist/hooks/useAspects/handleAspects.js.map +1 -0
  150. package/mobile/dist/hooks/useForm.d.ts +4 -4
  151. package/mobile/dist/hooks/useForm.js +4 -4
  152. package/mobile/dist/hooks/useForm.js.map +1 -1
  153. package/mobile/dist/model/AspectsProps.d.ts +4 -4
  154. package/mobile/dist/model/LinkProps.d.ts +2 -3
  155. package/mobile/dist/model/LogoType.d.ts +1 -3
  156. package/mobile/dist/ui-kit/InputRange/InputRange.js +2 -2
  157. package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  158. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
  159. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  160. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
  161. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  162. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +1 -1
  163. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  164. package/mobile/dist/utils/dataAttributes.d.ts +2 -2
  165. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +14 -7
  166. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  167. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
  168. package/mobile/lib/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
  169. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  170. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
  171. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  172. package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
  173. package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
  174. package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
  175. package/mobile/lib/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
  176. package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  177. package/mobile/lib/components/LinkDocs/LinkDocItem.js +3 -2
  178. package/mobile/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
  179. package/mobile/lib/components/LinkDocs/LinkDocs.js +1 -1
  180. package/mobile/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  181. package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +2 -1
  182. package/mobile/lib/components/LinkDocs/linkDocsContentExample.js +8 -0
  183. package/mobile/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
  184. package/mobile/lib/components/TabsLayout/TabsLayoutButton.js +2 -1
  185. package/mobile/lib/components/TabsLayout/TabsLayoutButton.js.map +1 -1
  186. package/mobile/lib/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
  187. package/mobile/lib/data/SitemapData.d.ts +5 -5
  188. package/mobile/lib/hooks/useAspects/applyAspects.js +2 -3
  189. package/mobile/lib/hooks/useAspects/applyAspects.js.map +1 -1
  190. package/mobile/lib/hooks/useAspects/handleAspects.d.ts +10 -0
  191. package/mobile/lib/hooks/useAspects/handleAspects.js +7 -0
  192. package/mobile/lib/hooks/useAspects/handleAspects.js.map +1 -0
  193. package/mobile/lib/hooks/useForm.d.ts +4 -4
  194. package/mobile/lib/hooks/useForm.js +4 -4
  195. package/mobile/lib/hooks/useForm.js.map +1 -1
  196. package/mobile/lib/model/AspectsProps.d.ts +4 -4
  197. package/mobile/lib/model/LinkProps.d.ts +2 -3
  198. package/mobile/lib/model/LogoType.d.ts +1 -3
  199. package/mobile/lib/ui-kit/InputRange/InputRange.js +2 -2
  200. package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  201. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
  202. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  203. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
  204. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  205. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +1 -1
  206. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  207. package/mobile/lib/utils/dataAttributes.d.ts +2 -2
  208. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +0 -1
  209. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +31 -16
  210. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +12 -5
  211. package/mobile/src/components/ApplicationFormCustom/getFormatData.tsx +6 -5
  212. package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +4 -0
  213. package/mobile/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.tsx +2 -1
  214. package/mobile/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +7 -5
  215. package/mobile/src/components/Header/HeaderSecondaryMenuButton.tsx +1 -2
  216. package/mobile/src/components/LinkDocs/LinkDocItem.tsx +4 -1
  217. package/mobile/src/components/LinkDocs/LinkDocs.tsx +1 -0
  218. package/mobile/src/components/LinkDocs/LinkDocsContent.ts +6 -4
  219. package/mobile/src/components/LinkDocs/linkDocsContentExample.ts +8 -0
  220. package/mobile/src/components/TabsLayout/TabsLayoutButton.tsx +3 -0
  221. package/mobile/src/components/TabsLayout/TabsLayoutContent.ts +3 -1
  222. package/mobile/src/data/SitemapData.ts +5 -5
  223. package/mobile/src/hooks/useAspects/applyAspects.ts +2 -4
  224. package/mobile/src/hooks/useAspects/handleAspects.ts +18 -0
  225. package/mobile/src/hooks/useForm.ts +12 -6
  226. package/mobile/src/model/AspectsProps.ts +4 -4
  227. package/mobile/src/model/LinkProps.ts +2 -3
  228. package/mobile/src/model/LogoType.ts +1 -1
  229. package/mobile/src/ui-kit/InputRange/InputRange.tsx +2 -2
  230. package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -2
  231. package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +1 -2
  232. package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +2 -2
  233. package/mobile/src/utils/dataAttributes.ts +2 -2
  234. package/package.json +1 -1
  235. package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +0 -1
  236. package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +31 -16
  237. package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +12 -5
  238. package/src/components/ApplicationFormCustom/getFormatData.tsx +6 -5
  239. package/src/components/ApplicationFormCustom/getInitialFormState.tsx +4 -0
  240. package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.fixture.tsx +8 -0
  241. package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.tsx +2 -1
  242. package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +7 -5
  243. package/src/components/Header/HeaderSecondaryMenuButton.tsx +1 -2
  244. package/src/components/LinkDocs/LinkDocItem.tsx +4 -1
  245. package/src/components/LinkDocs/LinkDocs.tsx +1 -0
  246. package/src/components/LinkDocs/LinkDocsContent.ts +6 -4
  247. package/src/components/LinkDocs/linkDocsContentExample.ts +8 -0
  248. package/src/components/TabsLayout/TabsLayoutButton.tsx +3 -0
  249. package/src/components/TabsLayout/TabsLayoutContent.ts +3 -1
  250. package/src/data/SitemapData.ts +5 -5
  251. package/src/hooks/useAspects/applyAspects.ts +2 -4
  252. package/src/hooks/useAspects/handleAspects.ts +18 -0
  253. package/src/hooks/useForm.ts +12 -6
  254. package/src/model/AspectsProps.ts +4 -4
  255. package/src/model/LinkProps.ts +2 -3
  256. package/src/model/LogoType.ts +1 -1
  257. package/src/ui-kit/InputRange/InputRange.tsx +2 -2
  258. package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -2
  259. package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +1 -2
  260. package/src/ui-kit/PhoneInput/PhoneInput.tsx +2 -2
  261. package/src/utils/dataAttributes.ts +2 -2
@@ -889,9 +889,76 @@
889
889
  : { secondaryPhoneNumber: formatPhone(secondaryPhone) };
890
890
  };
891
891
 
892
+ const handleAspects = ({ aspectsAttributes, aspects, ev, formData }) => {
893
+ for (const { aspectName, params } of aspectsAttributes) {
894
+ const paramsData = aspectName === 'mindboxEvent' ? { ...params, eventJson: JSON.stringify(formData) } : params;
895
+ aspects[aspectName ?? '']?.(ev, paramsData);
896
+ }
897
+ };
898
+
899
+ const QUERY_STORAGE_KEY = 'rshb-query-params';
900
+ function saveSessionQuery() {
901
+ const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
902
+ if (result) {
903
+ globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
904
+ }
905
+ return result;
906
+ }
907
+
908
+ const adjustSessionQuery = (href) => {
909
+ const sessionQuery = saveSessionQuery();
910
+ if (!isURL(href) || !sessionQuery) {
911
+ return href;
912
+ }
913
+ const url = new URL(href);
914
+ for (const [key, value] of new URLSearchParams(sessionQuery)) {
915
+ url.searchParams.set(key, value);
916
+ }
917
+ return url.toString();
918
+ };
919
+
920
+ const tableFunc = (table) => (input) => {
921
+ const [, output] = table.find(([predicate]) => predicate(input)) || [];
922
+ return output;
923
+ };
924
+
925
+ const forwardQuery = (ev) => {
926
+ const anchor = ev.target?.closest('a');
927
+ if (isURL(anchor?.href) && !anchor?.href?.startsWith(globalThis.location?.origin)) {
928
+ ev.preventDefault();
929
+ ev.stopPropagation();
930
+ const url = adjustSessionQuery(anchor?.href) || anchor?.href;
931
+ if (url) {
932
+ const transition = getTransition(anchor?.target);
933
+ transition?.(url);
934
+ }
935
+ }
936
+ };
937
+ const getTransition = tableFunc([
938
+ [(_) => _ === '_blank', (url) => globalThis.open(url, '_blank')],
939
+ [(_) => _ === '_parent', (url) => globalThis.parent && (globalThis.parent.location.href = url)],
940
+ [
941
+ (_) => _ === '_top',
942
+ (url) => {
943
+ globalThis.top && (globalThis.top.location.href = url);
944
+ },
945
+ ],
946
+ [() => true, (url) => globalThis.location && (globalThis.location.href = url)],
947
+ ]);
948
+
949
+ function useAspects() {
950
+ return useAspects._impl();
951
+ }
952
+ useAspects._impl = () => ({
953
+ forwardQuery,
954
+ });
955
+ useAspects.setup = (impl) => {
956
+ useAspects._impl = impl;
957
+ };
958
+
892
959
  const identity = (_) => _;
893
960
 
894
- const useForm = (initialState, { resetOnSubmit, onSubmit } = {}) => {
961
+ const useForm = (initialState, { resetOnSubmit, onSubmit, } = {}) => {
895
962
  const [formState, setFormState] = useState(initialState);
896
963
  const [isDirtyForm, setDirtyForm] = useState(false);
897
964
  const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
@@ -920,10 +987,10 @@
920
987
  setDirtyForm(false);
921
988
  setDirtyFieldsMap({});
922
989
  }, [initialState]);
923
- const handleSubmit = useCallback((e) => {
924
- e.preventDefault();
990
+ const handleSubmit = useCallback((ev) => {
991
+ ev.preventDefault();
925
992
  resetOnSubmit ? reset() : setDirtyForm(true);
926
- onSubmit && onSubmit(formState);
993
+ onSubmit && onSubmit(formState, ev);
927
994
  }, [onSubmit, formState]);
928
995
  return [
929
996
  formState,
@@ -1291,7 +1358,7 @@
1291
1358
  const handleBlur = useCallback((v) => {
1292
1359
  v === '+7 (' ? onChange && onChange('') : null;
1293
1360
  }, []);
1294
- return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (e) => handleChange(e?.target?.value || ''), onBlur: (e) => handleBlur(e?.target?.value || ''), children: children }));
1361
+ return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
1295
1362
  });
1296
1363
 
1297
1364
  const InputPhoneControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
@@ -1508,8 +1575,8 @@
1508
1575
  const inputStyle = {
1509
1576
  backgroundSize: `${percentage.toFixed(2)}% 100%`,
1510
1577
  };
1511
- return (jsxs("div", { children: [list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-m", children: list.map((_, i) => (jsx("div", { className: style('w-2 h-2 rounded-full', rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main') }, String(i)))) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-m leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", style: inputStyle, type: "range", min: min, max: max, step: step, value: rangeValue, disabled: disabled, onInput: ((e) => {
1512
- const rawValue = parseDecimal(e.target?.value);
1578
+ return (jsxs("div", { children: [list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-m", children: list.map((_, i) => (jsx("div", { className: style('w-2 h-2 rounded-full', rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main') }, String(i)))) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-m leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", style: inputStyle, type: "range", min: min, max: max, step: step, value: rangeValue, disabled: disabled, onInput: ((ev) => {
1579
+ const rawValue = parseDecimal(ev.target?.value);
1513
1580
  const newValue = list.length ? list[rawValue] : rawValue;
1514
1581
  onChange && onChange(newValue || 0);
1515
1582
  }) }) })] }));
@@ -1524,8 +1591,8 @@
1524
1591
  normalize: (_ = 0) => list.length ? closestValue(list)(_) : clamp(_, min, max),
1525
1592
  format: toLocalNumberFormat(),
1526
1593
  });
1527
- const handleChange = useCallback((e) => {
1528
- onChange && onChange(parseDecimal(e.target?.value));
1594
+ const handleChange = useCallback((ev) => {
1595
+ onChange && onChange(parseDecimal(ev.target?.value));
1529
1596
  }, [onChange]);
1530
1597
  return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? (jsx(Text, { size: "text-m", font: "font-light", color: "text-primary-text", children: title })) : null, jsx("input", { className: style('mt-xs font-sans text-h3 w-full h-14', 'border border-solid border-gray rounded-md outline-none', 'pl-m box-border', 'text-primary-text hover:border-primary-hover focus:border-primary-text', DISABLED_INPUT_CLASSES), disabled: disabled, onInput: handleChange, ...normalizedProps }), renderRangeWithTicks({ list, min, max, step, disabled, value, onChange })] }), renderRangeCaption(items)] }));
1531
1598
  });
@@ -1792,19 +1859,23 @@
1792
1859
  const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), jsxs("div", { className: "flex gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
1793
1860
 
1794
1861
  const API = LeadServiceAPI();
1795
- const ApplicationFormCustom = JSX(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, ...rest }) => {
1862
+ const ApplicationFormCustom = JSX(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, ...rest }) => {
1796
1863
  const inputs = (sections?.flatMap((_) => _?.inputs) || []);
1797
1864
  const initialFormState = getInitialFormState(inputs, typeForm);
1798
1865
  const [responseType, setResponseType] = useState('');
1799
- const handleSubmit = useCallback(async (data) => {
1800
- const inputsFiltered = getFilteredInputs(inputs, data);
1866
+ const handleSubmit = useCallback(async (formData, ev) => {
1867
+ const inputsFiltered = getFilteredInputs(inputs, formData);
1801
1868
  const feedbackValidator = objectValidator(getObjectValidator(inputsFiltered));
1802
- if (!isValidationSuccess(feedbackValidator(data))) {
1869
+ if (!isValidationSuccess(feedbackValidator(formData))) {
1803
1870
  return 'Fail';
1804
1871
  }
1805
- const formatData = getFormatData({ ...data, ...additionalParams });
1872
+ const formatData = getFormatData({ ...formData, ...additionalParams });
1806
1873
  const status = (await API.send(formatData, endpoint === 'lead')) ? 'OK' : 'Fail';
1807
1874
  setResponseType(status);
1875
+ if (status === 'OK' && data) {
1876
+ const aspects = useAspects();
1877
+ handleAspects({ aspectsAttributes: data, aspects, ev, formData: formatData });
1878
+ }
1808
1879
  return status;
1809
1880
  }, []);
1810
1881
  const [, { field, onSubmit, reset }] = useForm(initialFormState, { onSubmit: handleSubmit });
@@ -1814,8 +1885,9 @@
1814
1885
  reset();
1815
1886
  }
1816
1887
  }, [responseType]);
1817
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, responseType: responseType, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [_?.title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: _.title }) })) : null, (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
1888
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, responseType: responseType, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
1818
1889
  });
1890
+ const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
1819
1891
  const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
1820
1892
  const getConsentDataProcessing = (inputs) => inputs?.find((_) => _?.name === 'consentDataProcessing');
1821
1893
  const getFilteredInputs = (inputs, data) => inputs
@@ -3505,11 +3577,6 @@
3505
3577
  };
3506
3578
  const formatValue = (value) => value.replace(/[^\d.,]/g, '').replace(',', '.');
3507
3579
 
3508
- const tableFunc = (table) => (input) => {
3509
- const [, output] = table.find(([predicate]) => predicate(input)) || [];
3510
- return output;
3511
- };
3512
-
3513
3580
  const callbackCurrencySelect = (props) => tableFunc([
3514
3581
  [
3515
3582
  (_) => _.value !== Currency.RUB && _.oppositeValue !== Currency.RUB,
@@ -3815,11 +3882,11 @@
3815
3882
  return `${parseFloat((bytes / Math.pow(KILO, i)).toFixed(decimals))} ${KILO_SIZES[i]}`;
3816
3883
  };
3817
3884
 
3818
- const LinkDocItem = JSX(({ icon, text, href, target, fileFormat, fileSize }) => {
3885
+ const LinkDocItem = JSX(({ icon, text, href, target, fileFormat, data, fileSize }) => {
3819
3886
  const prefix = fileSize && fileFormat ? ',' : '';
3820
3887
  const size = fileSize ?? '';
3821
3888
  const format = fileFormat ? String(fileFormat) : '';
3822
- return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, " ", addSpace(size, format), jsx(Text, { color: "text-secondary-text", children: href && `${size + prefix + format}` })] })) : null] }));
3889
+ return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", href: href, target: target, ...getAspectsAttributes(data), children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, " ", addSpace(size, format), jsx(Text, { color: "text-secondary-text", children: href && `${size + prefix + format}` })] })) : null] }));
3823
3890
  });
3824
3891
  const addSpace = (size, format) => (size || format ? jsx("span", { children: ",\u00A0" }) : '');
3825
3892
 
@@ -3842,7 +3909,7 @@
3842
3909
  ? formatBytes(docBlockDef?.attachment?.fileSize || 0)
3843
3910
  : docBlockDef?.fileSize;
3844
3911
  const fileFormat = docBlockDef?.docType === 'Attachment' ? getExtFromHref(href) : docBlockDef?.fileFormat;
3845
- return (jsx("div", { role: "listitem", children: jsx(LinkDocItem, { text: docBlockDef?.text, target: docBlockDef?.target, href: href, fileFormat: fileFormat, fileSize: fileSize, icon: icon ? jsx(Img, { className: linkIconStyle, image: icon, width: "24", height: "24" }) : null }) }, String(i)));
3912
+ return (jsx("div", { role: "listitem", children: jsx(LinkDocItem, { text: docBlockDef?.text, target: docBlockDef?.target, href: href, fileFormat: fileFormat, fileSize: fileSize, icon: icon ? jsx(Img, { className: linkIconStyle, image: icon, width: "24", height: "24" }) : null, data: docBlockDef?.data }) }, String(i)));
3846
3913
  };
3847
3914
  const getExtFromHref = (href) => {
3848
3915
  if (!href) {
@@ -5176,7 +5243,7 @@
5176
5243
  });
5177
5244
  const TabsLayoutButton = JSX(({ tab, className, onClick, isActive }) => {
5178
5245
  const buttonClassNames = getButtonClassNames(isActive);
5179
- return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: style('border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs', buttonClassNames.btn, className), children: [tab?.icon ? (jsx(Img, { className: style('h-6 w-6 min-w-6 min-h-6', buttonClassNames.icon), image: {
5246
+ return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: style('border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs', buttonClassNames.btn, className), ...getAspectsAttributes(tab?.data), children: [tab?.icon ? (jsx(Img, { className: style('h-6 w-6 min-w-6 min-h-6', buttonClassNames.icon), image: {
5180
5247
  ...tab?.icon,
5181
5248
  iconVersion: tab?.icon?.iconVersion ?? buttonClassNames.iconVersion,
5182
5249
  }, width: "24", height: "24" })) : null, jsxs("div", { className: "border-0", children: [tab?.title ? jsx("div", { className: buttonClassNames.title, children: tab.title }) : null, tab?.description ? jsx("div", { className: buttonClassNames.desc, children: tab.description }) : null] })] }));
@@ -5456,22 +5523,11 @@
5456
5523
  VerticalLayout,
5457
5524
  };
5458
5525
 
5459
- const QUERY_STORAGE_KEY = 'rshb-query-params';
5460
- function saveSessionQuery() {
5461
- const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
5462
- if (result) {
5463
- globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
5464
- }
5465
- return result;
5466
- }
5467
-
5468
5526
  const applyAspects = (aspects) => (ev) => {
5469
5527
  const element = ev.target?.closest('[data-aspects]');
5470
5528
  try {
5471
5529
  const aspectsAttributes = JSON.parse(element?.dataset?.aspects ?? '[]');
5472
- for (const { aspectName, params } of aspectsAttributes) {
5473
- aspects[aspectName ?? '']?.(ev, params);
5474
- }
5530
+ handleAspects({ aspectsAttributes, aspects, ev });
5475
5531
  }
5476
5532
  catch (_) {
5477
5533
  // Do nothing
@@ -5480,52 +5536,6 @@
5480
5536
  aspects.forwardQuery?.(ev);
5481
5537
  };
5482
5538
 
5483
- const adjustSessionQuery = (href) => {
5484
- const sessionQuery = saveSessionQuery();
5485
- if (!isURL(href) || !sessionQuery) {
5486
- return href;
5487
- }
5488
- const url = new URL(href);
5489
- for (const [key, value] of new URLSearchParams(sessionQuery)) {
5490
- url.searchParams.set(key, value);
5491
- }
5492
- return url.toString();
5493
- };
5494
-
5495
- const forwardQuery = (ev) => {
5496
- const anchor = ev.target?.closest('a');
5497
- if (isURL(anchor?.href) && !anchor?.href?.startsWith(globalThis.location?.origin)) {
5498
- ev.preventDefault();
5499
- ev.stopPropagation();
5500
- const url = adjustSessionQuery(anchor?.href) || anchor?.href;
5501
- if (url) {
5502
- const transition = getTransition(anchor?.target);
5503
- transition?.(url);
5504
- }
5505
- }
5506
- };
5507
- const getTransition = tableFunc([
5508
- [(_) => _ === '_blank', (url) => globalThis.open(url, '_blank')],
5509
- [(_) => _ === '_parent', (url) => globalThis.parent && (globalThis.parent.location.href = url)],
5510
- [
5511
- (_) => _ === '_top',
5512
- (url) => {
5513
- globalThis.top && (globalThis.top.location.href = url);
5514
- },
5515
- ],
5516
- [() => true, (url) => globalThis.location && (globalThis.location.href = url)],
5517
- ]);
5518
-
5519
- function useAspects() {
5520
- return useAspects._impl();
5521
- }
5522
- useAspects._impl = () => ({
5523
- forwardQuery,
5524
- });
5525
- useAspects.setup = (impl) => {
5526
- useAspects._impl = impl;
5527
- };
5528
-
5529
5539
  const useClickHandler = handlerDecorator(() => {
5530
5540
  useEffect(() => {
5531
5541
  saveSessionQuery(); //? Call first time for save query in sessionStorage
@@ -5641,7 +5651,7 @@
5641
5651
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
5642
5652
  });
5643
5653
 
5644
- const packageVersion = "0.14.287";
5654
+ const packageVersion = "0.14.289";
5645
5655
 
5646
5656
  exports.Blocks = Blocks;
5647
5657
  exports.ContentPage = ContentPage;