@redneckz/wildless-cms-uni-blocks 0.9.9 → 0.9.11
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/bin/migration-scripts/0.9.9.js +0 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +30 -24
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
- package/bundle/components/Footer/SocialMedia.d.ts +1 -1
- package/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/dist/components/Filtration/Filtration.js +1 -1
- package/dist/components/Filtration/Filtration.js.map +1 -1
- package/dist/components/Filtration/FiltrationContent.d.ts +18 -8
- package/dist/components/Filtration/FiltrationInner.js +9 -5
- package/dist/components/Filtration/FiltrationInner.js.map +1 -1
- package/dist/components/Filtration/renderFormItem.js +6 -5
- package/dist/components/Filtration/renderFormItem.js.map +1 -1
- package/dist/components/Footer/MediaButton.js +6 -7
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Footer/SocialMedia.d.ts +1 -1
- package/dist/components/Footer/SocialMedia.js +2 -2
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +2 -10
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.fixture.d.ts +2 -0
- package/lib/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/lib/components/Filtration/Filtration.js +1 -1
- package/lib/components/Filtration/Filtration.js.map +1 -1
- package/lib/components/Filtration/FiltrationContent.d.ts +18 -8
- package/lib/components/Filtration/FiltrationInner.js +9 -5
- package/lib/components/Filtration/FiltrationInner.js.map +1 -1
- package/lib/components/Filtration/renderFormItem.js +6 -5
- package/lib/components/Filtration/renderFormItem.js.map +1 -1
- package/lib/components/Footer/MediaButton.js +6 -7
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Footer/SocialMedia.d.ts +1 -1
- package/lib/components/Footer/SocialMedia.js +2 -2
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/bundle/bundle.umd.js +7 -8
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/mobile/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
- package/mobile/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/mobile/dist/components/Filtration/Filtration.js +1 -1
- package/mobile/dist/components/Filtration/Filtration.js.map +1 -1
- package/mobile/dist/components/Filtration/FiltrationContent.d.ts +18 -8
- package/mobile/dist/components/Filtration/FiltrationInner.js +9 -5
- package/mobile/dist/components/Filtration/FiltrationInner.js.map +1 -1
- package/mobile/dist/components/Filtration/renderFormItem.js +6 -5
- package/mobile/dist/components/Filtration/renderFormItem.js.map +1 -1
- package/mobile/dist/components/Footer/MediaButton.js +6 -7
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +1 -1
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +5 -2
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
- package/mobile/lib/components/Filtration/Filtration.js +1 -1
- package/mobile/lib/components/Filtration/Filtration.js.map +1 -1
- package/mobile/lib/components/Filtration/FiltrationContent.d.ts +18 -8
- package/mobile/lib/components/Filtration/FiltrationInner.js +9 -5
- package/mobile/lib/components/Filtration/FiltrationInner.js.map +1 -1
- package/mobile/lib/components/Filtration/renderFormItem.js +6 -5
- package/mobile/lib/components/Filtration/renderFormItem.js.map +1 -1
- package/mobile/lib/components/Footer/MediaButton.js +6 -7
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +2 -4
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +2 -2
- package/mobile/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +3 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +3 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +5 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +4 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +4 -2
- package/mobile/src/components/ErrorBlock/ErrorBlock.example.json +3 -1
- package/mobile/src/components/Filtration/Filtration.example.json +39 -19
- package/mobile/src/components/Filtration/Filtration.tsx +3 -8
- package/mobile/src/components/Filtration/FiltrationContent.ts +19 -8
- package/mobile/src/components/Filtration/FiltrationInner.tsx +31 -12
- package/mobile/src/components/Filtration/renderFormItem.tsx +20 -20
- package/mobile/src/components/Footer/MediaButton.tsx +7 -10
- package/mobile/src/components/MobileAppTile/MobileAppTile.example.json +3 -1
- package/mobile/src/components/PictureText/PictureText.example.json +3 -1
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +3 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +3 -1
- package/mobile/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
- package/mobile/src/components/Tile/Tile.example.json +3 -1
- package/mobile/src/components/VerticalLayout/VerticalLayoutContent.ts +0 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
- package/src/components/Carousel/Carousel.fixture.tsx +18 -5
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +2 -9
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +2 -4
- package/src/components/CarouselEventCard/CarouselEventCard.tsx +2 -2
- package/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +3 -1
- package/src/components/CarouselProductCard/CarouselProductCard.example.json +3 -1
- package/src/components/CarouselProductCard/CarouselProductCard.fixture.tsx +10 -0
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +5 -1
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +4 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +4 -2
- package/src/components/ErrorBlock/ErrorBlock.example.json +3 -1
- package/src/components/Filtration/Filtration.example.json +39 -19
- package/src/components/Filtration/Filtration.fixture.tsx +36 -20
- package/src/components/Filtration/Filtration.tsx +3 -8
- package/src/components/Filtration/FiltrationContent.ts +19 -8
- package/src/components/Filtration/FiltrationInner.tsx +31 -12
- package/src/components/Filtration/renderFormItem.tsx +20 -20
- package/src/components/Footer/MediaButton.tsx +7 -10
- package/src/components/Footer/SocialMedia.tsx +3 -11
- package/src/components/MobileAppTile/MobileAppTile.example.json +3 -1
- package/src/components/PictureText/PictureText.example.json +3 -1
- package/src/components/ProductBlock/ProductBlock.example.json +3 -1
- package/src/components/ProductTile/ProductTile.example.json +3 -1
- package/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
- package/src/components/Tile/Tile.example.json +3 -1
- package/src/components/VerticalLayout/VerticalLayoutContent.ts +0 -2
|
@@ -46,6 +46,13 @@ export const PRODUCT_CARD: CarouselProductCardContent = {
|
|
|
46
46
|
additionalDescription: 'Дополнительное описание',
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
export const PRODUCT_CARD_SMALL: CarouselProductCardContent = {
|
|
50
|
+
title: 'Более 5000 товаров Более 5000 товаров Более 5000 товаров',
|
|
51
|
+
icon: image,
|
|
52
|
+
button: buttonPrimary,
|
|
53
|
+
isDotted,
|
|
54
|
+
};
|
|
55
|
+
|
|
49
56
|
const CAROUSEL_PRODUCT_CARD = <CarouselProductCard {...PRODUCT_CARD} />;
|
|
50
57
|
const CAROUSEL_PRODUCT_CARD_SECONDARY = (
|
|
51
58
|
<CarouselProductCard
|
|
@@ -53,10 +60,13 @@ const CAROUSEL_PRODUCT_CARD_SECONDARY = (
|
|
|
53
60
|
version="secondary"
|
|
54
61
|
isDotted={true}
|
|
55
62
|
button={buttonPrimaryIcon}
|
|
63
|
+
isFullWidth={false}
|
|
56
64
|
/>
|
|
57
65
|
);
|
|
66
|
+
const CAROUSEL_PRODUCT_CARD_SMALL = <CarouselProductCard {...PRODUCT_CARD_SMALL} />;
|
|
58
67
|
|
|
59
68
|
export default {
|
|
60
69
|
default: <div className="container grid grid-cols-12">{CAROUSEL_PRODUCT_CARD}</div>,
|
|
61
70
|
secondary: <div className="container grid grid-cols-12">{CAROUSEL_PRODUCT_CARD_SECONDARY}</div>,
|
|
71
|
+
small: <div className="container grid grid-cols-12">{CAROUSEL_PRODUCT_CARD_SMALL}</div>,
|
|
62
72
|
};
|
|
@@ -26,6 +26,7 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
|
26
26
|
href,
|
|
27
27
|
icon,
|
|
28
28
|
isDotted = true,
|
|
29
|
+
isFullWidth = true,
|
|
29
30
|
items = [],
|
|
30
31
|
target,
|
|
31
32
|
title,
|
|
@@ -50,7 +51,10 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
|
50
51
|
{renderItems(items, isDotted, version)}
|
|
51
52
|
{renderAdditionalDescription(additionalDescription)}
|
|
52
53
|
</LinkWrapper>
|
|
53
|
-
{renderButtonsSection([button], {
|
|
54
|
+
{renderButtonsSection([button], {
|
|
55
|
+
className: style('p-6 pt-0', isFullWidth ? '' : 'justify-center'),
|
|
56
|
+
isVertical: isFullWidth ? true : false,
|
|
57
|
+
})}
|
|
54
58
|
</BlockWrapper>
|
|
55
59
|
);
|
|
56
60
|
},
|
|
@@ -3,35 +3,55 @@
|
|
|
3
3
|
"filtrationSchema": {
|
|
4
4
|
"propertyType": {
|
|
5
5
|
"title": "Тип недвижимости",
|
|
6
|
-
"type": "
|
|
7
|
-
"
|
|
8
|
-
|
|
6
|
+
"type": "array",
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": ["flat", "apartment", "house", "storeRoom", "parkingSpace"],
|
|
10
|
+
"enumNames": ["Квартира", "Апартаменты", "Жилой дом", "Кладовая", "Машино-место"]
|
|
11
|
+
}
|
|
9
12
|
},
|
|
10
13
|
"stage": {
|
|
11
14
|
"title": "Этап строительства",
|
|
12
|
-
"type": "
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"enum": ["built", "inProgress"],
|
|
19
|
+
"enumNames": ["Готовое жильё", "Строящиеся"]
|
|
20
|
+
}
|
|
15
21
|
},
|
|
16
22
|
"categories": {
|
|
17
23
|
"title": "Категории",
|
|
18
|
-
"type": "
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": ["salaryClient", "IT", "youngFamily", "military", "medicalWorker", "scientist"],
|
|
28
|
+
"enumNames": [
|
|
29
|
+
"Зарплатный клиент",
|
|
30
|
+
"IT-специалист",
|
|
31
|
+
"Молодая семья",
|
|
32
|
+
"Военнослужащий",
|
|
33
|
+
"Медицинский работник",
|
|
34
|
+
"Научный сотрудник"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
28
37
|
},
|
|
29
38
|
"extraOptions": {
|
|
30
39
|
"title": "Дополнительно",
|
|
31
|
-
"type": "
|
|
32
|
-
"
|
|
33
|
-
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["preferentialMortgage", "children"],
|
|
44
|
+
"enumNames": ["Льготная ипотека", "Дети"]
|
|
45
|
+
}
|
|
34
46
|
}
|
|
47
|
+
},
|
|
48
|
+
"resetButton": {
|
|
49
|
+
"text": "Очистить фильтры",
|
|
50
|
+
"version": "secondary"
|
|
51
|
+
},
|
|
52
|
+
"notFound": {
|
|
53
|
+
"title": "Нет подходящей ипотечной программы",
|
|
54
|
+
"description": "Попробуйте очистить фильтры"
|
|
35
55
|
}
|
|
36
56
|
}
|
|
37
57
|
}
|
|
@@ -49,34 +49,46 @@ const generateBlock = (...presets: any[]) => ({
|
|
|
49
49
|
const SCHEMA: FiltrationContent['filtrationSchema'] = {
|
|
50
50
|
propertyType: {
|
|
51
51
|
title: 'Тип недвижимости',
|
|
52
|
-
type: '
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
type: 'array',
|
|
53
|
+
items: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
enum: ['flat', 'apartment', 'house', 'storeRoom', 'parkingSpace'],
|
|
56
|
+
enumNames: ['Квартира', 'Апартаменты', 'Жилой дом', 'Кладовая', 'Машино-место'],
|
|
57
|
+
},
|
|
55
58
|
},
|
|
56
59
|
stage: {
|
|
57
60
|
title: 'Этап строительства',
|
|
58
|
-
type: '
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
type: 'array',
|
|
62
|
+
items: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
enum: ['built', 'inProgress'],
|
|
65
|
+
enumNames: ['Готовое жильё', 'Строящиеся'],
|
|
66
|
+
},
|
|
61
67
|
},
|
|
62
68
|
categories: {
|
|
63
69
|
title: 'Категории',
|
|
64
|
-
type: '
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
type: 'array',
|
|
71
|
+
items: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
enum: ['salaryClient', 'IT', 'youngFamily', 'military', 'medicalWorker', 'scientist'],
|
|
74
|
+
enumNames: [
|
|
75
|
+
'Зарплатный клиент',
|
|
76
|
+
'IT-специалист',
|
|
77
|
+
'Молодая семья',
|
|
78
|
+
'Военнослужащий',
|
|
79
|
+
'Медицинский работник',
|
|
80
|
+
'Научный сотрудник',
|
|
81
|
+
],
|
|
82
|
+
},
|
|
74
83
|
},
|
|
75
84
|
extraOptions: {
|
|
76
85
|
title: 'Дополнительно',
|
|
77
|
-
type: '
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
type: 'array',
|
|
87
|
+
items: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
enum: ['preferentialMortgage', 'children'],
|
|
90
|
+
enumNames: ['Льготная ипотека', 'Дети'],
|
|
91
|
+
},
|
|
80
92
|
},
|
|
81
93
|
};
|
|
82
94
|
|
|
@@ -92,7 +104,11 @@ export default {
|
|
|
92
104
|
label="Другие ипотечные программы"
|
|
93
105
|
filtrationSchema={SCHEMA}
|
|
94
106
|
topItemsCount={2}
|
|
95
|
-
resetButton={{ text: 'Очистить фильтры',
|
|
107
|
+
resetButton={{ text: 'Очистить фильтры', version: 'secondary' }}
|
|
108
|
+
notFound={{
|
|
109
|
+
title: 'Нет подходящей ипотечной программы',
|
|
110
|
+
description: 'Попробуйте очистить фильтры',
|
|
111
|
+
}}
|
|
96
112
|
block={{
|
|
97
113
|
type: 'Filtration',
|
|
98
114
|
blocks: [
|
|
@@ -15,19 +15,14 @@ export const Filtration: JSXBlock<FiltrationProps> = JSX<FiltrationProps>(
|
|
|
15
15
|
const { formState, register, resetForm } = useForm();
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<BlockWrapper className={style(
|
|
19
|
-
<form className="flex justify-between">
|
|
18
|
+
<BlockWrapper className={style(className)} version="transparent" {...rest}>
|
|
19
|
+
<form className="flex justify-between bg-white p-9 mb-1">
|
|
20
20
|
<div className="flex gap-11">
|
|
21
21
|
{Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, register))}
|
|
22
22
|
</div>
|
|
23
23
|
{resetButton ? (
|
|
24
24
|
<div>
|
|
25
|
-
<Button
|
|
26
|
-
className="w-72"
|
|
27
|
-
text={resetButton.text}
|
|
28
|
-
version={resetButton.buttonVersion}
|
|
29
|
-
onClick={resetForm}
|
|
30
|
-
/>
|
|
25
|
+
<Button className="w-72" onClick={resetForm} {...resetButton} />
|
|
31
26
|
</div>
|
|
32
27
|
) : null}
|
|
33
28
|
</form>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ButtonVersion } from '../../model/ButtonVersion';
|
|
2
|
+
import type { DescriptionProps, TitleProps } from '../../model/HeadlineType';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @title Заголовок
|
|
@@ -33,6 +34,7 @@ export type StringArray = {
|
|
|
33
34
|
* @hidden
|
|
34
35
|
*/
|
|
35
36
|
type?: 'array';
|
|
37
|
+
/** @title */
|
|
36
38
|
items?: {
|
|
37
39
|
/**
|
|
38
40
|
* @default string
|
|
@@ -47,13 +49,13 @@ export type StringArray = {
|
|
|
47
49
|
// TODO: Make customizable to implement arbitrary filtration blocks
|
|
48
50
|
export type FiltrationSchema = {
|
|
49
51
|
/** @title Тип недвижимости */
|
|
50
|
-
propertyType?:
|
|
52
|
+
propertyType?: StringArray;
|
|
51
53
|
/** @title Этап строительства */
|
|
52
|
-
stage?:
|
|
54
|
+
stage?: StringArray;
|
|
53
55
|
/** @title Категории */
|
|
54
|
-
categories?:
|
|
56
|
+
categories?: StringArray;
|
|
55
57
|
/** @title Дополнительно */
|
|
56
|
-
extraOptions?:
|
|
58
|
+
extraOptions?: StringArray;
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
/**
|
|
@@ -67,14 +69,24 @@ export type ResetButton = {
|
|
|
67
69
|
/**
|
|
68
70
|
* @title Цвет кнопки
|
|
69
71
|
*/
|
|
70
|
-
|
|
72
|
+
version: ButtonVersion;
|
|
71
73
|
};
|
|
72
74
|
|
|
75
|
+
/**
|
|
76
|
+
* @title Плитка "Не найдено"
|
|
77
|
+
*/
|
|
78
|
+
export type NotFound = TitleProps & DescriptionProps;
|
|
79
|
+
|
|
73
80
|
export interface FiltrationInnerContent {
|
|
74
|
-
/** @title Название кнопки */
|
|
81
|
+
/** @title Название сворачивающейся кнопки */
|
|
75
82
|
label?: string;
|
|
76
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* @title Количество отображаемых предметов
|
|
85
|
+
* @minimum 1
|
|
86
|
+
*/
|
|
77
87
|
topItemsCount?: number;
|
|
88
|
+
resetButton?: ResetButton;
|
|
89
|
+
notFound?: NotFound;
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
/**
|
|
@@ -83,5 +95,4 @@ export interface FiltrationInnerContent {
|
|
|
83
95
|
export interface FiltrationContent extends FiltrationInnerContent {
|
|
84
96
|
/** @title Параметры фильтрации */
|
|
85
97
|
filtrationSchema?: FiltrationSchema;
|
|
86
|
-
resetButton?: ResetButton;
|
|
87
98
|
}
|
|
@@ -5,10 +5,11 @@ import type { UniBlockProps } from '../../model/JSXBlock';
|
|
|
5
5
|
import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
|
|
6
6
|
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
7
7
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
8
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
9
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
8
10
|
import { style } from '../../utils/style';
|
|
9
|
-
import { ErrorBlock } from '../ErrorBlock/ErrorBlock';
|
|
10
11
|
import { checkShouldRenderBlock } from './checkShouldRenderBlock';
|
|
11
|
-
import type { FiltrationInnerContent } from './FiltrationContent';
|
|
12
|
+
import type { FiltrationInnerContent, NotFound } from './FiltrationContent';
|
|
12
13
|
|
|
13
14
|
const ICONS: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
14
15
|
|
|
@@ -19,7 +20,7 @@ interface FiltrationInnerProps extends FiltrationInnerContent, UniBlockProps {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const FiltrationInner = JSX<FiltrationInnerProps>(
|
|
22
|
-
({ label = '', filtrationState = {}, topItemsCount = 0, block, ...rest }) => {
|
|
23
|
+
({ label = '', filtrationState = {}, topItemsCount = 0, block, notFound, ...rest }) => {
|
|
23
24
|
const blocksToRender =
|
|
24
25
|
block?.blocks?.filter((b) => checkShouldRenderBlock(filtrationState, b.content || {})) || [];
|
|
25
26
|
|
|
@@ -30,28 +31,27 @@ export const FiltrationInner = JSX<FiltrationInnerProps>(
|
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<div>
|
|
33
|
-
<div className={style(blocksToRender.length ? 'hidden' : '')}>
|
|
34
|
-
|
|
35
|
-
error={{ errorContentType: 'Image' }}
|
|
36
|
-
title="Нет подходящей ипотечной программы"
|
|
37
|
-
subtitle="Попробуйте очистить фильтры"
|
|
38
|
-
/>
|
|
34
|
+
<div className={style(blocksToRender.length ? 'hidden' : 'block')}>
|
|
35
|
+
{notFound ? renderNotFound(notFound) : null}
|
|
39
36
|
</div>
|
|
40
37
|
<div className={style(blocksToRender.length ? '' : 'hidden')}>
|
|
41
|
-
<div className={resultsGridStyle}>
|
|
38
|
+
<div className={style('mb-1', resultsGridStyle)}>
|
|
42
39
|
{renderBlocksList(visibleBlocks, { ...rest.options, parent: block })}
|
|
43
40
|
</div>
|
|
44
41
|
<Foldable
|
|
45
42
|
renderFoldableSection={({ isUnfolded }) => {
|
|
46
43
|
return (
|
|
47
|
-
<FoldableSection
|
|
44
|
+
<FoldableSection
|
|
45
|
+
className={style(resultsGridStyle, isUnfolded ? 'mb-1' : '')}
|
|
46
|
+
isUnfolded={isUnfolded}
|
|
47
|
+
>
|
|
48
48
|
{renderBlocksList(hiddenBlocks, { ...rest.options, parent: block })}
|
|
49
49
|
</FoldableSection>
|
|
50
50
|
);
|
|
51
51
|
}}
|
|
52
52
|
renderFoldButton={({ isUnfolded, onToggle }) => (
|
|
53
53
|
<DefaultFoldButton
|
|
54
|
-
className={style(
|
|
54
|
+
className={style(topItemsCount < 1 ? 'hidden' : '')}
|
|
55
55
|
disabled={!hiddenBlocks?.length}
|
|
56
56
|
label={label}
|
|
57
57
|
icon={ICONS[Number(isUnfolded)]}
|
|
@@ -65,3 +65,22 @@ export const FiltrationInner = JSX<FiltrationInnerProps>(
|
|
|
65
65
|
);
|
|
66
66
|
},
|
|
67
67
|
);
|
|
68
|
+
|
|
69
|
+
function renderNotFound({ title, description }: NotFound) {
|
|
70
|
+
return (
|
|
71
|
+
<div className="bg-white py-20">
|
|
72
|
+
{title ? (
|
|
73
|
+
<div className="mb-2">
|
|
74
|
+
<Paragraph align="text-center">
|
|
75
|
+
<Text size="text-h4">{title}</Text>
|
|
76
|
+
</Paragraph>
|
|
77
|
+
</div>
|
|
78
|
+
) : null}
|
|
79
|
+
{description ? (
|
|
80
|
+
<Paragraph size="text-xl" font="font-light" align="text-center">
|
|
81
|
+
{description}
|
|
82
|
+
</Paragraph>
|
|
83
|
+
) : null}
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FormElementRegisterer } from '../../hooks/useForm';
|
|
2
2
|
import { SlideCheckboxGroup } from '../../ui-kit/SlideCheckboxGroup/SlideCheckboxGroup';
|
|
3
3
|
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
-
import type { FiltrationSchema,
|
|
4
|
+
import type { FiltrationSchema, StringArray } from './FiltrationContent';
|
|
5
5
|
|
|
6
6
|
export const renderFormItem =
|
|
7
7
|
(filtrationSchema: FiltrationSchema, register: FormElementRegisterer) => (key: string) => {
|
|
@@ -9,28 +9,28 @@ export const renderFormItem =
|
|
|
9
9
|
const type = item?.type;
|
|
10
10
|
|
|
11
11
|
switch (type) {
|
|
12
|
-
case '
|
|
13
|
-
return
|
|
12
|
+
case 'array':
|
|
13
|
+
return renderCheckboxes(key, register)(item);
|
|
14
14
|
default:
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const renderCheckboxes = (key: string, register: FormElementRegisterer) => (item?: StringArray) => {
|
|
20
|
+
const options =
|
|
21
|
+
item?.items?.enum?.map((e, i) => ({ value: e, title: item?.items?.enumNames?.[i] || '' })) ||
|
|
22
|
+
[];
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
return (
|
|
25
|
+
<div key={key}>
|
|
26
|
+
{item?.title ? (
|
|
27
|
+
<div className="mb-4">
|
|
28
|
+
<Text size="text-m" font="font-light" color="text-secondary-text">
|
|
29
|
+
{item.title}
|
|
30
|
+
</Text>
|
|
31
|
+
</div>
|
|
32
|
+
) : null}
|
|
33
|
+
<SlideCheckboxGroup items={options} multiple {...register(key)} />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -62,17 +62,15 @@ const buttonStylesWithText = (text: string, buttonSize: string) =>
|
|
|
62
62
|
: `group/media flex items-center justify-center box-border ${buttonSizeStyles[buttonSize]}`;
|
|
63
63
|
|
|
64
64
|
export const MediaButton = JSX<MediaButtonProps>(
|
|
65
|
-
({
|
|
66
|
-
const { href, version, text
|
|
65
|
+
({ buttonSize = 'default', rounded = false, icon, ...rest }) => {
|
|
66
|
+
const { href, version, text = '' } = rest;
|
|
67
67
|
|
|
68
68
|
const { iconMapped, label } =
|
|
69
69
|
ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
70
70
|
|
|
71
|
-
const iconCustom = icon ?? iconMapped;
|
|
71
|
+
const iconCustom = getFilteredIcon(icon) ?? iconMapped;
|
|
72
72
|
|
|
73
|
-
const iconWithVersion = iconCustom
|
|
74
|
-
? { ...getIconWithVersion(iconCustom), iconVersion }
|
|
75
|
-
: undefined;
|
|
73
|
+
const iconWithVersion = iconCustom ? getIconWithVersion(iconCustom) : undefined;
|
|
76
74
|
|
|
77
75
|
return (
|
|
78
76
|
<Button
|
|
@@ -83,11 +81,8 @@ export const MediaButton = JSX<MediaButtonProps>(
|
|
|
83
81
|
'hover:bg-primary-main hover:text-black',
|
|
84
82
|
'group-data-secondary:bg-white border-main-divider group-data-secondary:hover:bg-secondary-hover',
|
|
85
83
|
'group-data-gray:border-green',
|
|
86
|
-
buttonStylesWithText(text
|
|
84
|
+
buttonStylesWithText(text, buttonSize),
|
|
87
85
|
)}
|
|
88
|
-
aboveText={aboveText}
|
|
89
|
-
appendLeft={appendLeft}
|
|
90
|
-
appendRight={appendRight}
|
|
91
86
|
aria-label={label}
|
|
92
87
|
rel="noopener noreferrer"
|
|
93
88
|
target="_blank"
|
|
@@ -108,3 +103,5 @@ export const MediaButton = JSX<MediaButtonProps>(
|
|
|
108
103
|
);
|
|
109
104
|
},
|
|
110
105
|
);
|
|
106
|
+
|
|
107
|
+
const getFilteredIcon = (icon: Picture | undefined) => (icon?.src || icon?.icon ? icon : undefined);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
3
|
-
import { MediaButton, type ButtonSize } from './MediaButton';
|
|
4
3
|
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
import type { ButtonSize } from './MediaButton';
|
|
5
|
+
import { MediaButton } from './MediaButton';
|
|
5
6
|
|
|
6
7
|
export interface SocialMediaProps {
|
|
7
8
|
className?: string;
|
|
@@ -14,16 +15,7 @@ export const SocialMedia = JSX<SocialMediaProps>(
|
|
|
14
15
|
<div className="font-sans">
|
|
15
16
|
<div className={`flex gap-1 ${className}`}>
|
|
16
17
|
{media?.map((_, index) => (
|
|
17
|
-
<MediaButton
|
|
18
|
-
key={String(index)}
|
|
19
|
-
aboveText={_.aboveText}
|
|
20
|
-
appendLeft={_.appendLeft}
|
|
21
|
-
appendRight={_.appendRight}
|
|
22
|
-
buttonSize={buttonSize}
|
|
23
|
-
text={_.text}
|
|
24
|
-
version={_.version}
|
|
25
|
-
{..._}
|
|
26
|
-
/>
|
|
18
|
+
<MediaButton key={String(index)} buttonSize={buttonSize} {..._} />
|
|
27
19
|
))}
|
|
28
20
|
</div>
|
|
29
21
|
<Text size="text-s-light" color="text-secondary-text">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"content": {
|
|
3
|
-
"__html": "<
|
|
3
|
+
"__html": "<h1>Заголовок 1</h1>\n<h2>Заголовок 2</h2>\n<h3>Заголовок 3</h3>\n<h4>Заголовок 4</h4>\n<h5>Заголовок 5</h5>\n<h6>Заголовок 6</h6>\n<p>Параграф, в котором много текста и даже <a href=\"#\">ссылка</a></p>\n<p><strong>Жирный текст</strong>, <em>Наклонный текст</em></p>\n<ul>\n <li>Список с точками</li>\n <li>Список с точками</li>\n</ul>\n<ol>\n <li>Нумерованный список</li>\n <li>Нумерованный список</li>\n</ol>\n"
|
|
4
4
|
}
|
|
5
5
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AlignTypeWithStretch } from '../../model/AlignType';
|
|
2
|
-
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
3
2
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
3
|
import type { GapVersion } from '../HorizontalLayout/HorizontalLayoutContent';
|
|
5
4
|
|
|
@@ -7,7 +6,6 @@ import type { GapVersion } from '../HorizontalLayout/HorizontalLayoutContent';
|
|
|
7
6
|
* @title Вертикальный компоновщик
|
|
8
7
|
*/
|
|
9
8
|
export type VerticalLayoutContent = UniBlockContent & {
|
|
10
|
-
colorPalette?: ColorPalette;
|
|
11
9
|
align?: AlignTypeWithStretch;
|
|
12
10
|
gap?: GapVersion;
|
|
13
11
|
/** @title Внутренний отступ компоновщика */
|