@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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +95 -85
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
- package/bundle/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
- package/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
- package/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
- package/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +2 -1
- package/bundle/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
- package/bundle/data/SitemapData.d.ts +5 -5
- package/bundle/hooks/useAspects/handleAspects.d.ts +10 -0
- package/bundle/hooks/useForm.d.ts +4 -4
- package/bundle/model/AspectsProps.d.ts +4 -4
- package/bundle/model/LinkProps.d.ts +2 -3
- package/bundle/model/LogoType.d.ts +1 -3
- package/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
- package/bundle/utils/dataAttributes.d.ts +2 -2
- package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -6
- package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
- package/dist/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
- package/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
- package/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
- package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
- package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
- package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
- package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocItem.js +3 -2
- package/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.js +1 -1
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +2 -1
- package/dist/components/LinkDocs/linkDocsContentExample.js +8 -0
- package/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayoutButton.js +2 -1
- package/dist/components/TabsLayout/TabsLayoutButton.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
- package/dist/data/SitemapData.d.ts +5 -5
- package/dist/hooks/useAspects/applyAspects.js +2 -3
- package/dist/hooks/useAspects/applyAspects.js.map +1 -1
- package/dist/hooks/useAspects/handleAspects.d.ts +10 -0
- package/dist/hooks/useAspects/handleAspects.js +10 -0
- package/dist/hooks/useAspects/handleAspects.js.map +1 -0
- package/dist/hooks/useForm.d.ts +4 -4
- package/dist/hooks/useForm.js +4 -4
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/model/AspectsProps.d.ts +4 -4
- package/dist/model/LinkProps.d.ts +2 -3
- package/dist/model/LogoType.d.ts +1 -3
- package/dist/ui-kit/InputRange/InputRange.js +2 -2
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
- package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/dist/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/utils/dataAttributes.d.ts +2 -2
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +14 -7
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
- package/lib/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
- package/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
- package/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
- package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
- package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
- package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
- package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocItem.js +3 -2
- package/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocs.js +1 -1
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +2 -1
- package/lib/components/LinkDocs/linkDocsContentExample.js +8 -0
- package/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayoutButton.js +2 -1
- package/lib/components/TabsLayout/TabsLayoutButton.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
- package/lib/data/SitemapData.d.ts +5 -5
- package/lib/hooks/useAspects/applyAspects.js +2 -3
- package/lib/hooks/useAspects/applyAspects.js.map +1 -1
- package/lib/hooks/useAspects/handleAspects.d.ts +10 -0
- package/lib/hooks/useAspects/handleAspects.js +7 -0
- package/lib/hooks/useAspects/handleAspects.js.map +1 -0
- package/lib/hooks/useForm.d.ts +4 -4
- package/lib/hooks/useForm.js +4 -4
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/model/AspectsProps.d.ts +4 -4
- package/lib/model/LinkProps.d.ts +2 -3
- package/lib/model/LogoType.d.ts +1 -3
- package/lib/ui-kit/InputRange/InputRange.js +2 -2
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
- package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/lib/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/lib/utils/dataAttributes.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +93 -83
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
- package/mobile/bundle/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
- package/mobile/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
- package/mobile/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
- package/mobile/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +2 -1
- package/mobile/bundle/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
- package/mobile/bundle/data/SitemapData.d.ts +5 -5
- package/mobile/bundle/hooks/useAspects/handleAspects.d.ts +10 -0
- package/mobile/bundle/hooks/useForm.d.ts +4 -4
- package/mobile/bundle/model/AspectsProps.d.ts +4 -4
- package/mobile/bundle/model/LinkProps.d.ts +2 -3
- package/mobile/bundle/model/LogoType.d.ts +1 -3
- package/mobile/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
- package/mobile/bundle/utils/dataAttributes.d.ts +2 -2
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -6
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
- package/mobile/dist/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
- package/mobile/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
- package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
- package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocItem.js +3 -2
- package/mobile/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocs.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +2 -1
- package/mobile/dist/components/LinkDocs/linkDocsContentExample.js +8 -0
- package/mobile/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js +2 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
- package/mobile/dist/data/SitemapData.d.ts +5 -5
- package/mobile/dist/hooks/useAspects/applyAspects.js +2 -3
- package/mobile/dist/hooks/useAspects/applyAspects.js.map +1 -1
- package/mobile/dist/hooks/useAspects/handleAspects.d.ts +10 -0
- package/mobile/dist/hooks/useAspects/handleAspects.js +10 -0
- package/mobile/dist/hooks/useAspects/handleAspects.js.map +1 -0
- package/mobile/dist/hooks/useForm.d.ts +4 -4
- package/mobile/dist/hooks/useForm.js +4 -4
- package/mobile/dist/hooks/useForm.js.map +1 -1
- package/mobile/dist/model/AspectsProps.d.ts +4 -4
- package/mobile/dist/model/LinkProps.d.ts +2 -3
- package/mobile/dist/model/LogoType.d.ts +1 -3
- package/mobile/dist/ui-kit/InputRange/InputRange.js +2 -2
- package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/mobile/dist/utils/dataAttributes.d.ts +2 -2
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +14 -7
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +11 -5
- package/mobile/lib/components/ApplicationFormCustom/getFormatData.d.ts +2 -3
- package/mobile/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +4 -0
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js +2 -2
- package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.js.map +1 -1
- package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +2 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.d.ts +1 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocItem.js +3 -2
- package/mobile/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocs.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +2 -1
- package/mobile/lib/components/LinkDocs/linkDocsContentExample.js +8 -0
- package/mobile/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js +2 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutContent.d.ts +2 -1
- package/mobile/lib/data/SitemapData.d.ts +5 -5
- package/mobile/lib/hooks/useAspects/applyAspects.js +2 -3
- package/mobile/lib/hooks/useAspects/applyAspects.js.map +1 -1
- package/mobile/lib/hooks/useAspects/handleAspects.d.ts +10 -0
- package/mobile/lib/hooks/useAspects/handleAspects.js +7 -0
- package/mobile/lib/hooks/useAspects/handleAspects.js.map +1 -0
- package/mobile/lib/hooks/useForm.d.ts +4 -4
- package/mobile/lib/hooks/useForm.js +4 -4
- package/mobile/lib/hooks/useForm.js.map +1 -1
- package/mobile/lib/model/AspectsProps.d.ts +4 -4
- package/mobile/lib/model/LinkProps.d.ts +2 -3
- package/mobile/lib/model/LogoType.d.ts +1 -3
- package/mobile/lib/ui-kit/InputRange/InputRange.js +2 -2
- package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -2
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -2
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/mobile/lib/utils/dataAttributes.d.ts +2 -2
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +0 -1
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +31 -16
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +12 -5
- package/mobile/src/components/ApplicationFormCustom/getFormatData.tsx +6 -5
- package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +4 -0
- package/mobile/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.tsx +2 -1
- package/mobile/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +7 -5
- package/mobile/src/components/Header/HeaderSecondaryMenuButton.tsx +1 -2
- package/mobile/src/components/LinkDocs/LinkDocItem.tsx +4 -1
- package/mobile/src/components/LinkDocs/LinkDocs.tsx +1 -0
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +6 -4
- package/mobile/src/components/LinkDocs/linkDocsContentExample.ts +8 -0
- package/mobile/src/components/TabsLayout/TabsLayoutButton.tsx +3 -0
- package/mobile/src/components/TabsLayout/TabsLayoutContent.ts +3 -1
- package/mobile/src/data/SitemapData.ts +5 -5
- package/mobile/src/hooks/useAspects/applyAspects.ts +2 -4
- package/mobile/src/hooks/useAspects/handleAspects.ts +18 -0
- package/mobile/src/hooks/useForm.ts +12 -6
- package/mobile/src/model/AspectsProps.ts +4 -4
- package/mobile/src/model/LinkProps.ts +2 -3
- package/mobile/src/model/LogoType.ts +1 -1
- package/mobile/src/ui-kit/InputRange/InputRange.tsx +2 -2
- package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -2
- package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +1 -2
- package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +2 -2
- package/mobile/src/utils/dataAttributes.ts +2 -2
- package/package.json +1 -1
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +0 -1
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +31 -16
- package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +12 -5
- package/src/components/ApplicationFormCustom/getFormatData.tsx +6 -5
- package/src/components/ApplicationFormCustom/getInitialFormState.tsx +4 -0
- package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.fixture.tsx +8 -0
- package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupport.tsx +2 -1
- package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +7 -5
- package/src/components/Header/HeaderSecondaryMenuButton.tsx +1 -2
- package/src/components/LinkDocs/LinkDocItem.tsx +4 -1
- package/src/components/LinkDocs/LinkDocs.tsx +1 -0
- package/src/components/LinkDocs/LinkDocsContent.ts +6 -4
- package/src/components/LinkDocs/linkDocsContentExample.ts +8 -0
- package/src/components/TabsLayout/TabsLayoutButton.tsx +3 -0
- package/src/components/TabsLayout/TabsLayoutContent.ts +3 -1
- package/src/data/SitemapData.ts +5 -5
- package/src/hooks/useAspects/applyAspects.ts +2 -4
- package/src/hooks/useAspects/handleAspects.ts +18 -0
- package/src/hooks/useForm.ts +12 -6
- package/src/model/AspectsProps.ts +4 -4
- package/src/model/LinkProps.ts +2 -3
- package/src/model/LogoType.ts +1 -1
- package/src/ui-kit/InputRange/InputRange.tsx +2 -2
- package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -2
- package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +1 -2
- package/src/ui-kit/PhoneInput/PhoneInput.tsx +2 -2
- 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((
|
|
924
|
-
|
|
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: (
|
|
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: ((
|
|
1512
|
-
const rawValue = parseDecimal(
|
|
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((
|
|
1528
|
-
onChange && onChange(parseDecimal(
|
|
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 (
|
|
1800
|
-
const inputsFiltered = getFilteredInputs(inputs,
|
|
1866
|
+
const handleSubmit = useCallback(async (formData, ev) => {
|
|
1867
|
+
const inputsFiltered = getFilteredInputs(inputs, formData);
|
|
1801
1868
|
const feedbackValidator = objectValidator(getObjectValidator(inputsFiltered));
|
|
1802
|
-
if (!isValidationSuccess(feedbackValidator(
|
|
1869
|
+
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
1803
1870
|
return 'Fail';
|
|
1804
1871
|
}
|
|
1805
|
-
const formatData = getFormatData({ ...
|
|
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: [
|
|
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
|
-
|
|
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.
|
|
5654
|
+
const packageVersion = "0.14.289";
|
|
5645
5655
|
|
|
5646
5656
|
exports.Blocks = Blocks;
|
|
5647
5657
|
exports.ContentPage = ContentPage;
|