@redneckz/wildless-cms-uni-blocks 0.14.1069 → 0.14.1071
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 +442 -297
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CashbackCalculator/CashbackCalculator.d.ts +7 -2
- package/bundle/components/CashbackCalculator/CashbackCalculatorResult.d.ts +2 -1
- package/bundle/components/CashbackCalculator/CashbackCategory.d.ts +6 -2
- package/bundle/components/CashbackCalculator/constants.d.ts +16 -0
- package/bundle/components/CashbackCalculator/getPercentCategories.d.ts +1 -0
- package/bundle/components/CashbackCalculator/renderButtons.d.ts +9 -0
- package/bundle/components/CashbackCalculator/useCashbackCalculator.d.ts +4 -2
- package/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +6 -0
- package/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +38 -0
- package/bundle/components/GalleryLayout/utils.d.ts +1 -0
- package/bundle/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/bundle/ui-kit/RichText/RichTextProps.d.ts +2 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/Blocks.js +4 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CashbackCalculator/CashbackCalculator.d.ts +7 -2
- package/dist/components/CashbackCalculator/CashbackCalculator.js +25 -14
- package/dist/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/dist/components/CashbackCalculator/CashbackCalculatorContent.d.ts +0 -25
- package/dist/components/CashbackCalculator/CashbackCalculatorContent.js +0 -1
- package/dist/components/CashbackCalculator/CashbackCalculatorResult.d.ts +2 -1
- package/dist/components/CashbackCalculator/CashbackCalculatorResult.js +9 -11
- package/dist/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/dist/components/CashbackCalculator/CashbackCategory.d.ts +6 -2
- package/dist/components/CashbackCalculator/CashbackCategory.js +33 -54
- package/dist/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/dist/components/CashbackCalculator/constants.d.ts +16 -0
- package/dist/components/CashbackCalculator/constants.js +89 -0
- package/dist/components/CashbackCalculator/constants.js.map +1 -0
- package/dist/components/CashbackCalculator/getPercentCategories.d.ts +1 -0
- package/dist/components/CashbackCalculator/getPercentCategories.js +16 -0
- package/dist/components/CashbackCalculator/getPercentCategories.js.map +1 -0
- package/dist/components/CashbackCalculator/renderButtons.d.ts +9 -0
- package/dist/components/CashbackCalculator/renderButtons.js +10 -0
- package/dist/components/CashbackCalculator/renderButtons.js.map +1 -0
- package/dist/components/CashbackCalculator/useCashbackCalculator.d.ts +4 -2
- package/dist/components/CashbackCalculator/useCashbackCalculator.js +17 -15
- package/dist/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +6 -0
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +56 -0
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +1 -0
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +38 -0
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +2 -0
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +1 -0
- package/dist/components/GalleryLayout/utils.d.ts +1 -0
- package/dist/retail/api/createParticipant.js +1 -1
- package/dist/retail/api/createParticipant.js.map +1 -1
- package/dist/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/dist/ui-kit/RichText/RichText.js +2 -2
- package/dist/ui-kit/RichText/RichText.js.map +1 -1
- package/dist/ui-kit/RichText/RichTextProps.d.ts +2 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/Blocks.js +4 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CashbackCalculator/CashbackCalculator.d.ts +7 -2
- package/lib/components/CashbackCalculator/CashbackCalculator.js +25 -14
- package/lib/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/lib/components/CashbackCalculator/CashbackCalculatorContent.d.ts +0 -25
- package/lib/components/CashbackCalculator/CashbackCalculatorContent.js +0 -1
- package/lib/components/CashbackCalculator/CashbackCalculatorResult.d.ts +2 -1
- package/lib/components/CashbackCalculator/CashbackCalculatorResult.js +9 -11
- package/lib/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/lib/components/CashbackCalculator/CashbackCategory.d.ts +6 -2
- package/lib/components/CashbackCalculator/CashbackCategory.js +33 -54
- package/lib/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/lib/components/CashbackCalculator/constants.d.ts +16 -0
- package/lib/components/CashbackCalculator/constants.js +87 -0
- package/lib/components/CashbackCalculator/constants.js.map +1 -0
- package/lib/components/CashbackCalculator/getPercentCategories.d.ts +1 -0
- package/lib/components/CashbackCalculator/getPercentCategories.js +13 -0
- package/lib/components/CashbackCalculator/getPercentCategories.js.map +1 -0
- package/lib/components/CashbackCalculator/renderButtons.d.ts +9 -0
- package/lib/components/CashbackCalculator/renderButtons.js +7 -0
- package/lib/components/CashbackCalculator/renderButtons.js.map +1 -0
- package/lib/components/CashbackCalculator/useCashbackCalculator.d.ts +4 -2
- package/lib/components/CashbackCalculator/useCashbackCalculator.js +18 -16
- package/lib/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +6 -0
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.fixture.d.ts +5 -0
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +54 -0
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +1 -0
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +38 -0
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +2 -0
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +1 -0
- package/lib/components/GalleryLayout/utils.d.ts +1 -0
- package/lib/retail/api/createParticipant.js +1 -1
- package/lib/retail/api/createParticipant.js.map +1 -1
- package/lib/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/lib/ui-kit/RichText/RichText.js +2 -2
- package/lib/ui-kit/RichText/RichText.js.map +1 -1
- package/lib/ui-kit/RichText/RichTextProps.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +188 -90
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CashbackCalculator/CashbackCalculator.d.ts +7 -2
- package/mobile/bundle/components/CashbackCalculator/CashbackCalculatorResult.d.ts +2 -1
- package/mobile/bundle/components/CashbackCalculator/CashbackCategory.d.ts +6 -2
- package/mobile/bundle/components/CashbackCalculator/constants.d.ts +16 -0
- package/mobile/bundle/components/CashbackCalculator/getPercentCategories.d.ts +1 -0
- package/mobile/bundle/components/CashbackCalculator/renderButtons.d.ts +9 -0
- package/mobile/bundle/components/CashbackCalculator/useCashbackCalculator.d.ts +4 -2
- package/mobile/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +6 -0
- package/mobile/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +38 -0
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +1 -0
- package/mobile/bundle/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/bundle/ui-kit/RichText/RichTextProps.d.ts +2 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCalculator.d.ts +7 -2
- package/mobile/dist/components/CashbackCalculator/CashbackCalculator.js +25 -14
- package/mobile/dist/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorContent.d.ts +0 -25
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorContent.js +0 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorResult.d.ts +2 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorResult.js +9 -11
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCategory.d.ts +6 -2
- package/mobile/dist/components/CashbackCalculator/CashbackCategory.js +33 -54
- package/mobile/dist/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/constants.d.ts +16 -0
- package/mobile/dist/components/CashbackCalculator/constants.js +89 -0
- package/mobile/dist/components/CashbackCalculator/constants.js.map +1 -0
- package/mobile/dist/components/CashbackCalculator/getPercentCategories.d.ts +1 -0
- package/mobile/dist/components/CashbackCalculator/getPercentCategories.js +16 -0
- package/mobile/dist/components/CashbackCalculator/getPercentCategories.js.map +1 -0
- package/mobile/dist/components/CashbackCalculator/renderButtons.d.ts +9 -0
- package/mobile/dist/components/CashbackCalculator/renderButtons.js +10 -0
- package/mobile/dist/components/CashbackCalculator/renderButtons.js.map +1 -0
- package/mobile/dist/components/CashbackCalculator/useCashbackCalculator.d.ts +4 -2
- package/mobile/dist/components/CashbackCalculator/useCashbackCalculator.js +17 -15
- package/mobile/dist/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +6 -0
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +56 -0
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +1 -0
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +38 -0
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +2 -0
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +1 -0
- package/mobile/dist/components/GalleryLayout/utils.d.ts +1 -0
- package/mobile/dist/retail/api/createParticipant.js +1 -1
- package/mobile/dist/retail/api/createParticipant.js.map +1 -1
- package/mobile/dist/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/dist/ui-kit/RichText/RichText.js +2 -2
- package/mobile/dist/ui-kit/RichText/RichText.js.map +1 -1
- package/mobile/dist/ui-kit/RichText/RichTextProps.d.ts +2 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCalculator.d.ts +7 -2
- package/mobile/lib/components/CashbackCalculator/CashbackCalculator.js +25 -14
- package/mobile/lib/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorContent.d.ts +0 -25
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorContent.js +0 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorResult.d.ts +2 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorResult.js +9 -11
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCategory.d.ts +6 -2
- package/mobile/lib/components/CashbackCalculator/CashbackCategory.js +33 -54
- package/mobile/lib/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/constants.d.ts +16 -0
- package/mobile/lib/components/CashbackCalculator/constants.js +87 -0
- package/mobile/lib/components/CashbackCalculator/constants.js.map +1 -0
- package/mobile/lib/components/CashbackCalculator/getPercentCategories.d.ts +1 -0
- package/mobile/lib/components/CashbackCalculator/getPercentCategories.js +13 -0
- package/mobile/lib/components/CashbackCalculator/getPercentCategories.js.map +1 -0
- package/mobile/lib/components/CashbackCalculator/renderButtons.d.ts +9 -0
- package/mobile/lib/components/CashbackCalculator/renderButtons.js +7 -0
- package/mobile/lib/components/CashbackCalculator/renderButtons.js.map +1 -0
- package/mobile/lib/components/CashbackCalculator/useCashbackCalculator.d.ts +4 -2
- package/mobile/lib/components/CashbackCalculator/useCashbackCalculator.js +18 -16
- package/mobile/lib/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +6 -0
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +54 -0
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +1 -0
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +38 -0
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +2 -0
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +1 -0
- package/mobile/lib/components/GalleryLayout/utils.d.ts +1 -0
- package/mobile/lib/retail/api/createParticipant.js +1 -1
- package/mobile/lib/retail/api/createParticipant.js.map +1 -1
- package/mobile/lib/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/lib/ui-kit/RichText/RichText.js +2 -2
- package/mobile/lib/ui-kit/RichText/RichText.js.map +1 -1
- package/mobile/lib/ui-kit/RichText/RichTextProps.d.ts +2 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +47 -28
- package/mobile/src/components/CashbackCalculator/CashbackCalculator.tsx +73 -69
- package/mobile/src/components/CashbackCalculator/CashbackCalculatorContent.ts +0 -28
- package/mobile/src/components/CashbackCalculator/CashbackCalculatorResult.tsx +23 -23
- package/mobile/src/components/CashbackCalculator/CashbackCategory.tsx +69 -71
- package/mobile/src/components/CashbackCalculator/constants.ts +97 -0
- package/mobile/src/components/CashbackCalculator/getPercentCategories.ts +24 -0
- package/mobile/src/components/CashbackCalculator/renderButtons.tsx +38 -0
- package/mobile/src/components/CashbackCalculator/useCashbackCalculator.ts +26 -17
- package/mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.example.json +47 -0
- package/mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.tsx +116 -0
- package/{src/components/CashbackCalculator/CashbackCalculator.ui.json → mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.ui.json} +6 -0
- package/mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.ts +49 -0
- package/mobile/src/retail/api/createParticipant.ts +1 -1
- package/mobile/src/retail/model/ApplicationLeadFormTypes.ts +1 -1
- package/mobile/src/ui-kit/RichText/RichText.tsx +9 -1
- package/mobile/src/ui-kit/RichText/RichTextProps.ts +2 -0
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +47 -28
- package/src/components/Blocks.ts +4 -2
- package/src/components/CashbackCalculator/CashbackCalculator.tsx +73 -69
- package/src/components/CashbackCalculator/CashbackCalculatorContent.ts +0 -28
- package/src/components/CashbackCalculator/CashbackCalculatorResult.tsx +23 -23
- package/src/components/CashbackCalculator/CashbackCategory.tsx +69 -71
- package/src/components/CashbackCalculator/constants.ts +97 -0
- package/src/components/CashbackCalculator/getPercentCategories.ts +24 -0
- package/src/components/CashbackCalculator/renderButtons.tsx +38 -0
- package/src/components/CashbackCalculator/useCashbackCalculator.ts +26 -17
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.example.json +47 -0
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.fixture.tsx +61 -0
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.tsx +116 -0
- package/{mobile/src/components/CashbackCalculator/CashbackCalculator.ui.json → src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.ui.json} +6 -0
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.ts +49 -0
- package/src/retail/api/createParticipant.ts +1 -1
- package/src/retail/model/ApplicationLeadFormTypes.ts +1 -1
- package/src/ui-kit/RichText/RichText.tsx +9 -1
- package/src/ui-kit/RichText/RichTextProps.ts +2 -0
- package/bundle/components/CashbackCalculator/CashbackCalculatorContent.d.ts +0 -25
- package/mobile/bundle/components/CashbackCalculator/CashbackCalculatorContent.d.ts +0 -25
- package/mobile/src/components/CashbackCalculator/CashbackCalculator.example.json +0 -1
- package/src/components/CashbackCalculator/CashbackCalculator.example.json +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { style } from '../../utils/style.js';
|
|
4
|
-
export const RichText = JSX(({ __html = '', richVersion = '', itemSize = 'list-m', isDotted = true, children }) => {
|
|
4
|
+
export const RichText = JSX(({ __html = '', richVersion = '', itemSize = 'list-m', className, isDotted = true, children, }) => {
|
|
5
5
|
const dotStyle = isDotted ? '' : 'without-dots';
|
|
6
6
|
return __html || children ? (
|
|
7
7
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
8
|
-
_jsx("div", { "data-component": "rich-text-container", children: _jsx("div", { className: style(richVersion, itemSize, 'md-container group-data-secondary:text-white group-data-gray:text-secondary-text', dotStyle), dangerouslySetInnerHTML: __html ? { __html } : undefined, children: children }) })) : null;
|
|
8
|
+
_jsx("div", { "data-component": "rich-text-container", children: _jsx("div", { className: style(richVersion, itemSize, 'md-container group-data-secondary:text-white group-data-gray:text-secondary-text', dotStyle, className), dangerouslySetInnerHTML: __html ? { __html } : undefined, children: children }) })) : null;
|
|
9
9
|
});
|
|
10
10
|
//# sourceMappingURL=RichText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.js","sourceRoot":"","sources":["../../../src/ui-kit/RichText/RichText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,CAAC,
|
|
1
|
+
{"version":3,"file":"RichText.js","sourceRoot":"","sources":["../../../src/ui-kit/RichText/RichText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,CAAC,EACC,MAAM,GAAG,EAAE,EACX,WAAW,GAAG,EAAE,EAChB,QAAQ,GAAG,QAAQ,EACnB,SAAS,EACT,QAAQ,GAAG,IAAI,EACf,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;IAEhD,OAAO,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC;IAC1B,uFAAuF;IACvF,gCAAoB,qBAAqB,YACvC,cACE,SAAS,EAAE,KAAK,CACd,WAAW,EACX,QAAQ,EACR,kFAAkF,EAClF,QAAQ,EACR,SAAS,CACV,EACD,uBAAuB,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,YAEvD,QAAQ,GACL,GACF,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -831,11 +831,11 @@
|
|
|
831
831
|
? 'bg-secondary-light text-primary-main'
|
|
832
832
|
: 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black'), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null;
|
|
833
833
|
|
|
834
|
-
const RichText = JSX(({ __html = '', richVersion = '', itemSize = 'list-m', isDotted = true, children }) => {
|
|
834
|
+
const RichText = JSX(({ __html = '', richVersion = '', itemSize = 'list-m', className, isDotted = true, children, }) => {
|
|
835
835
|
const dotStyle = isDotted ? '' : 'without-dots';
|
|
836
836
|
return __html || children ? (
|
|
837
837
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
838
|
-
jsx("div", { "data-component": "rich-text-container", children: jsx("div", { className: style(richVersion, itemSize, 'md-container group-data-secondary:text-white group-data-gray:text-secondary-text', dotStyle), dangerouslySetInnerHTML: __html ? { __html } : undefined, children: children }) })) : null;
|
|
838
|
+
jsx("div", { "data-component": "rich-text-container", children: jsx("div", { className: style(richVersion, itemSize, 'md-container group-data-secondary:text-white group-data-gray:text-secondary-text', dotStyle, className), dangerouslySetInnerHTML: __html ? { __html } : undefined, children: children }) })) : null;
|
|
839
839
|
});
|
|
840
840
|
|
|
841
841
|
const renderBenefitDescription = (description, i) => description ? (jsx(Paragraph, { font: "font-light", size: "text-m", color: "text-secondary-text group-data-secondary:text-white", children: description }, `description-${i}`)) : null;
|
|
@@ -6905,7 +6905,7 @@
|
|
|
6905
6905
|
return res || {};
|
|
6906
6906
|
};
|
|
6907
6907
|
|
|
6908
|
-
const createParticipant = (body) => fetchRetailJSON('/
|
|
6908
|
+
const createParticipant = (body) => fetchRetailJSON('/internal/entities/createParticipant', 'POST', body).then((res) => res || null);
|
|
6909
6909
|
|
|
6910
6910
|
const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
|
|
6911
6911
|
|
|
@@ -6974,7 +6974,7 @@
|
|
|
6974
6974
|
'bg-white': 'text-primary-main',
|
|
6975
6975
|
transparent: 'text-white',
|
|
6976
6976
|
};
|
|
6977
|
-
const renderImage = (bgColor, image, size) => {
|
|
6977
|
+
const renderImage$1 = (bgColor, image, size) => {
|
|
6978
6978
|
const img = image?.src
|
|
6979
6979
|
? image
|
|
6980
6980
|
: {
|
|
@@ -6988,7 +6988,7 @@
|
|
|
6988
6988
|
'bg-white': 'text-primary-text',
|
|
6989
6989
|
transparent: 'text-white',
|
|
6990
6990
|
};
|
|
6991
|
-
const Logo = JSX(({ className, href = '/', logo, children, targetBlank, bgColor = 'bg-white', showTitle = true, data, size = ICON_SIZE, }) => (jsxs("a", { className: style('inline-flex items-center font-sans no-underline', className), href: logo?.href ?? href, target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title ?? 'Россельхозбанк', ...getAspectsAttributes(data), children: [renderImage(bgColor, logo?.image, size), showTitle
|
|
6991
|
+
const Logo = JSX(({ className, href = '/', logo, children, targetBlank, bgColor = 'bg-white', showTitle = true, data, size = ICON_SIZE, }) => (jsxs("a", { className: style('inline-flex items-center font-sans no-underline', className), href: logo?.href ?? href, target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title ?? 'Россельхозбанк', ...getAspectsAttributes(data), children: [renderImage$1(bgColor, logo?.image, size), showTitle
|
|
6992
6992
|
? children ?? (jsx("div", { className: "ml-s", children: jsx(Text, { font: "font-medium", color: TEXT_COLOR[bgColor], size: logoTitleSizeStyle, children: logo?.title ?? 'Россельхозбанк' }) }))
|
|
6993
6993
|
: null] })));
|
|
6994
6994
|
|
|
@@ -7845,43 +7845,26 @@
|
|
|
7845
7845
|
try {
|
|
7846
7846
|
startSending();
|
|
7847
7847
|
const transformedFormData = transformFormData(formData);
|
|
7848
|
-
const participantData = await createParticipant({
|
|
7849
|
-
phone: formatPhone(transformedFormData.phone),
|
|
7850
|
-
email: transformedFormData.email,
|
|
7851
|
-
});
|
|
7852
7848
|
const referalData = leadFormStore.referalData;
|
|
7853
7849
|
const marketingInfo = sessionStore.marketingInfo;
|
|
7854
|
-
if (!participantData) {
|
|
7855
|
-
throw new Error();
|
|
7856
|
-
}
|
|
7857
|
-
const { participantId, userId } = participantData;
|
|
7858
|
-
if (!participantId) {
|
|
7859
|
-
throw new Error();
|
|
7860
|
-
}
|
|
7861
7850
|
const common = {
|
|
7862
7851
|
programId,
|
|
7863
|
-
userId,
|
|
7864
7852
|
productType,
|
|
7865
7853
|
sendAspects,
|
|
7866
7854
|
verifyPhoneDialog,
|
|
7867
7855
|
handleFailSendForm,
|
|
7868
7856
|
};
|
|
7869
7857
|
const taskData = {
|
|
7870
|
-
participantId,
|
|
7871
7858
|
formData: transformedFormData,
|
|
7872
7859
|
referalData,
|
|
7873
7860
|
marketingInfo,
|
|
7874
7861
|
saveUserData,
|
|
7875
7862
|
};
|
|
7876
|
-
const sendCurrentTask = createSendCurrentTaskNew({
|
|
7877
|
-
common,
|
|
7878
|
-
taskData,
|
|
7879
|
-
consentBkiDialog,
|
|
7880
|
-
});
|
|
7881
7863
|
const handleSuccessVerify = createHandleSuccessVerifyNew({
|
|
7882
7864
|
common,
|
|
7865
|
+
taskData,
|
|
7883
7866
|
draftDialog,
|
|
7884
|
-
|
|
7867
|
+
consentBkiDialog,
|
|
7885
7868
|
});
|
|
7886
7869
|
const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
|
|
7887
7870
|
verifyPhoneDialog.open({
|
|
@@ -7906,6 +7889,9 @@
|
|
|
7906
7889
|
const createSendCurrentTaskNew = ({ common, taskData, consentBkiDialog, }) => async () => {
|
|
7907
7890
|
const { programId, userId, productType, sendAspects, verifyPhoneDialog, handleFailSendForm } = common;
|
|
7908
7891
|
const { participantId, formData, referalData, marketingInfo, saveUserData } = taskData;
|
|
7892
|
+
if (!participantId) {
|
|
7893
|
+
throw new Error();
|
|
7894
|
+
}
|
|
7909
7895
|
const taskId = await updateUserDataNewMicroservice({
|
|
7910
7896
|
programId,
|
|
7911
7897
|
participantId,
|
|
@@ -7925,9 +7911,34 @@
|
|
|
7925
7911
|
onFail: handleFailSendForm,
|
|
7926
7912
|
});
|
|
7927
7913
|
};
|
|
7928
|
-
const createHandleSuccessVerifyNew = ({ common, draftDialog,
|
|
7929
|
-
const {
|
|
7914
|
+
const createHandleSuccessVerifyNew = ({ common, taskData, draftDialog, consentBkiDialog, }) => async () => {
|
|
7915
|
+
const { programId, productType, sendAspects, verifyPhoneDialog, handleFailSendForm } = common;
|
|
7916
|
+
const { formData } = taskData;
|
|
7930
7917
|
try {
|
|
7918
|
+
const participantData = await createParticipant({
|
|
7919
|
+
phone: formatPhone(formData.phone),
|
|
7920
|
+
email: formData.email,
|
|
7921
|
+
});
|
|
7922
|
+
if (!participantData) {
|
|
7923
|
+
throw new Error();
|
|
7924
|
+
}
|
|
7925
|
+
const { participantId, userId } = participantData;
|
|
7926
|
+
if (!participantId) {
|
|
7927
|
+
throw new Error();
|
|
7928
|
+
}
|
|
7929
|
+
const updatedCommon = {
|
|
7930
|
+
...common,
|
|
7931
|
+
userId,
|
|
7932
|
+
};
|
|
7933
|
+
const updatedTaskData = {
|
|
7934
|
+
...taskData,
|
|
7935
|
+
participantId,
|
|
7936
|
+
};
|
|
7937
|
+
const sendCurrentTask = createSendCurrentTaskNew({
|
|
7938
|
+
common: updatedCommon,
|
|
7939
|
+
taskData: updatedTaskData,
|
|
7940
|
+
consentBkiDialog,
|
|
7941
|
+
});
|
|
7931
7942
|
const lastTaskId = await getLastTaskStatus({ userId, programId });
|
|
7932
7943
|
if (lastTaskId) {
|
|
7933
7944
|
const task = await getTaskById({ taskId: lastTaskId });
|
|
@@ -7944,7 +7955,8 @@
|
|
|
7944
7955
|
await sendCurrentTask();
|
|
7945
7956
|
}
|
|
7946
7957
|
}
|
|
7947
|
-
catch {
|
|
7958
|
+
catch (error) {
|
|
7959
|
+
console.error('Error in handleSuccessVerify:', error);
|
|
7948
7960
|
handleFailSendForm();
|
|
7949
7961
|
}
|
|
7950
7962
|
};
|
|
@@ -10244,27 +10256,30 @@
|
|
|
10244
10256
|
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [jsx(Img, { className: "self-center", image: icon }), title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsxs(Foldable, { children: [jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] }), cardCells.length >= visibleCellsCount ? (jsx(DefaultFoldButton, { className: "mt-m", label: isVisible ? 'Скрыть' : 'Подробнее о тарифе', isUnfolded: isVisible, embedded: true, data: data, onClick: handleFold })) : null] })) : (jsx("div", { children: visibleCells }))] }));
|
|
10245
10257
|
});
|
|
10246
10258
|
|
|
10247
|
-
const MAX_MONTH_CASHBACK = 5000;
|
|
10248
|
-
const MAX_YEAR_CASHBACK = 60000;
|
|
10249
10259
|
const ResultText = JSX(({ text, value }) => (jsxs("div", { className: "space-y-xs w-full", children: [jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: text }), jsx("div", { className: "w-full text-2xl bg-main-gray px-4 py-3 rounded-md", children: toLocalNumberFormat()(value) })] })));
|
|
10250
|
-
const CashbackCalculatorResult = JSX(({ cashbacks }) => {
|
|
10251
|
-
const {
|
|
10252
|
-
return (jsxs("div", { className: "w-full flex flex-col gap-lg", children: [jsx(Heading, { className: "text-left", headingType: "h5", as: "h2", title: "\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0440\u0430\u0441\u0447\u0435\u0442\u0430" }),
|
|
10260
|
+
const CashbackCalculatorResult = JSX(({ cashbacks, maxMonthCashback }) => {
|
|
10261
|
+
const { month, year } = getResult(cashbacks, maxMonthCashback);
|
|
10262
|
+
return (jsxs("div", { className: "w-full flex flex-col gap-lg", children: [jsx(Heading, { className: "text-left", headingType: "h5", as: "h2", title: "\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0440\u0430\u0441\u0447\u0435\u0442\u0430" }), jsxs("div", { className: "flex flex-col @xs:flex-row gap-lg", children: [jsx(ResultText, { text: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0432 \u043C\u0435\u0441\u044F\u0446", value: month }), jsx(ResultText, { text: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0432 \u0433\u043E\u0434", value: year })] })] }));
|
|
10253
10263
|
});
|
|
10254
|
-
const getResult = (cashbacks) => {
|
|
10264
|
+
const getResult = (cashbacks, maxMonthCashback) => {
|
|
10255
10265
|
return cashbacks.reduce((acc, val) => {
|
|
10256
|
-
const mounthSum = (
|
|
10266
|
+
const mounthSum = (formatKey(val.percent.key) / 100) * val.sum;
|
|
10257
10267
|
return {
|
|
10258
|
-
|
|
10259
|
-
year: Math.min(acc.year + mounthSum * 12,
|
|
10268
|
+
month: Math.min(acc.month + mounthSum, maxMonthCashback),
|
|
10269
|
+
year: Math.min(acc.year + mounthSum * 12, maxMonthCashback * 12),
|
|
10260
10270
|
};
|
|
10261
10271
|
}, {
|
|
10262
|
-
|
|
10272
|
+
month: 0,
|
|
10263
10273
|
year: 0,
|
|
10264
10274
|
});
|
|
10265
10275
|
};
|
|
10276
|
+
const formatKey = (key) => Number(key.replace('-main', ''));
|
|
10266
10277
|
|
|
10267
|
-
const
|
|
10278
|
+
const ALL_PERCENT_STANDARD_CATEGORIES = [
|
|
10279
|
+
{
|
|
10280
|
+
text: 'Категория 1% «На всё»',
|
|
10281
|
+
key: '1-main',
|
|
10282
|
+
},
|
|
10268
10283
|
{
|
|
10269
10284
|
text: 'Категория 1,5%',
|
|
10270
10285
|
key: '1.5',
|
|
@@ -10286,7 +10301,11 @@
|
|
|
10286
10301
|
key: '15',
|
|
10287
10302
|
},
|
|
10288
10303
|
];
|
|
10289
|
-
const
|
|
10304
|
+
const ALL_PERCENT_PREMIUM_CATEGORIES = [
|
|
10305
|
+
{
|
|
10306
|
+
text: 'Категория 1,5% «На всё»',
|
|
10307
|
+
key: '1.5-main',
|
|
10308
|
+
},
|
|
10290
10309
|
{
|
|
10291
10310
|
text: 'Категория 1,5%',
|
|
10292
10311
|
key: '1.5',
|
|
@@ -10295,58 +10314,128 @@
|
|
|
10295
10314
|
text: 'Категория 3%',
|
|
10296
10315
|
key: '3',
|
|
10297
10316
|
},
|
|
10317
|
+
{
|
|
10318
|
+
text: 'Категория 5%',
|
|
10319
|
+
key: '5',
|
|
10320
|
+
},
|
|
10321
|
+
{
|
|
10322
|
+
text: 'Категория 10%',
|
|
10323
|
+
key: '10',
|
|
10324
|
+
},
|
|
10325
|
+
{
|
|
10326
|
+
text: 'Категория 15%',
|
|
10327
|
+
key: '15',
|
|
10328
|
+
},
|
|
10298
10329
|
];
|
|
10299
|
-
const
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
const onChangePercent = (value) => {
|
|
10303
|
-
onChange({
|
|
10304
|
-
...cashback,
|
|
10305
|
-
percent: value,
|
|
10306
|
-
});
|
|
10307
|
-
};
|
|
10308
|
-
const onChangeSum = (value) => {
|
|
10309
|
-
onChange({
|
|
10310
|
-
...cashback,
|
|
10311
|
-
sum: value,
|
|
10312
|
-
});
|
|
10313
|
-
};
|
|
10314
|
-
return (jsxs("div", { className: "w-full space-y-m", children: [jsxs("div", { className: "space-y-xs", children: [jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E" }), jsxs("div", { className: "flex gap-m", children: [jsx(Select, { className: "w-full", isManualInput: isMainCashback, placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E", options: getPercentCategories(isMainCashback, showIncreasedPercents), value: cashback.percent, onChange: onChangePercent }), !isMainCashback ? (jsx(Button, { version: "secondary", onClick: () => onDelete(cashback.id), shape: "round", className: "px-4 rounded-md", children: jsx(Img, { image: deleteImage }) })) : null] })] }), categories?.length && !isMainCashback ? (jsx(Select, { label: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E \u043F\u043E\u043A\u0443\u043F\u043E\u043A", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E \u043F\u043E\u043A\u0443\u043F\u043E\u043A", options: categories, value: currentCategory, onChange: setCurrentCategory })) : null, jsx(InputRange, { step: 500, title: "\u0421\u0443\u043C\u043C\u0430 \u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0432 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438", min: 0, max: maxInputRange, value: cashback.sum, onChange: onChangeSum })] }));
|
|
10315
|
-
});
|
|
10316
|
-
const getRandomElement = (arr) => arr?.[new Date().getTime().toString().slice(-1)];
|
|
10317
|
-
const getPercentCategories = (isMainCashback, showIncreasedPercents) => {
|
|
10318
|
-
if (isMainCashback) {
|
|
10319
|
-
return [];
|
|
10320
|
-
}
|
|
10321
|
-
else if (showIncreasedPercents) {
|
|
10322
|
-
return AllPercentCategories;
|
|
10323
|
-
}
|
|
10324
|
-
else {
|
|
10325
|
-
return PercentCategoriesWithoutIncreased;
|
|
10326
|
-
}
|
|
10330
|
+
const MAIN_CASHBACK_KEY = {
|
|
10331
|
+
standard: '1-main',
|
|
10332
|
+
premium: '1.5-main',
|
|
10327
10333
|
};
|
|
10328
|
-
|
|
10329
|
-
const DEFAULT_CASHBACK = [
|
|
10334
|
+
const DEFAULT_STANDARD_CASHBACK = [
|
|
10330
10335
|
{
|
|
10331
10336
|
id: 0,
|
|
10332
10337
|
percent: {
|
|
10333
|
-
text: 'Категория 1%
|
|
10334
|
-
key: '1',
|
|
10338
|
+
text: 'Категория 1% «На всё»',
|
|
10339
|
+
key: '1-main',
|
|
10335
10340
|
},
|
|
10336
10341
|
sum: 5000,
|
|
10337
10342
|
},
|
|
10338
10343
|
];
|
|
10339
|
-
const
|
|
10344
|
+
const DEFAULT_PREMIUM_CASHBACK = [
|
|
10345
|
+
{
|
|
10346
|
+
id: 0,
|
|
10347
|
+
percent: {
|
|
10348
|
+
text: 'Категория 1,5% «На всё»',
|
|
10349
|
+
key: '1.5-main',
|
|
10350
|
+
},
|
|
10351
|
+
sum: 5000,
|
|
10352
|
+
},
|
|
10353
|
+
];
|
|
10354
|
+
// export const INCREASED_PERCENTS = ['5', '10', '15'];
|
|
10355
|
+
const MAX_CATEGORIES = {
|
|
10356
|
+
standard: 5,
|
|
10357
|
+
premium: 7,
|
|
10358
|
+
};
|
|
10359
|
+
const INFO_BLOCK_HTML = `<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров.</p>`;
|
|
10360
|
+
const MAX_MONTH_CASHBACK = {
|
|
10361
|
+
standard: 5000,
|
|
10362
|
+
premium: 15000,
|
|
10363
|
+
};
|
|
10364
|
+
|
|
10365
|
+
const getPercentCategories = (isMainCashbackAdded, calculatorType) => {
|
|
10366
|
+
const allPercentCategories = calculatorType === 'premium' ? ALL_PERCENT_PREMIUM_CATEGORIES : ALL_PERCENT_STANDARD_CATEGORIES;
|
|
10367
|
+
let updatedCategories = allPercentCategories;
|
|
10368
|
+
if (!isMainCashbackAdded) {
|
|
10369
|
+
return allPercentCategories;
|
|
10370
|
+
}
|
|
10371
|
+
if (isMainCashbackAdded) {
|
|
10372
|
+
updatedCategories = updatedCategories.filter((_) => _.key !== MAIN_CASHBACK_KEY[calculatorType]);
|
|
10373
|
+
}
|
|
10374
|
+
return updatedCategories;
|
|
10375
|
+
};
|
|
10376
|
+
|
|
10377
|
+
const defaultDeleteImage = {
|
|
10378
|
+
src: 'IconDelete.svg',
|
|
10379
|
+
format: 'webp',
|
|
10380
|
+
alt: 'Иконка кнопки удаления блока кэшбека',
|
|
10381
|
+
};
|
|
10382
|
+
const CashbackCategory = JSX(({ categories, cashback, maxInputRange, deleteImage = defaultDeleteImage, isMainCashbackAdded = false, calculatorType = 'standard', onDelete, onChange, isShowDisclaimer = false, onChangeCategory = noop, }) => {
|
|
10383
|
+
const [currentCategory, setCurrentCategory] = useState(getRandomElement(categories));
|
|
10384
|
+
const isMainCashback = cashback.percent.key === MAIN_CASHBACK_KEY[calculatorType];
|
|
10385
|
+
const onChangePercent = createChangeHandler(cashback, 'percent', onChange);
|
|
10386
|
+
const onChangeSum = createChangeHandler(cashback, 'sum', onChange);
|
|
10387
|
+
const onChangeCashbackCategory = (value) => {
|
|
10388
|
+
setCurrentCategory(value);
|
|
10389
|
+
onChangeCategory((prev) => updateSelectedCategories(prev, cashback, value));
|
|
10390
|
+
};
|
|
10391
|
+
return (jsxs("div", { className: "w-full space-y-m", children: [jsxs("div", { className: "space-y-xs", children: [jsx(Paragraph, { size: "text-m", color: "text-primary-text", font: "font-light", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E" }), isShowDisclaimer ? (jsx(Text, { size: "text-s", color: "text-primary-text", font: "font-light", className: "italic", children: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438 \u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0434\u043B\u044F \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u0431\u0430\u043B\u043B\u043E\u0432 \u043F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435" })) : null, jsxs("div", { className: "flex gap-m", children: [jsx(Select, { className: "w-full", isManualInput: isMainCashback, placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E", options: getPercentCategories(isMainCashbackAdded, calculatorType), value: cashback.percent, onChange: onChangePercent }), jsx(Button, { version: "secondary", onClick: () => onDelete(cashback.id), shape: "round", className: "px-4 rounded-md", children: jsx(Img, { image: deleteImage }) })] })] }), categories?.length && !isMainCashback ? (jsx(Select, { label: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E \u043F\u043E\u043A\u0443\u043F\u043E\u043A", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E \u043F\u043E\u043A\u0443\u043F\u043E\u043A", options: categories, value: currentCategory, onChange: onChangeCashbackCategory })) : null, jsx(InputRange, { step: 500, title: "\u0421\u0443\u043C\u043C\u0430 \u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0432 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438", min: 0, max: maxInputRange, value: cashback.sum, onChange: onChangeSum })] }));
|
|
10392
|
+
});
|
|
10393
|
+
const getRandomElement = (arr) => arr?.[new Date().getTime().toString().slice(-1)];
|
|
10394
|
+
const createChangeHandler = (obj, field, onChange) => (value) => {
|
|
10395
|
+
onChange({
|
|
10396
|
+
...obj,
|
|
10397
|
+
[field]: value,
|
|
10398
|
+
});
|
|
10399
|
+
};
|
|
10400
|
+
const updateSelectedCategories = (prev, cashback, value) => {
|
|
10401
|
+
const newItem = { id: cashback.id, category: value };
|
|
10402
|
+
if (prev.length === 0) {
|
|
10403
|
+
return [newItem];
|
|
10404
|
+
}
|
|
10405
|
+
const index = prev.findIndex((item) => item.id === cashback.id);
|
|
10406
|
+
if (index !== -1) {
|
|
10407
|
+
const updated = [...prev];
|
|
10408
|
+
updated[index] = newItem;
|
|
10409
|
+
return updated;
|
|
10410
|
+
}
|
|
10411
|
+
return [...prev, newItem];
|
|
10412
|
+
};
|
|
10413
|
+
|
|
10414
|
+
const renderButtons$1 = ({ cashbacksLength, onAddNewCashback, onResetCashback, calculatorType = 'standard', maxCategories = MAX_CATEGORIES[calculatorType], }) => {
|
|
10415
|
+
return (jsxs("div", { className: "w-full flex flex-col gap-lg", children: [cashbacksLength < maxCategories ? (jsx(Button, { className: "self-start text-primary-main", embedded: true, version: "secondary", onClick: onAddNewCashback, children: cashbacksLength ? 'Добавить ещё категорию' : 'Добавить категорию' })) : null, cashbacksLength > 2 ? (jsx(Button, { className: "self-start", version: "secondary", onClick: onResetCashback, children: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u0441\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438" })) : null] }));
|
|
10416
|
+
};
|
|
10417
|
+
|
|
10418
|
+
const CashbackType = {
|
|
10419
|
+
standard: DEFAULT_STANDARD_CASHBACK,
|
|
10420
|
+
premium: DEFAULT_PREMIUM_CASHBACK,
|
|
10421
|
+
};
|
|
10422
|
+
const useCashbackCalculator = (calculatorType) => {
|
|
10340
10423
|
const { data } = useLeadFormData('CASHBACK_CATEGORY');
|
|
10341
|
-
const [cashbacks, setCashbacks] = useState(
|
|
10424
|
+
const [cashbacks, setCashbacks] = useState(CashbackType[calculatorType]);
|
|
10425
|
+
const [selectedCategories, setSelectedCategories] = useState([]);
|
|
10342
10426
|
const categories = data?.map((_) => ({
|
|
10343
10427
|
key: _.key || '',
|
|
10344
10428
|
text: _.value,
|
|
10345
10429
|
})) || [];
|
|
10430
|
+
const filteredCategories = useMemo(() => {
|
|
10431
|
+
const categoriesToRemove = selectedCategories.map((obj) => obj.category);
|
|
10432
|
+
const keysToRemove = new Set(categoriesToRemove.map((item) => item.key));
|
|
10433
|
+
return categories.filter((item) => !keysToRemove.has(item.key));
|
|
10434
|
+
}, [selectedCategories, categories]);
|
|
10346
10435
|
const onAddNewCashback = () => setCashbacks((_) => [
|
|
10347
10436
|
..._,
|
|
10348
10437
|
{
|
|
10349
|
-
id: _[_.length - 1]
|
|
10438
|
+
id: _ && _.length > 0 ? _[_.length - 1]?.id + 1 : 1,
|
|
10350
10439
|
percent: {
|
|
10351
10440
|
text: 'Категория 1,5%',
|
|
10352
10441
|
key: '1.5',
|
|
@@ -10361,14 +10450,15 @@
|
|
|
10361
10450
|
return _;
|
|
10362
10451
|
}));
|
|
10363
10452
|
const onDeleteCashback = (id) => setCashbacks((prev) => prev.filter((_) => _.id !== id));
|
|
10364
|
-
const onResetCashback = () => setCashbacks(
|
|
10453
|
+
const onResetCashback = () => setCashbacks(CashbackType[calculatorType]);
|
|
10365
10454
|
return {
|
|
10366
10455
|
cashbacks,
|
|
10367
|
-
categories,
|
|
10456
|
+
categories: filteredCategories,
|
|
10368
10457
|
onAddNewCashback,
|
|
10369
10458
|
onChangeCashback,
|
|
10370
10459
|
onDeleteCashback,
|
|
10371
10460
|
onResetCashback,
|
|
10461
|
+
onChangeCategory: setSelectedCategories,
|
|
10372
10462
|
};
|
|
10373
10463
|
};
|
|
10374
10464
|
|
|
@@ -10377,19 +10467,27 @@
|
|
|
10377
10467
|
text: 'Оформить карту',
|
|
10378
10468
|
target: '_self',
|
|
10379
10469
|
};
|
|
10380
|
-
const
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
const {
|
|
10385
|
-
const
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
return (
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10470
|
+
const CashbackCalculator = JSX(
|
|
10471
|
+
// eslint-disable-next-line max-lines-per-function
|
|
10472
|
+
({ maxInputRange = 300000, maxCategories, calculatorType = 'standard', maxMonthCashback = MAX_MONTH_CASHBACK[calculatorType], button = defaultButton, className = '', ...rest }) => {
|
|
10473
|
+
const { cashbacks, categories, onAddNewCashback, onChangeCashback, onDeleteCashback, onResetCashback, onChangeCategory, } = useCashbackCalculator(calculatorType);
|
|
10474
|
+
const { deleteImage, infoImage, image } = rest;
|
|
10475
|
+
const [isMainCashbackAdded, setIsMainCashbackAdded] = useState(false);
|
|
10476
|
+
useEffect(() => {
|
|
10477
|
+
setIsMainCashbackAdded(Boolean(cashbacks.find((item) => item.percent.key === MAIN_CASHBACK_KEY[calculatorType])));
|
|
10478
|
+
}, [cashbacks]);
|
|
10479
|
+
return (jsx(BlockWrapper, { className: style('flex flex-col justify-center items-center gap-lg', className), defaultPadding: style('p-0'), ...rest, children: jsxs("div", { className: "flex flex-row items-start gap-lg mt-5", children: [jsxs("div", { className: "w-full flex flex-col justify-center items-center gap-lg", children: [cashbacks.length
|
|
10480
|
+
? cashbacks.map((_, index) => (jsx(CashbackCategory, { categories: categories, cashback: _, maxInputRange: maxInputRange, deleteImage: deleteImage, onDelete: onDeleteCashback, onChange: onChangeCashback, isMainCashbackAdded: isMainCashbackAdded, calculatorType: calculatorType, isShowDisclaimer: index === 0, onChangeCategory: onChangeCategory }, String(_.id))))
|
|
10481
|
+
: renderNoCategoryText(), renderButtons$1({
|
|
10482
|
+
cashbacksLength: cashbacks.length,
|
|
10483
|
+
onAddNewCashback: onAddNewCashback,
|
|
10484
|
+
onResetCashback: onResetCashback,
|
|
10485
|
+
calculatorType: calculatorType,
|
|
10486
|
+
maxCategories,
|
|
10487
|
+
}), jsx(CashbackCalculatorResult, { cashbacks: cashbacks, maxMonthCashback: maxMonthCashback }), jsx(InfoCard, { __html: INFO_BLOCK_HTML, image: infoImage }), jsx(RichText, { __html: '* \u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435 \u043F\u043E \u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C \u0438 \u043D\u0430\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u044F\u043C \u043C\u043E\u0436\u043D\u043E \u0443\u0437\u043D\u0430\u0442\u044C \u0432\u043E \u0432\u043A\u043B\u0430\u0434\u043A\u0435 <a href="#docs">\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u044B</a>' }), jsx(LinkButton, { className: "w-full @lg:w-auto self-start", href: button.href, text: button.text, target: button.target, version: "primary" })] }), renderImage(image)] }) }));
|
|
10488
|
+
});
|
|
10489
|
+
const renderNoCategoryText = () => (jsx(Text, { align: "text-left", className: "w-full", children: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u0430" }));
|
|
10490
|
+
const renderImage = (image = {}) => image?.src ? (jsx(Img, { image: image, className: "hidden w-full @xl:block", imageClassName: "justify-self-center" })) : null;
|
|
10393
10491
|
|
|
10394
10492
|
const CreditCardFormProgress = JSX(({ step = 1, totalSteps = 6, stepsTitles = [] }) => {
|
|
10395
10493
|
const progress = useMemo(() => ((step + 1) / totalSteps) * 100, [step, totalSteps]);
|
|
@@ -14659,7 +14757,7 @@
|
|
|
14659
14757
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
14660
14758
|
});
|
|
14661
14759
|
|
|
14662
|
-
const packageVersion = "0.14.
|
|
14760
|
+
const packageVersion = "0.14.1070";
|
|
14663
14761
|
|
|
14664
14762
|
exports.Blocks = Blocks;
|
|
14665
14763
|
exports.ContentPage = ContentPage;
|