@redneckz/wildless-cms-uni-blocks 0.14.1073 → 0.14.1075
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 +278 -411
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CashbackCalculator/CashbackCalculator.d.ts +2 -7
- package/bundle/components/CashbackCalculator/CashbackCalculatorContent.d.ts +25 -0
- package/bundle/components/CashbackCalculator/CashbackCalculatorResult.d.ts +1 -2
- package/bundle/components/CashbackCalculator/CashbackCategory.d.ts +2 -6
- package/bundle/components/CashbackCalculator/useCashbackCalculator.d.ts +2 -4
- package/bundle/components/GalleryLayout/utils.d.ts +0 -1
- package/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -2
- package/bundle/ui-kit/RichText/RichTextProps.d.ts +0 -2
- package/dist/components/Blocks.js +2 -4
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CashbackCalculator/CashbackCalculator.d.ts +2 -7
- package/dist/components/CashbackCalculator/CashbackCalculator.js +14 -25
- package/dist/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/dist/components/CashbackCalculator/CashbackCalculatorContent.d.ts +25 -0
- package/dist/components/CashbackCalculator/CashbackCalculatorContent.js +1 -0
- package/dist/components/CashbackCalculator/CashbackCalculatorResult.d.ts +1 -2
- package/dist/components/CashbackCalculator/CashbackCalculatorResult.js +11 -9
- package/dist/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/dist/components/CashbackCalculator/CashbackCategory.d.ts +2 -6
- package/dist/components/CashbackCalculator/CashbackCategory.js +54 -33
- package/dist/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/dist/components/CashbackCalculator/useCashbackCalculator.d.ts +2 -4
- package/dist/components/CashbackCalculator/useCashbackCalculator.js +15 -17
- package/dist/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/dist/components/DebitForm/utils.js +2 -2
- package/dist/components/DebitForm/utils.js.map +1 -1
- package/dist/components/GalleryLayout/utils.d.ts +0 -1
- package/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -2
- package/dist/retail/components/DraftDialog/creditProgramCodes.js +2 -2
- package/dist/retail/components/DraftDialog/creditProgramCodes.js.map +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 +0 -2
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -4
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CashbackCalculator/CashbackCalculator.d.ts +2 -7
- package/lib/components/CashbackCalculator/CashbackCalculator.js +14 -25
- package/lib/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/lib/components/CashbackCalculator/CashbackCalculatorContent.d.ts +25 -0
- package/lib/components/CashbackCalculator/CashbackCalculatorContent.js +1 -0
- package/lib/components/CashbackCalculator/CashbackCalculatorResult.d.ts +1 -2
- package/lib/components/CashbackCalculator/CashbackCalculatorResult.js +11 -9
- package/lib/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/lib/components/CashbackCalculator/CashbackCategory.d.ts +2 -6
- package/lib/components/CashbackCalculator/CashbackCategory.js +54 -33
- package/lib/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/lib/components/CashbackCalculator/useCashbackCalculator.d.ts +2 -4
- package/lib/components/CashbackCalculator/useCashbackCalculator.js +16 -18
- package/lib/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/lib/components/DebitForm/utils.js +2 -2
- package/lib/components/DebitForm/utils.js.map +1 -1
- package/lib/components/GalleryLayout/utils.d.ts +0 -1
- package/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -2
- package/lib/retail/components/DraftDialog/creditProgramCodes.js +2 -2
- package/lib/retail/components/DraftDialog/creditProgramCodes.js.map +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 +0 -2
- package/mobile/bundle/bundle.umd.js +71 -157
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CashbackCalculator/CashbackCalculator.d.ts +2 -7
- package/mobile/bundle/components/CashbackCalculator/CashbackCalculatorContent.d.ts +25 -0
- package/mobile/bundle/components/CashbackCalculator/CashbackCalculatorResult.d.ts +1 -2
- package/mobile/bundle/components/CashbackCalculator/CashbackCategory.d.ts +2 -6
- package/mobile/bundle/components/CashbackCalculator/useCashbackCalculator.d.ts +2 -4
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +0 -1
- package/mobile/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -2
- package/mobile/bundle/ui-kit/RichText/RichTextProps.d.ts +0 -2
- package/mobile/dist/components/CashbackCalculator/CashbackCalculator.d.ts +2 -7
- package/mobile/dist/components/CashbackCalculator/CashbackCalculator.js +14 -25
- package/mobile/dist/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorContent.d.ts +25 -0
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorContent.js +1 -0
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorResult.d.ts +1 -2
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorResult.js +11 -9
- package/mobile/dist/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/CashbackCategory.d.ts +2 -6
- package/mobile/dist/components/CashbackCalculator/CashbackCategory.js +54 -33
- package/mobile/dist/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/mobile/dist/components/CashbackCalculator/useCashbackCalculator.d.ts +2 -4
- package/mobile/dist/components/CashbackCalculator/useCashbackCalculator.js +15 -17
- package/mobile/dist/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/mobile/dist/components/DebitForm/utils.js +2 -2
- package/mobile/dist/components/DebitForm/utils.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +0 -1
- package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -2
- package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js +2 -2
- package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js.map +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 +0 -2
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCalculator.d.ts +2 -7
- package/mobile/lib/components/CashbackCalculator/CashbackCalculator.js +14 -25
- package/mobile/lib/components/CashbackCalculator/CashbackCalculator.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorContent.d.ts +25 -0
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorContent.js +1 -0
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorResult.d.ts +1 -2
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorResult.js +11 -9
- package/mobile/lib/components/CashbackCalculator/CashbackCalculatorResult.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/CashbackCategory.d.ts +2 -6
- package/mobile/lib/components/CashbackCalculator/CashbackCategory.js +54 -33
- package/mobile/lib/components/CashbackCalculator/CashbackCategory.js.map +1 -1
- package/mobile/lib/components/CashbackCalculator/useCashbackCalculator.d.ts +2 -4
- package/mobile/lib/components/CashbackCalculator/useCashbackCalculator.js +16 -18
- package/mobile/lib/components/CashbackCalculator/useCashbackCalculator.js.map +1 -1
- package/mobile/lib/components/DebitForm/utils.js +2 -2
- package/mobile/lib/components/DebitForm/utils.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +0 -1
- package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -2
- package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js +2 -2
- package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js.map +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 +0 -2
- package/mobile/src/components/CashbackCalculator/CashbackCalculator.example.json +1 -0
- package/mobile/src/components/CashbackCalculator/CashbackCalculator.tsx +69 -73
- package/mobile/src/components/{CashbackCalculatorLayout/CashbackCalculatorLayout.ui.json → CashbackCalculator/CashbackCalculator.ui.json} +0 -6
- package/mobile/src/components/CashbackCalculator/CashbackCalculatorContent.ts +28 -0
- package/mobile/src/components/CashbackCalculator/CashbackCalculatorResult.tsx +23 -23
- package/mobile/src/components/CashbackCalculator/CashbackCategory.tsx +71 -69
- package/mobile/src/components/CashbackCalculator/useCashbackCalculator.ts +17 -26
- package/mobile/src/components/DebitForm/utils.ts +2 -2
- package/mobile/src/retail/components/DraftDialog/creditProgramCodes.ts +2 -2
- package/mobile/src/ui-kit/RichText/RichText.tsx +1 -9
- package/mobile/src/ui-kit/RichText/RichTextProps.ts +0 -2
- package/package.json +2 -2
- package/src/components/Blocks.ts +2 -4
- package/src/components/CashbackCalculator/CashbackCalculator.example.json +1 -0
- package/src/components/CashbackCalculator/CashbackCalculator.tsx +69 -73
- package/src/components/{CashbackCalculatorLayout/CashbackCalculatorLayout.ui.json → CashbackCalculator/CashbackCalculator.ui.json} +0 -6
- package/src/components/CashbackCalculator/CashbackCalculatorContent.ts +28 -0
- package/src/components/CashbackCalculator/CashbackCalculatorResult.tsx +23 -23
- package/src/components/CashbackCalculator/CashbackCategory.tsx +71 -69
- package/src/components/CashbackCalculator/useCashbackCalculator.ts +17 -26
- package/src/components/DebitForm/utils.ts +2 -2
- package/src/retail/components/DraftDialog/creditProgramCodes.ts +2 -2
- package/src/ui-kit/RichText/RichText.tsx +1 -9
- package/src/ui-kit/RichText/RichTextProps.ts +0 -2
- package/bundle/components/CashbackCalculator/constants.d.ts +0 -16
- package/bundle/components/CashbackCalculator/getPercentCategories.d.ts +0 -1
- package/bundle/components/CashbackCalculator/renderButtons.d.ts +0 -9
- package/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +0 -6
- package/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +0 -38
- package/dist/components/CashbackCalculator/constants.d.ts +0 -16
- package/dist/components/CashbackCalculator/constants.js +0 -89
- package/dist/components/CashbackCalculator/constants.js.map +0 -1
- package/dist/components/CashbackCalculator/getPercentCategories.d.ts +0 -1
- package/dist/components/CashbackCalculator/getPercentCategories.js +0 -16
- package/dist/components/CashbackCalculator/getPercentCategories.js.map +0 -1
- package/dist/components/CashbackCalculator/renderButtons.d.ts +0 -9
- package/dist/components/CashbackCalculator/renderButtons.js +0 -10
- package/dist/components/CashbackCalculator/renderButtons.js.map +0 -1
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +0 -6
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +0 -56
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +0 -1
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +0 -38
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +0 -2
- package/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +0 -1
- package/lib/components/CashbackCalculator/constants.d.ts +0 -16
- package/lib/components/CashbackCalculator/constants.js +0 -87
- package/lib/components/CashbackCalculator/constants.js.map +0 -1
- package/lib/components/CashbackCalculator/getPercentCategories.d.ts +0 -1
- package/lib/components/CashbackCalculator/getPercentCategories.js +0 -13
- package/lib/components/CashbackCalculator/getPercentCategories.js.map +0 -1
- package/lib/components/CashbackCalculator/renderButtons.d.ts +0 -9
- package/lib/components/CashbackCalculator/renderButtons.js +0 -7
- package/lib/components/CashbackCalculator/renderButtons.js.map +0 -1
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +0 -6
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.fixture.d.ts +0 -5
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +0 -54
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +0 -1
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +0 -38
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +0 -2
- package/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +0 -1
- package/mobile/bundle/components/CashbackCalculator/constants.d.ts +0 -16
- package/mobile/bundle/components/CashbackCalculator/getPercentCategories.d.ts +0 -1
- package/mobile/bundle/components/CashbackCalculator/renderButtons.d.ts +0 -9
- package/mobile/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +0 -6
- package/mobile/bundle/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +0 -38
- package/mobile/dist/components/CashbackCalculator/constants.d.ts +0 -16
- package/mobile/dist/components/CashbackCalculator/constants.js +0 -89
- package/mobile/dist/components/CashbackCalculator/constants.js.map +0 -1
- package/mobile/dist/components/CashbackCalculator/getPercentCategories.d.ts +0 -1
- package/mobile/dist/components/CashbackCalculator/getPercentCategories.js +0 -16
- package/mobile/dist/components/CashbackCalculator/getPercentCategories.js.map +0 -1
- package/mobile/dist/components/CashbackCalculator/renderButtons.d.ts +0 -9
- package/mobile/dist/components/CashbackCalculator/renderButtons.js +0 -10
- package/mobile/dist/components/CashbackCalculator/renderButtons.js.map +0 -1
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +0 -6
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +0 -56
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +0 -1
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +0 -38
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +0 -2
- package/mobile/dist/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +0 -1
- package/mobile/lib/components/CashbackCalculator/constants.d.ts +0 -16
- package/mobile/lib/components/CashbackCalculator/constants.js +0 -87
- package/mobile/lib/components/CashbackCalculator/constants.js.map +0 -1
- package/mobile/lib/components/CashbackCalculator/getPercentCategories.d.ts +0 -1
- package/mobile/lib/components/CashbackCalculator/getPercentCategories.js +0 -13
- package/mobile/lib/components/CashbackCalculator/getPercentCategories.js.map +0 -1
- package/mobile/lib/components/CashbackCalculator/renderButtons.d.ts +0 -9
- package/mobile/lib/components/CashbackCalculator/renderButtons.js +0 -7
- package/mobile/lib/components/CashbackCalculator/renderButtons.js.map +0 -1
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.d.ts +0 -6
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js +0 -54
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayout.js.map +0 -1
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.d.ts +0 -38
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js +0 -2
- package/mobile/lib/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.js.map +0 -1
- package/mobile/src/components/CashbackCalculator/constants.ts +0 -97
- package/mobile/src/components/CashbackCalculator/getPercentCategories.ts +0 -24
- package/mobile/src/components/CashbackCalculator/renderButtons.tsx +0 -38
- package/mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.example.json +0 -47
- package/mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.tsx +0 -116
- package/mobile/src/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.ts +0 -49
- package/src/components/CashbackCalculator/constants.ts +0 -97
- package/src/components/CashbackCalculator/getPercentCategories.ts +0 -24
- package/src/components/CashbackCalculator/renderButtons.tsx +0 -38
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.example.json +0 -47
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.fixture.tsx +0 -61
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayout.tsx +0 -116
- package/src/components/CashbackCalculatorLayout/CashbackCalculatorLayoutContent.ts +0 -49
|
@@ -4,88 +4,107 @@ import { type Picture } from '../../model/Picture';
|
|
|
4
4
|
import { Button } from '../../ui-kit/Button/Button';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
6
|
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
7
|
-
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
8
7
|
import { type Option } from '../../ui-kit/Select/Option';
|
|
9
8
|
import { Select } from '../../ui-kit/Select/Select';
|
|
10
9
|
import { Text } from '../../ui-kit/Text/Text';
|
|
11
10
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
import { type Cashback } from './CashbackCalculatorContent';
|
|
12
|
+
|
|
13
|
+
const AllPercentCategories: Option[] = [
|
|
14
|
+
{
|
|
15
|
+
text: 'Категория 1,5%',
|
|
16
|
+
key: '1.5',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: 'Категория 3%',
|
|
20
|
+
key: '3',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
text: 'Категория 5%',
|
|
24
|
+
key: '5',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
text: 'Категория 10%',
|
|
28
|
+
key: '10',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: 'Категория 15%',
|
|
32
|
+
key: '15',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const PercentCategoriesWithoutIncreased: Option[] = [
|
|
37
|
+
{
|
|
38
|
+
text: 'Категория 1,5%',
|
|
39
|
+
key: '1.5',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
text: 'Категория 3%',
|
|
43
|
+
key: '3',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
17
46
|
|
|
18
47
|
export interface CashbackCategoryProps extends UniBlockProps {
|
|
19
48
|
categories?: Option[];
|
|
20
49
|
cashback: Cashback;
|
|
50
|
+
showIncreasedPercents: boolean;
|
|
21
51
|
maxInputRange: number;
|
|
22
52
|
deleteImage?: Picture;
|
|
23
53
|
onDelete: (id: number) => void;
|
|
24
54
|
onChange: (item: Cashback) => void;
|
|
25
|
-
isMainCashbackAdded?: boolean;
|
|
26
|
-
calculatorType?: string;
|
|
27
|
-
isShowDisclaimer?: boolean;
|
|
28
|
-
onChangeCategory: (item: (prev: SelectedCategory[]) => any) => void;
|
|
29
55
|
}
|
|
30
56
|
|
|
31
|
-
const defaultDeleteImage: Picture = {
|
|
32
|
-
src: 'IconDelete.svg',
|
|
33
|
-
format: 'webp',
|
|
34
|
-
alt: 'Иконка кнопки удаления блока кэшбека',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
57
|
export const CashbackCategory = JSX<CashbackCategoryProps>(
|
|
38
58
|
({
|
|
39
59
|
categories,
|
|
40
60
|
cashback,
|
|
61
|
+
showIncreasedPercents,
|
|
41
62
|
maxInputRange,
|
|
42
|
-
deleteImage
|
|
43
|
-
isMainCashbackAdded = false,
|
|
44
|
-
calculatorType = 'standard',
|
|
63
|
+
deleteImage,
|
|
45
64
|
onDelete,
|
|
46
65
|
onChange,
|
|
47
|
-
isShowDisclaimer = false,
|
|
48
|
-
onChangeCategory = noop,
|
|
49
66
|
}) => {
|
|
50
67
|
const [currentCategory, setCurrentCategory] = useState(getRandomElement(categories));
|
|
51
|
-
const isMainCashback = cashback.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
const isMainCashback = cashback.id === 0;
|
|
69
|
+
const onChangePercent = (value: Option) => {
|
|
70
|
+
onChange({
|
|
71
|
+
...cashback,
|
|
72
|
+
percent: value,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
55
75
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
const onChangeSum = (value: number) => {
|
|
77
|
+
onChange({
|
|
78
|
+
...cashback,
|
|
79
|
+
sum: value,
|
|
80
|
+
});
|
|
59
81
|
};
|
|
60
82
|
|
|
61
83
|
return (
|
|
62
84
|
<div className="w-full space-y-m">
|
|
63
85
|
<div className="space-y-xs">
|
|
64
|
-
<
|
|
86
|
+
<Text size="text-m" color="text-primary-text" font="font-light">
|
|
65
87
|
Выберите категорию
|
|
66
|
-
</
|
|
67
|
-
{isShowDisclaimer ? (
|
|
68
|
-
<Text size="text-s" color="text-primary-text" font="font-light" className="italic">
|
|
69
|
-
Категории покупок для расчёта баллов предварительные
|
|
70
|
-
</Text>
|
|
71
|
-
) : null}
|
|
88
|
+
</Text>
|
|
72
89
|
<div className="flex gap-m">
|
|
73
90
|
<Select
|
|
74
91
|
className="w-full"
|
|
75
92
|
isManualInput={isMainCashback}
|
|
76
93
|
placeholder="Выберите категорию"
|
|
77
|
-
options={getPercentCategories(
|
|
94
|
+
options={getPercentCategories(isMainCashback, showIncreasedPercents)}
|
|
78
95
|
value={cashback.percent}
|
|
79
96
|
onChange={onChangePercent}
|
|
80
97
|
/>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
98
|
+
{!isMainCashback ? (
|
|
99
|
+
<Button
|
|
100
|
+
version="secondary"
|
|
101
|
+
onClick={() => onDelete(cashback.id)}
|
|
102
|
+
shape="round"
|
|
103
|
+
className="px-4 rounded-md"
|
|
104
|
+
>
|
|
105
|
+
<Img image={deleteImage} />
|
|
106
|
+
</Button>
|
|
107
|
+
) : null}
|
|
89
108
|
</div>
|
|
90
109
|
</div>
|
|
91
110
|
{categories?.length && !isMainCashback ? (
|
|
@@ -94,7 +113,7 @@ export const CashbackCategory = JSX<CashbackCategoryProps>(
|
|
|
94
113
|
placeholder="Выберите категорию покупок"
|
|
95
114
|
options={categories}
|
|
96
115
|
value={currentCategory}
|
|
97
|
-
onChange={
|
|
116
|
+
onChange={setCurrentCategory}
|
|
98
117
|
/>
|
|
99
118
|
) : null}
|
|
100
119
|
<InputRange
|
|
@@ -113,29 +132,12 @@ export const CashbackCategory = JSX<CashbackCategoryProps>(
|
|
|
113
132
|
const getRandomElement = <T,>(arr?: T[]): T | undefined =>
|
|
114
133
|
arr?.[new Date().getTime().toString().slice(-1)];
|
|
115
134
|
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const updateSelectedCategories = (prev: SelectedCategory[], cashback: Cashback, value: Option) => {
|
|
126
|
-
const newItem = { id: cashback.id, category: value };
|
|
127
|
-
|
|
128
|
-
if (prev.length === 0) {
|
|
129
|
-
return [newItem];
|
|
135
|
+
const getPercentCategories = (isMainCashback: boolean, showIncreasedPercents: boolean) => {
|
|
136
|
+
if (isMainCashback) {
|
|
137
|
+
return [];
|
|
138
|
+
} else if (showIncreasedPercents) {
|
|
139
|
+
return AllPercentCategories;
|
|
140
|
+
} else {
|
|
141
|
+
return PercentCategoriesWithoutIncreased;
|
|
130
142
|
}
|
|
131
|
-
const index = prev.findIndex((item) => item.id === cashback.id);
|
|
132
|
-
|
|
133
|
-
if (index !== -1) {
|
|
134
|
-
const updated = [...prev];
|
|
135
|
-
updated[index] = newItem;
|
|
136
|
-
|
|
137
|
-
return updated;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return [...prev, newItem];
|
|
141
143
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useLeadFormData } from '../../retail/hooks/useLeadFormData';
|
|
3
3
|
import { type DictionaryItem } from '../../retail/model/LeadFormData';
|
|
4
4
|
import { type Option } from '../../ui-kit/Select/Option';
|
|
5
|
-
import {
|
|
6
|
-
type Cashback,
|
|
7
|
-
type CashbackCalculatorType,
|
|
8
|
-
} from '../CashbackCalculatorLayout/CashbackCalculatorLayoutContent';
|
|
9
|
-
import { type SelectedCategory } from './CashbackCalculator';
|
|
10
|
-
import { DEFAULT_PREMIUM_CASHBACK, DEFAULT_STANDARD_CASHBACK } from './constants';
|
|
5
|
+
import { type Cashback } from './CashbackCalculatorContent';
|
|
11
6
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
const DEFAULT_CASHBACK: Cashback[] = [
|
|
8
|
+
{
|
|
9
|
+
id: 0,
|
|
10
|
+
percent: {
|
|
11
|
+
text: 'Категория 1% "На всё"',
|
|
12
|
+
key: '1',
|
|
13
|
+
},
|
|
14
|
+
sum: 5000,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
16
17
|
|
|
17
|
-
export const useCashbackCalculator = (
|
|
18
|
+
export const useCashbackCalculator = () => {
|
|
18
19
|
const { data } = useLeadFormData('CASHBACK_CATEGORY');
|
|
19
|
-
const [cashbacks, setCashbacks] = useState<Cashback[]>(
|
|
20
|
-
|
|
21
|
-
const [selectedCategories, setSelectedCategories] = useState<SelectedCategory[]>([]);
|
|
20
|
+
const [cashbacks, setCashbacks] = useState<Cashback[]>(DEFAULT_CASHBACK);
|
|
22
21
|
|
|
23
22
|
const categories: Option[] =
|
|
24
23
|
data?.map((_: DictionaryItem) => ({
|
|
@@ -26,18 +25,11 @@ export const useCashbackCalculator = (calculatorType: CashbackCalculatorType) =>
|
|
|
26
25
|
text: _.value,
|
|
27
26
|
})) || [];
|
|
28
27
|
|
|
29
|
-
const filteredCategories = useMemo(() => {
|
|
30
|
-
const categoriesToRemove: Option[] = selectedCategories.map((obj) => obj.category);
|
|
31
|
-
const keysToRemove = new Set(categoriesToRemove.map((item) => item.key));
|
|
32
|
-
|
|
33
|
-
return categories.filter((item) => !keysToRemove.has(item.key));
|
|
34
|
-
}, [selectedCategories, categories]);
|
|
35
|
-
|
|
36
28
|
const onAddNewCashback = () =>
|
|
37
29
|
setCashbacks((_) => [
|
|
38
30
|
..._,
|
|
39
31
|
{
|
|
40
|
-
id: _
|
|
32
|
+
id: _[_.length - 1].id + 1,
|
|
41
33
|
percent: {
|
|
42
34
|
text: 'Категория 1,5%',
|
|
43
35
|
key: '1.5',
|
|
@@ -59,15 +51,14 @@ export const useCashbackCalculator = (calculatorType: CashbackCalculatorType) =>
|
|
|
59
51
|
|
|
60
52
|
const onDeleteCashback = (id: number) => setCashbacks((prev) => prev.filter((_) => _.id !== id));
|
|
61
53
|
|
|
62
|
-
const onResetCashback = () => setCashbacks(
|
|
54
|
+
const onResetCashback = () => setCashbacks(DEFAULT_CASHBACK);
|
|
63
55
|
|
|
64
56
|
return {
|
|
65
57
|
cashbacks,
|
|
66
|
-
categories
|
|
58
|
+
categories,
|
|
67
59
|
onAddNewCashback,
|
|
68
60
|
onChangeCashback,
|
|
69
61
|
onDeleteCashback,
|
|
70
62
|
onResetCashback,
|
|
71
|
-
onChangeCategory: setSelectedCategories,
|
|
72
63
|
};
|
|
73
64
|
};
|
|
@@ -9,6 +9,6 @@ export const debitProgrammIdToCardCodesMap = {
|
|
|
9
9
|
44: 'appetit_debit_card',
|
|
10
10
|
46: 'owner_debit_card_plus',
|
|
11
11
|
47: 'owner_debit_card_pens_plus',
|
|
12
|
-
48: '
|
|
13
|
-
49: '
|
|
12
|
+
48: 'salary_debit_card_48',
|
|
13
|
+
49: 'salary_debit_card_49',
|
|
14
14
|
};
|
|
@@ -27,8 +27,8 @@ const debitCardCodesToProgrammIdMap = {
|
|
|
27
27
|
appetit_debit_card: '44',
|
|
28
28
|
owner_debit_card_plus: '46',
|
|
29
29
|
owner_debit_card_pens_plus: '47',
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
salary_debit_card_48: '48',
|
|
31
|
+
salary_debit_card_49: '49',
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const cardCodesToProgrammIdMap = {
|
|
@@ -3,14 +3,7 @@ import { style } from '../../utils/style';
|
|
|
3
3
|
import { type RichTextProps } from './RichTextProps';
|
|
4
4
|
|
|
5
5
|
export const RichText = JSX<RichTextProps>(
|
|
6
|
-
({
|
|
7
|
-
__html = '',
|
|
8
|
-
richVersion = '',
|
|
9
|
-
itemSize = 'list-m',
|
|
10
|
-
className,
|
|
11
|
-
isDotted = true,
|
|
12
|
-
children,
|
|
13
|
-
}) => {
|
|
6
|
+
({ __html = '', richVersion = '', itemSize = 'list-m', isDotted = true, children }) => {
|
|
14
7
|
const dotStyle = isDotted ? '' : 'without-dots';
|
|
15
8
|
|
|
16
9
|
return __html || children ? (
|
|
@@ -22,7 +15,6 @@ export const RichText = JSX<RichTextProps>(
|
|
|
22
15
|
itemSize,
|
|
23
16
|
'md-container group-data-secondary:text-white group-data-gray:text-secondary-text',
|
|
24
17
|
dotStyle,
|
|
25
|
-
className,
|
|
26
18
|
)}
|
|
27
19
|
dangerouslySetInnerHTML={__html ? { __html } : undefined}
|
|
28
20
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1075",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"path": "lib/common.css"
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
|
-
"limit": "
|
|
208
|
+
"limit": "120 kB",
|
|
209
209
|
"path": "bundle/bundle.umd.min.js"
|
|
210
210
|
}
|
|
211
211
|
],
|
package/src/components/Blocks.ts
CHANGED
|
@@ -19,7 +19,6 @@ import { CarouselCatalogCard } from './CarouselCatalogCard/CarouselCatalogCard';
|
|
|
19
19
|
import { CarouselRecommendationCard } from './CarouselRecommendationCard/CarouselRecommendationCard';
|
|
20
20
|
import { CarouselTariffsCard } from './CarouselTariffsCard/CarouselTariffsCard';
|
|
21
21
|
import { CashbackCalculator } from './CashbackCalculator/CashbackCalculator';
|
|
22
|
-
import { CashbackCalculatorLayout } from './CashbackCalculatorLayout/CashbackCalculatorLayout';
|
|
23
22
|
import { ContactsBlock } from './ContactsBlock/ContactsBlock';
|
|
24
23
|
import { CreditCardForm } from './CreditCardForm/CreditCardForm';
|
|
25
24
|
import { CreditForm } from './CreditForm/CreditForm';
|
|
@@ -87,19 +86,18 @@ export const Blocks: BlocksRegistry = {
|
|
|
87
86
|
RollupItem,
|
|
88
87
|
StepsBlock,
|
|
89
88
|
StickyBottomMenu,
|
|
90
|
-
TextBlock,
|
|
91
89
|
TabsLayout,
|
|
92
90
|
TariffsTable,
|
|
91
|
+
TextBlock,
|
|
93
92
|
VerticalLayout,
|
|
94
93
|
Video,
|
|
95
94
|
ApplicationLeadForm,
|
|
96
95
|
CreditCardForm,
|
|
97
96
|
CreditForm,
|
|
98
97
|
DebitForm,
|
|
98
|
+
CashbackCalculator,
|
|
99
99
|
CalculatorRko,
|
|
100
100
|
RkoTariffCardsTable,
|
|
101
101
|
RatesTable,
|
|
102
102
|
ReferalForm,
|
|
103
|
-
CashbackCalculator,
|
|
104
|
-
CashbackCalculatorLayout,
|
|
105
103
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import { type Picture } from '../../model/Picture';
|
|
4
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
5
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
5
|
import { InfoCard } from '../../ui-kit/InfoCard/InfoCard';
|
|
7
6
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
8
|
-
import type
|
|
9
|
-
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
10
|
-
import { type Option } from '../../ui-kit/Select/Option';
|
|
11
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
7
|
+
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
12
8
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
13
9
|
import { style } from '../../utils/style';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
type CashbackCalculatorLayoutContent,
|
|
17
|
-
} from '../CashbackCalculatorLayout/CashbackCalculatorLayoutContent';
|
|
10
|
+
import { Headline } from '../Headline/Headline';
|
|
11
|
+
import { type Cashback, type CashbackCalculatorContent } from './CashbackCalculatorContent';
|
|
18
12
|
import { CashbackCalculatorResult } from './CashbackCalculatorResult';
|
|
19
13
|
import { CashbackCategory } from './CashbackCategory';
|
|
20
|
-
import { INFO_BLOCK_HTML, MAIN_CASHBACK_KEY, MAX_MONTH_CASHBACK } from './constants';
|
|
21
|
-
import { renderButtons } from './renderButtons';
|
|
22
14
|
import { useCashbackCalculator } from './useCashbackCalculator';
|
|
23
15
|
|
|
24
16
|
const defaultButton: LinkButtonContent = {
|
|
@@ -27,25 +19,22 @@ const defaultButton: LinkButtonContent = {
|
|
|
27
19
|
target: '_self',
|
|
28
20
|
};
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
extends CalculatorParams,
|
|
32
|
-
CashbackCalculatorLayoutContent,
|
|
33
|
-
UniBlockProps {}
|
|
22
|
+
const INCREASED_PERCENTS = ['5', '10', '15'];
|
|
34
23
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
const MAX_CATEGORIES = 5;
|
|
25
|
+
|
|
26
|
+
const INFO_BLOCK_HTML = `<p>Полученные баллы можно конвертировать в рубли и компенсировать покупки у партнеров. Подробнее в <a href='#docs'>документах</a></p>`;
|
|
27
|
+
|
|
28
|
+
interface CashbackCalculatorProps extends CashbackCalculatorContent, UniBlockProps {}
|
|
39
29
|
|
|
40
30
|
export const CashbackCalculator = JSX<CashbackCalculatorProps>(
|
|
41
|
-
// eslint-disable-next-line max-lines-per-function
|
|
42
31
|
({
|
|
43
32
|
maxInputRange = 300000,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
button = defaultButton,
|
|
33
|
+
image,
|
|
34
|
+
deleteImage,
|
|
35
|
+
infoImage,
|
|
48
36
|
className = '',
|
|
37
|
+
button = defaultButton,
|
|
49
38
|
...rest
|
|
50
39
|
}) => {
|
|
51
40
|
const {
|
|
@@ -55,53 +44,41 @@ export const CashbackCalculator = JSX<CashbackCalculatorProps>(
|
|
|
55
44
|
onChangeCashback,
|
|
56
45
|
onDeleteCashback,
|
|
57
46
|
onResetCashback,
|
|
58
|
-
|
|
59
|
-
} = useCashbackCalculator(calculatorType);
|
|
60
|
-
|
|
61
|
-
const { deleteImage, infoImage, image } = rest;
|
|
62
|
-
const [isMainCashbackAdded, setIsMainCashbackAdded] = useState(false);
|
|
47
|
+
} = useCashbackCalculator();
|
|
63
48
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
);
|
|
68
|
-
}, [cashbacks]);
|
|
49
|
+
const img = image?.src ? (
|
|
50
|
+
<Img image={image} className="hidden w-full @xl:block" imageClassName="justify-self-center" />
|
|
51
|
+
) : null;
|
|
69
52
|
|
|
70
53
|
return (
|
|
71
54
|
<BlockWrapper
|
|
72
55
|
className={style('flex flex-col justify-center items-center gap-lg', className)}
|
|
73
|
-
defaultPadding={style('p-
|
|
56
|
+
defaultPadding={style('p-6xl')}
|
|
74
57
|
{...rest}
|
|
75
58
|
>
|
|
76
|
-
<
|
|
59
|
+
<Headline
|
|
60
|
+
title="Калькулятор расчета баллов"
|
|
61
|
+
description="Можно выбрать не более 5 категорий, одна из них из повышенной категории"
|
|
62
|
+
headlineVersion="XL"
|
|
63
|
+
isEmbedded={true}
|
|
64
|
+
/>
|
|
65
|
+
<div className="flex flex-row items-start gap-lg">
|
|
77
66
|
<div className="w-full flex flex-col justify-center items-center gap-lg">
|
|
78
|
-
{cashbacks.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/>
|
|
93
|
-
))
|
|
94
|
-
: renderNoCategoryText()}
|
|
95
|
-
{renderButtons({
|
|
96
|
-
cashbacksLength: cashbacks.length,
|
|
97
|
-
onAddNewCashback: onAddNewCashback,
|
|
98
|
-
onResetCashback: onResetCashback,
|
|
99
|
-
calculatorType: calculatorType,
|
|
100
|
-
maxCategories,
|
|
101
|
-
})}
|
|
102
|
-
<CashbackCalculatorResult cashbacks={cashbacks} maxMonthCashback={maxMonthCashback} />
|
|
67
|
+
{cashbacks.map((_) => (
|
|
68
|
+
<CashbackCategory
|
|
69
|
+
key={String(_.id)}
|
|
70
|
+
categories={categories}
|
|
71
|
+
cashback={_}
|
|
72
|
+
showIncreasedPercents={showIncreasedPercents(_, cashbacks)}
|
|
73
|
+
maxInputRange={maxInputRange}
|
|
74
|
+
deleteImage={deleteImage}
|
|
75
|
+
onDelete={onDeleteCashback}
|
|
76
|
+
onChange={onChangeCashback}
|
|
77
|
+
/>
|
|
78
|
+
))}
|
|
79
|
+
{renderButtons(cashbacks.length, onAddNewCashback, onResetCashback)}
|
|
80
|
+
<CashbackCalculatorResult cashbacks={cashbacks} />
|
|
103
81
|
<InfoCard __html={INFO_BLOCK_HTML} image={infoImage} />
|
|
104
|
-
<RichText __html='* Подробнее по условиям и начислениям можно узнать во вкладке <a href="#docs">документы</a>' />
|
|
105
82
|
<LinkButton
|
|
106
83
|
className="w-full @lg:w-auto self-start"
|
|
107
84
|
href={button.href}
|
|
@@ -110,20 +87,39 @@ export const CashbackCalculator = JSX<CashbackCalculatorProps>(
|
|
|
110
87
|
version="primary"
|
|
111
88
|
/>
|
|
112
89
|
</div>
|
|
113
|
-
{
|
|
90
|
+
{img}
|
|
114
91
|
</div>
|
|
115
92
|
</BlockWrapper>
|
|
116
93
|
);
|
|
117
94
|
},
|
|
118
95
|
);
|
|
119
96
|
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
)
|
|
97
|
+
const renderButtons = (
|
|
98
|
+
cashbacksLength: number,
|
|
99
|
+
onAddNewCashback: () => void,
|
|
100
|
+
onResetCashback: () => void,
|
|
101
|
+
) => {
|
|
102
|
+
return (
|
|
103
|
+
<div className="w-full flex flex-col gap-lg">
|
|
104
|
+
{cashbacksLength < MAX_CATEGORIES ? (
|
|
105
|
+
<Button
|
|
106
|
+
className="self-start text-primary-main"
|
|
107
|
+
embedded
|
|
108
|
+
version="secondary"
|
|
109
|
+
onClick={onAddNewCashback}
|
|
110
|
+
>
|
|
111
|
+
Добавить еще
|
|
112
|
+
</Button>
|
|
113
|
+
) : null}
|
|
114
|
+
{cashbacksLength > 2 ? (
|
|
115
|
+
<Button className="self-start" version="secondary" onClick={onResetCashback}>
|
|
116
|
+
Сбросить все категории
|
|
117
|
+
</Button>
|
|
118
|
+
) : null}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
125
122
|
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
) : null;
|
|
123
|
+
const showIncreasedPercents = (currentCashback: Cashback, cashback: Cashback[]) =>
|
|
124
|
+
INCREASED_PERCENTS.includes(currentCashback.percent.key) ||
|
|
125
|
+
!cashback.some((_) => INCREASED_PERCENTS.includes(_.percent.key));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type TitleProps } from '../../model/HeadlineType';
|
|
2
|
+
import { type Picture } from '../../model/Picture';
|
|
3
|
+
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
4
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
5
|
+
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
6
|
+
|
|
7
|
+
export type Cashback = {
|
|
8
|
+
id: number;
|
|
9
|
+
percent: Option;
|
|
10
|
+
sum: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title Блок калькулятора кэшбека
|
|
15
|
+
*/
|
|
16
|
+
export type CashbackCalculatorContent = UniBlockContent &
|
|
17
|
+
TitleProps & {
|
|
18
|
+
/** @title Кнопка */
|
|
19
|
+
button?: LinkButtonContent;
|
|
20
|
+
/** @title Максимальное значение поля 'Сумма покупок в категории' */
|
|
21
|
+
maxInputRange?: number;
|
|
22
|
+
/** @title Изображение */
|
|
23
|
+
image?: Picture;
|
|
24
|
+
/** @title Иконка кнопки удаления категории */
|
|
25
|
+
deleteImage?: Picture;
|
|
26
|
+
/** @title Иконка информационного блока */
|
|
27
|
+
infoImage?: Picture;
|
|
28
|
+
};
|