@redneckz/wildless-cms-uni-blocks 0.14.971 → 0.14.973
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/bundle.umd.js +135 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/bundle/retail/api/createUserTaskDebit.d.ts +1 -0
- package/bundle/retail/api/getClaimChannel.d.ts +8 -0
- package/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/bundle/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/bundle/retail/utils/hasDelivery.d.ts +10 -0
- package/bundle/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/bundle/utils/getSlugFromUrl.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/retail/api/createUserTaskDebit.d.ts +1 -0
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/api/getClaimChannel.d.ts +8 -0
- package/dist/retail/api/getClaimChannel.js +9 -0
- package/dist/retail/api/getClaimChannel.js.map +1 -0
- package/dist/retail/components/Fields/AddressRetailField.js +20 -0
- package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/dist/retail/components/Fields/PaymentSystemField.js +14 -2
- package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +20 -7
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js +34 -0
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/dist/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/dist/retail/utils/filterPaymentSystems.js +13 -0
- package/dist/retail/utils/filterPaymentSystems.js.map +1 -0
- package/dist/retail/utils/hasDelivery.d.ts +10 -0
- package/dist/retail/utils/hasDelivery.js +13 -0
- package/dist/retail/utils/hasDelivery.js.map +1 -0
- package/dist/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/dist/ui-kit/Select/useSelectPopup.js +1 -5
- package/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/dist/utils/getSlugFromUrl.d.ts +1 -0
- package/dist/utils/getSlugFromUrl.js +12 -0
- package/dist/utils/getSlugFromUrl.js.map +1 -0
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/retail/api/createUserTaskDebit.d.ts +1 -0
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/api/getClaimChannel.d.ts +8 -0
- package/lib/retail/api/getClaimChannel.js +6 -0
- package/lib/retail/api/getClaimChannel.js.map +1 -0
- package/lib/retail/components/Fields/AddressRetailField.js +20 -0
- package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/lib/retail/components/Fields/PaymentSystemField.js +14 -2
- package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +20 -7
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js +31 -0
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/lib/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/lib/retail/utils/filterPaymentSystems.js +10 -0
- package/lib/retail/utils/filterPaymentSystems.js.map +1 -0
- package/lib/retail/utils/hasDelivery.d.ts +10 -0
- package/lib/retail/utils/hasDelivery.js +9 -0
- package/lib/retail/utils/hasDelivery.js.map +1 -0
- package/lib/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/lib/ui-kit/Select/useSelectPopup.js +1 -5
- package/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/lib/utils/getSlugFromUrl.d.ts +1 -0
- package/lib/utils/getSlugFromUrl.js +9 -0
- package/lib/utils/getSlugFromUrl.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +135 -21
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/bundle/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/mobile/bundle/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/mobile/bundle/retail/utils/hasDelivery.d.ts +10 -0
- package/mobile/bundle/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/mobile/bundle/utils/getSlugFromUrl.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/dist/retail/api/getClaimChannel.js +9 -0
- package/mobile/dist/retail/api/getClaimChannel.js.map +1 -0
- package/mobile/dist/retail/components/Fields/AddressRetailField.js +20 -0
- package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js +14 -2
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +20 -7
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js +34 -0
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/mobile/dist/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/mobile/dist/retail/utils/filterPaymentSystems.js +13 -0
- package/mobile/dist/retail/utils/filterPaymentSystems.js.map +1 -0
- package/mobile/dist/retail/utils/hasDelivery.d.ts +10 -0
- package/mobile/dist/retail/utils/hasDelivery.js +13 -0
- package/mobile/dist/retail/utils/hasDelivery.js.map +1 -0
- package/mobile/dist/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/mobile/dist/ui-kit/Select/useSelectPopup.js +1 -5
- package/mobile/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/dist/utils/getSlugFromUrl.d.ts +1 -0
- package/mobile/dist/utils/getSlugFromUrl.js +12 -0
- package/mobile/dist/utils/getSlugFromUrl.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/lib/retail/api/getClaimChannel.js +6 -0
- package/mobile/lib/retail/api/getClaimChannel.js.map +1 -0
- package/mobile/lib/retail/components/Fields/AddressRetailField.js +20 -0
- package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js +14 -2
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +20 -7
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js +31 -0
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/mobile/lib/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/mobile/lib/retail/utils/filterPaymentSystems.js +10 -0
- package/mobile/lib/retail/utils/filterPaymentSystems.js.map +1 -0
- package/mobile/lib/retail/utils/hasDelivery.d.ts +10 -0
- package/mobile/lib/retail/utils/hasDelivery.js +9 -0
- package/mobile/lib/retail/utils/hasDelivery.js.map +1 -0
- package/mobile/lib/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/mobile/lib/ui-kit/Select/useSelectPopup.js +1 -5
- package/mobile/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/lib/utils/getSlugFromUrl.d.ts +1 -0
- package/mobile/lib/utils/getSlugFromUrl.js +9 -0
- package/mobile/lib/utils/getSlugFromUrl.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +14 -5
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +32 -3
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +6 -0
- package/mobile/src/retail/api/createUserTaskDebit.ts +1 -0
- package/mobile/src/retail/api/getClaimChannel.ts +18 -0
- package/mobile/src/retail/components/Fields/AddressRetailField.tsx +26 -0
- package/mobile/src/retail/components/Fields/CreditCalcField.tsx +1 -1
- package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +21 -2
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +22 -7
- package/mobile/src/retail/hooks/useBiblioglobusDefaultRegion.ts +56 -0
- package/mobile/src/retail/utils/filterPaymentSystems.ts +14 -0
- package/mobile/src/retail/utils/hasDelivery.ts +22 -0
- package/mobile/src/ui-kit/Select/useSelectPopup.tsx +0 -7
- package/mobile/src/utils/getSlugFromUrl.ts +10 -0
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +14 -5
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +32 -3
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +6 -0
- package/src/icons/IconName.ts +4 -4
- package/src/retail/api/createUserTaskDebit.ts +1 -0
- package/src/retail/api/getClaimChannel.ts +18 -0
- package/src/retail/components/Fields/AddressRetailField.tsx +26 -0
- package/src/retail/components/Fields/CreditCalcField.tsx +1 -1
- package/src/retail/components/Fields/PaymentSystemField.tsx +21 -2
- package/src/retail/components/Fields/RegionRetailField.tsx +22 -7
- package/src/retail/hooks/useBiblioglobusDefaultRegion.ts +56 -0
- package/src/retail/utils/filterPaymentSystems.ts +14 -0
- package/src/retail/utils/hasDelivery.ts +22 -0
- package/src/ui-kit/Select/useSelectPopup.tsx +0 -7
- package/src/utils/getSlugFromUrl.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterPaymentSystems.js","sourceRoot":"","sources":["../../../src/retail/utils/filterPaymentSystems.ts"],"names":[],"mappings":"AAEA,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAiB,EAAE,IAAmB,EAAY,EAAE;IACvF,IAAI,IAAI,KAAK,iBAAiB,EAAE;QAC9B,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
2
|
+
import { type RegionDelivery } from '../hooks/useBiblioglobusDefaultRegion';
|
|
3
|
+
export declare const getRegionDeliveryStatus: (regionsDelivery: RegionDelivery[] | undefined, value: Option) => boolean | undefined;
|
|
4
|
+
export declare const calculateRegionHasDelivery: (args: {
|
|
5
|
+
isDebit: boolean;
|
|
6
|
+
isEsiaAuth: boolean;
|
|
7
|
+
isSalaryCard: boolean;
|
|
8
|
+
isDeliveryActive: boolean;
|
|
9
|
+
regionDelivery?: boolean;
|
|
10
|
+
}) => boolean | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
|
|
2
|
+
export const calculateRegionHasDelivery = (args) => {
|
|
3
|
+
const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
|
|
4
|
+
if (isDebit) {
|
|
5
|
+
return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
|
|
6
|
+
}
|
|
7
|
+
return isDeliveryActive && regionDelivery;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=hasDelivery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasDelivery.js","sourceRoot":"","sources":["../../../src/retail/utils/hasDelivery.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,eAA6C,EAC7C,KAAa,EACb,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC;AAEnF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,IAM1C,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACrF,IAAI,OAAO,EAAE;QACX,OAAO,UAAU,IAAI,CAAC,YAAY,IAAI,gBAAgB,IAAI,cAAc,CAAC;KAC1E;IAED,OAAO,gBAAgB,IAAI,cAAc,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -2,11 +2,10 @@ import type { OnCloseProps } from '../../model/OnCloseProps';
|
|
|
2
2
|
import { type SelectPopupProps } from './SelectPopup';
|
|
3
3
|
interface SelectPopupOptions extends SelectPopupProps, OnCloseProps {
|
|
4
4
|
isOpen?: boolean;
|
|
5
|
-
onChangeQuery?: (value: string) => void;
|
|
6
5
|
disableFilterOptions?: boolean;
|
|
7
6
|
isSearch?: boolean;
|
|
8
7
|
}
|
|
9
|
-
export declare function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, disableFilterOptions, onChangeQuery, renderOptions,
|
|
8
|
+
export declare function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, disableFilterOptions, onChangeQuery, renderOptions, }: SelectPopupOptions): {
|
|
10
9
|
current: HTMLDivElement | null;
|
|
11
10
|
};
|
|
12
11
|
export {};
|
|
@@ -4,7 +4,7 @@ import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
|
|
|
4
4
|
import { noop } from '../../utils/noop.js';
|
|
5
5
|
import { usePopupManager } from '../PopupManager/usePopupManager.js';
|
|
6
6
|
import { SelectPopup } from './SelectPopup.js';
|
|
7
|
-
export function useSelectPopup({ isOpen, options, value, query, onChange = noop, onClose = noop, iconVersion, disableFilterOptions = false, onChangeQuery = noop, renderOptions,
|
|
7
|
+
export function useSelectPopup({ isOpen, options, value, query, onChange = noop, onClose = noop, iconVersion, disableFilterOptions = false, onChangeQuery = noop, renderOptions, }) {
|
|
8
8
|
const popup = usePopupManager();
|
|
9
9
|
const close = useCallback(() => {
|
|
10
10
|
popup.close();
|
|
@@ -13,11 +13,7 @@ export function useSelectPopup({ isOpen, options, value, query, onChange = noop,
|
|
|
13
13
|
const handleChange = useCallback((option) => {
|
|
14
14
|
close();
|
|
15
15
|
onChange(option);
|
|
16
|
-
onChangeQuery(isSearch && option?.text ? option.text : '');
|
|
17
16
|
}, [close, onChange]);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
onChangeQuery(isSearch && value?.text ? value.text : '');
|
|
20
|
-
}, [value]);
|
|
21
17
|
const inputRef = useRef(null);
|
|
22
18
|
const popupRef = useOutsideClick(close);
|
|
23
19
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectPopup.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/useSelectPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useSelectPopup.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/useSelectPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AAQnE,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,GAAG,IAAI,EACf,OAAO,GAAG,IAAI,EACd,WAAW,EACX,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,EACpB,aAAa,GACM;IACnB,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,MAAc,EAAE,EAAE;QACjB,KAAK,EAAE,CAAC;QACR,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EACD,CAAC,KAAK,EAAE,QAAQ,CAAC,CAClB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,eAAe,CAAiB,KAAK,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YAChC,OAAO;SACR;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;QACtC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;QAE1E,KAAK,CAAC,IAAI,CAAC;YACT,KAAK,EAAE,CACL,KAAC,WAAW,IACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,GAC5B,CACH;YACD,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM;YAClC,IAAI;YACJ,KAAK;SACN,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAElD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCardSlugFromUrl(url: string): string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function getCardSlugFromUrl(url) {
|
|
2
|
+
const lastSegment = url.split('/').filter(Boolean).pop();
|
|
3
|
+
if (!lastSegment) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
const parts = lastSegment.split('-');
|
|
7
|
+
return parts.length > 1 ? parts[parts.length - 1] : null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=getSlugFromUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSlugFromUrl.js","sourceRoot":"","sources":["../../src/utils/getSlugFromUrl.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;IACzD,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC"}
|
|
@@ -1538,7 +1538,7 @@
|
|
|
1538
1538
|
}) })] }, option.key))) })) : null);
|
|
1539
1539
|
const renderDefaultOptions = (option) => (jsx("span", { className: "min-h-6", children: formatOption(option) }));
|
|
1540
1540
|
|
|
1541
|
-
function useSelectPopup({ isOpen, options, value, query, onChange = noop, onClose = noop, iconVersion, disableFilterOptions = false, onChangeQuery = noop, renderOptions,
|
|
1541
|
+
function useSelectPopup({ isOpen, options, value, query, onChange = noop, onClose = noop, iconVersion, disableFilterOptions = false, onChangeQuery = noop, renderOptions, }) {
|
|
1542
1542
|
const popup = usePopupManager();
|
|
1543
1543
|
const close = useCallback(() => {
|
|
1544
1544
|
popup.close();
|
|
@@ -1547,11 +1547,7 @@
|
|
|
1547
1547
|
const handleChange = useCallback((option) => {
|
|
1548
1548
|
close();
|
|
1549
1549
|
onChange(option);
|
|
1550
|
-
onChangeQuery(isSearch && option?.text ? option.text : '');
|
|
1551
1550
|
}, [close, onChange]);
|
|
1552
|
-
useEffect(() => {
|
|
1553
|
-
onChangeQuery(isSearch && value?.text ? value.text : '');
|
|
1554
|
-
}, [value]);
|
|
1555
1551
|
const inputRef = useRef(null);
|
|
1556
1552
|
const popupRef = useOutsideClick(close);
|
|
1557
1553
|
useEffect(() => {
|
|
@@ -4554,6 +4550,15 @@
|
|
|
4554
4550
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
4555
4551
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
4556
4552
|
|
|
4553
|
+
function getCardSlugFromUrl(url) {
|
|
4554
|
+
const lastSegment = url.split('/').filter(Boolean).pop();
|
|
4555
|
+
if (!lastSegment) {
|
|
4556
|
+
return null;
|
|
4557
|
+
}
|
|
4558
|
+
const parts = lastSegment.split('-');
|
|
4559
|
+
return parts.length > 1 ? parts[parts.length - 1] : null;
|
|
4560
|
+
}
|
|
4561
|
+
|
|
4557
4562
|
const fetchRegionOffices = async (regionKey) => {
|
|
4558
4563
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
4559
4564
|
regionRfCd: {
|
|
@@ -4582,9 +4587,21 @@
|
|
|
4582
4587
|
return result || [];
|
|
4583
4588
|
};
|
|
4584
4589
|
|
|
4590
|
+
const BIBLIOGLOBUS_SLUG = 'biblioglobus';
|
|
4591
|
+
const UNIONPAY_TEXT = 'UnionPay';
|
|
4592
|
+
const filterPaymentSystems = (systems, slug) => {
|
|
4593
|
+
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
4594
|
+
return systems;
|
|
4595
|
+
}
|
|
4596
|
+
return systems.filter((system) => system.text === UNIONPAY_TEXT);
|
|
4597
|
+
};
|
|
4598
|
+
|
|
4599
|
+
const BIBLIOGLOBUS_OFFICE_ID = '714680716';
|
|
4585
4600
|
const AddressRetailField = JSX(({ field, input }) => {
|
|
4586
4601
|
const [offices, setOffices] = useState([]);
|
|
4587
4602
|
const { data } = useLeadFormData('REGION_RF');
|
|
4603
|
+
const sessionStore = useSessionStore();
|
|
4604
|
+
const referrerUrl = sessionStore.referrerUrl;
|
|
4588
4605
|
const regionValue = field('regionRetail')?.value || {};
|
|
4589
4606
|
const addressField = field(input?.name ?? '');
|
|
4590
4607
|
useEffect(() => {
|
|
@@ -4596,6 +4613,20 @@
|
|
|
4596
4613
|
addressField.onChange?.('');
|
|
4597
4614
|
}
|
|
4598
4615
|
}, [regionValue.key]);
|
|
4616
|
+
// Логика для biblioglobus - выбор отделения по умолчанию
|
|
4617
|
+
useEffect(() => {
|
|
4618
|
+
if (!referrerUrl || !offices.length) {
|
|
4619
|
+
return;
|
|
4620
|
+
}
|
|
4621
|
+
const slug = getCardSlugFromUrl(referrerUrl);
|
|
4622
|
+
if (slug === BIBLIOGLOBUS_SLUG) {
|
|
4623
|
+
const defaultOffice = offices.find((office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID);
|
|
4624
|
+
addressField.onChange?.({
|
|
4625
|
+
key: defaultOffice?.id?.toString() || '',
|
|
4626
|
+
text: defaultOffice?.address || '',
|
|
4627
|
+
});
|
|
4628
|
+
}
|
|
4629
|
+
}, [referrerUrl, offices]);
|
|
4599
4630
|
const { points } = useOfficesAtmsMapData({
|
|
4600
4631
|
data: offices,
|
|
4601
4632
|
filtrationState: {},
|
|
@@ -5101,7 +5132,7 @@
|
|
|
5101
5132
|
const defaultParams = calcValue
|
|
5102
5133
|
? defaultValueAdapter(field(FIELD_NAME).value)
|
|
5103
5134
|
: params?.calcData?.defaultParams;
|
|
5104
|
-
const defaultCalcSum = defaultParams?.sum ?? 0;
|
|
5135
|
+
const defaultCalcSum = params?.calcData?.defaultParams?.sum ?? 0;
|
|
5105
5136
|
const handleChange = useCallback((_) => {
|
|
5106
5137
|
field(FIELD_NAME).onChange?.(_);
|
|
5107
5138
|
}, []);
|
|
@@ -5704,12 +5735,21 @@
|
|
|
5704
5735
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
5705
5736
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
5706
5737
|
const localStore = useLocalStore();
|
|
5738
|
+
const sessionStore = useSessionStore();
|
|
5707
5739
|
useAsyncEffect(async () => {
|
|
5708
5740
|
const { programId } = localStore;
|
|
5709
|
-
if (programId) {
|
|
5710
|
-
|
|
5741
|
+
if (!programId) {
|
|
5742
|
+
return;
|
|
5743
|
+
}
|
|
5744
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5745
|
+
const referrerUrl = sessionStore.referrerUrl;
|
|
5746
|
+
if (!referrerUrl) {
|
|
5711
5747
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
5748
|
+
return;
|
|
5712
5749
|
}
|
|
5750
|
+
const slug = getCardSlugFromUrl(referrerUrl);
|
|
5751
|
+
const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
|
|
5752
|
+
setPaymentSystemOptions(filteredSystems);
|
|
5713
5753
|
}, []);
|
|
5714
5754
|
const items = useMemo(() => paymentSystemOptions?.map((_) => ({ id: _.key, text: _.text })) ?? [], [paymentSystemOptions]);
|
|
5715
5755
|
return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: items, ...field(input?.name ?? '', {
|
|
@@ -5728,11 +5768,49 @@
|
|
|
5728
5768
|
return res || undefined;
|
|
5729
5769
|
};
|
|
5730
5770
|
|
|
5771
|
+
const useBiblioglobusDefaultRegion = (args) => {
|
|
5772
|
+
const { referrerUrl, regions, regionsDelivery, onRegionChange, onRegionHasDeliveryChange, onMethodObtainChange, } = args;
|
|
5773
|
+
const slug = referrerUrl ? getCardSlugFromUrl(referrerUrl) : '';
|
|
5774
|
+
const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
|
|
5775
|
+
const regionHasDelivery = Boolean(regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg);
|
|
5776
|
+
const isReady = Boolean(referrerUrl &&
|
|
5777
|
+
regions &&
|
|
5778
|
+
regionsDelivery &&
|
|
5779
|
+
slug === BIBLIOGLOBUS_SLUG &&
|
|
5780
|
+
defaultRegion?.key &&
|
|
5781
|
+
defaultRegion?.value);
|
|
5782
|
+
useEffect(() => {
|
|
5783
|
+
if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
|
|
5784
|
+
return;
|
|
5785
|
+
}
|
|
5786
|
+
onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
|
|
5787
|
+
onRegionHasDeliveryChange?.(regionHasDelivery);
|
|
5788
|
+
onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
|
|
5789
|
+
}, [
|
|
5790
|
+
isReady,
|
|
5791
|
+
defaultRegion,
|
|
5792
|
+
regionHasDelivery,
|
|
5793
|
+
onRegionChange,
|
|
5794
|
+
onRegionHasDeliveryChange,
|
|
5795
|
+
onMethodObtainChange,
|
|
5796
|
+
]);
|
|
5797
|
+
};
|
|
5798
|
+
|
|
5799
|
+
const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
|
|
5800
|
+
const calculateRegionHasDelivery = (args) => {
|
|
5801
|
+
const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
|
|
5802
|
+
if (isDebit) {
|
|
5803
|
+
return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
|
|
5804
|
+
}
|
|
5805
|
+
return isDeliveryActive && regionDelivery;
|
|
5806
|
+
};
|
|
5807
|
+
|
|
5731
5808
|
const RegionRetailField = JSX(({ field, input }) => {
|
|
5732
5809
|
const { programId, productType } = useRetailFormStore();
|
|
5733
5810
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
5734
5811
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
5735
5812
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
5813
|
+
const sessionStore = useSessionStore();
|
|
5736
5814
|
const isDebit = productType === 'debitCard';
|
|
5737
5815
|
const isSalaryCard = programId === '38';
|
|
5738
5816
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
@@ -5741,17 +5819,26 @@
|
|
|
5741
5819
|
const handleChangeRegion = field('regionRetail')?.onChange;
|
|
5742
5820
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
5743
5821
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
5822
|
+
useBiblioglobusDefaultRegion({
|
|
5823
|
+
referrerUrl: sessionStore.referrerUrl ?? undefined,
|
|
5824
|
+
regions,
|
|
5825
|
+
regionsDelivery,
|
|
5826
|
+
onRegionChange: handleChangeRegion,
|
|
5827
|
+
onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
|
|
5828
|
+
onMethodObtainChange: handleChangeMethodObtain,
|
|
5829
|
+
});
|
|
5744
5830
|
const onChange = useCallback((value) => {
|
|
5745
|
-
const regionHasDelivery =
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
:
|
|
5831
|
+
const regionHasDelivery = calculateRegionHasDelivery({
|
|
5832
|
+
isDebit,
|
|
5833
|
+
isEsiaAuth,
|
|
5834
|
+
isSalaryCard,
|
|
5835
|
+
isDeliveryActive,
|
|
5836
|
+
regionDelivery: getRegionDeliveryStatus(regionsDelivery, value),
|
|
5837
|
+
});
|
|
5751
5838
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5752
5839
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
5753
5840
|
handleChangeRegion?.(value);
|
|
5754
|
-
}, [
|
|
5841
|
+
}, [calculateRegionHasDelivery]);
|
|
5755
5842
|
useEffect(() => {
|
|
5756
5843
|
if (!isEsiaAuth && isDebit) {
|
|
5757
5844
|
handleChangeRegionHasDelivery?.(false);
|
|
@@ -5955,6 +6042,11 @@
|
|
|
5955
6042
|
return res || {};
|
|
5956
6043
|
};
|
|
5957
6044
|
|
|
6045
|
+
const getClaimChannel = async () => {
|
|
6046
|
+
const res = await fetchRetailJSON('light-api-cash/v1/claimChannel/', 'GET');
|
|
6047
|
+
return res || [];
|
|
6048
|
+
};
|
|
6049
|
+
|
|
5958
6050
|
const getLastTaskStatus = async (body) => {
|
|
5959
6051
|
const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
|
|
5960
6052
|
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
@@ -6642,7 +6734,7 @@
|
|
|
6642
6734
|
...consents,
|
|
6643
6735
|
};
|
|
6644
6736
|
};
|
|
6645
|
-
const getDebitLeadFormTaskData = (formData, programId, marketingInfo) => {
|
|
6737
|
+
const getDebitLeadFormTaskData = ({ formData, programId, marketingInfo, claimChannelCode, }) => {
|
|
6646
6738
|
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
6647
6739
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
6648
6740
|
return {
|
|
@@ -6665,6 +6757,7 @@
|
|
|
6665
6757
|
],
|
|
6666
6758
|
marketingInfo,
|
|
6667
6759
|
},
|
|
6760
|
+
...(claimChannelCode ? { claimChannelCode } : {}),
|
|
6668
6761
|
};
|
|
6669
6762
|
};
|
|
6670
6763
|
const getTaskSource = (source) => {
|
|
@@ -6740,6 +6833,7 @@
|
|
|
6740
6833
|
});
|
|
6741
6834
|
const referalData = leadFormStore.referalData;
|
|
6742
6835
|
const marketingInfo = sessionStore.marketingInfo;
|
|
6836
|
+
const referrerUrl = sessionStore.referrerUrl;
|
|
6743
6837
|
if (!profileId) {
|
|
6744
6838
|
throw new Error();
|
|
6745
6839
|
}
|
|
@@ -6753,6 +6847,7 @@
|
|
|
6753
6847
|
marketingInfo,
|
|
6754
6848
|
saveUserData,
|
|
6755
6849
|
sendAspects,
|
|
6850
|
+
referrerUrl,
|
|
6756
6851
|
});
|
|
6757
6852
|
verifyPhoneDialog.close();
|
|
6758
6853
|
if (productType === 'debitCard') {
|
|
@@ -6869,14 +6964,29 @@
|
|
|
6869
6964
|
.filter((_) => formData[_])
|
|
6870
6965
|
.map((_) => consents[_]?.text);
|
|
6871
6966
|
};
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6967
|
+
// Padding line to fix eslint padding-line-between-statements
|
|
6968
|
+
const computeClaimChannel = async (slug) => {
|
|
6969
|
+
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
6970
|
+
return undefined;
|
|
6971
|
+
}
|
|
6972
|
+
const claimData = await getClaimChannel();
|
|
6973
|
+
return claimData.find((item) => item.key === slug)?.code;
|
|
6974
|
+
};
|
|
6975
|
+
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, referrerUrl, }) => {
|
|
6875
6976
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
6977
|
+
const slug = getCardSlugFromUrl(referrerUrl);
|
|
6876
6978
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
6877
6979
|
try {
|
|
6980
|
+
let taskId;
|
|
6981
|
+
let participantId;
|
|
6878
6982
|
if (productType === 'debitCard') {
|
|
6879
|
-
const
|
|
6983
|
+
const claimChannelCode = await computeClaimChannel(slug);
|
|
6984
|
+
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData({
|
|
6985
|
+
formData,
|
|
6986
|
+
programId,
|
|
6987
|
+
marketingInfo,
|
|
6988
|
+
claimChannelCode,
|
|
6989
|
+
}));
|
|
6880
6990
|
taskId = debitData.taskId;
|
|
6881
6991
|
participantId = debitData.participantId;
|
|
6882
6992
|
}
|
|
@@ -7306,6 +7416,10 @@
|
|
|
7306
7416
|
leadFormStore.productType = productType;
|
|
7307
7417
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
7308
7418
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
7419
|
+
const referrer = globalThis.document.referrer;
|
|
7420
|
+
if (referrer) {
|
|
7421
|
+
sessionStore.referrerUrl = referrer;
|
|
7422
|
+
}
|
|
7309
7423
|
}, [queryFromStorage]);
|
|
7310
7424
|
useEffect(() => {
|
|
7311
7425
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
@@ -12841,7 +12955,7 @@
|
|
|
12841
12955
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
12842
12956
|
});
|
|
12843
12957
|
|
|
12844
|
-
const packageVersion = "0.14.
|
|
12958
|
+
const packageVersion = "0.14.972";
|
|
12845
12959
|
|
|
12846
12960
|
exports.Blocks = Blocks;
|
|
12847
12961
|
exports.ContentPage = ContentPage;
|