@redneckz/wildless-cms-uni-blocks 0.9.1 → 0.9.3
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.5.14.js +6 -0
- package/bin/migration-scripts/0.8.17.js +6 -0
- package/bin/migration-scripts/0.8.24.js +8 -2
- package/bin/migration-scripts/0.8.8.js +6 -0
- package/bin/migration-scripts/{0.8.31.js → 0.9.3.js} +14 -12
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +12 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/bundle/components/Footer/FooterContent.d.ts +2 -2
- package/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/dist/components/Footer/FooterContent.d.ts +2 -2
- package/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/lib/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/bundle/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/dist/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/lib/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
- package/mobile/src/components/Footer/Footer.ui.json +1 -11
- package/mobile/src/components/Footer/FooterContent.ts +2 -3
- package/package.json +1 -1
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
- package/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
- package/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
- package/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
- package/src/components/Footer/Footer.ui.json +1 -11
- package/src/components/Footer/FooterContent.ts +2 -3
- package/bin/migration-scripts/0.4.5.js +0 -109
- package/bin/migration-scripts/0.5.10.js +0 -36
- package/bin/migration-scripts/0.6.16.js +0 -90
- package/bin/migration-scripts/0.6.34.js +0 -53
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselProductCard.js","sourceRoot":"","sources":["../../../src/components/CarouselProductCard/CarouselProductCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CarouselProductCard.js","sourceRoot":"","sources":["../../../src/components/CarouselProductCard/CarouselProductCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,IAAI,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D,YAE7D,qBAAqB,GACjB,GACH,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AAEX,MAAM,WAAW,GAAG,CAAC,KAAkB,EAAE,QAAiB,EAAE,UAAwB,SAAS,EAAE,EAAE,CAC/F,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACd,KAAC,IAAI,IACH,SAAS,EAAE,6BAA6B,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,EAAE,EAC7F,aAAa,EAAC,WAAW,EACzB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAc,CAAC,EAC5E,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,CAAC"}
|
|
@@ -3,6 +3,7 @@ import type { ButtonCommonIconProps } from '../../model/Button';
|
|
|
3
3
|
import type { AdditionalDescriptionProps, HeadlineSmallProps } from '../../model/HeadlineType';
|
|
4
4
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
5
5
|
import type { IconProps } from '../../model/Picture';
|
|
6
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
6
7
|
import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
7
8
|
/**
|
|
8
9
|
* @title Элемент списка
|
|
@@ -14,7 +15,7 @@ export interface ListProps {
|
|
|
14
15
|
/**
|
|
15
16
|
* @title Карточка продуктовой карусели
|
|
16
17
|
*/
|
|
17
|
-
export declare type CarouselProductCardContent = UniBlockContent & HeadlineSmallProps & AdditionalDescriptionProps & IconProps & ButtonCommonIconProps & BulletsProps & {
|
|
18
|
+
export declare type CarouselProductCardContent = UniBlockContent & HeadlineSmallProps & AdditionalDescriptionProps & IconProps & ButtonCommonIconProps & BulletsProps & LinkCommonProps & {
|
|
18
19
|
/** @title Список */
|
|
19
20
|
items?: ListProps[];
|
|
20
21
|
align?: TextAlign;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
2
2
|
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
import type { IconProps } from '../../model/Picture';
|
|
4
|
+
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
5
|
/**
|
|
5
6
|
* @title Тип контакта
|
|
6
7
|
* @enumNames [
|
|
@@ -23,6 +24,5 @@ export declare type ContactInfo = DescriptionProps & {
|
|
|
23
24
|
export declare type SubMenuItem = LinkProps & IconProps;
|
|
24
25
|
/**
|
|
25
26
|
* @title Подвал
|
|
26
|
-
* @hidden
|
|
27
27
|
*/
|
|
28
|
-
export declare type FooterContent = {};
|
|
28
|
+
export declare type FooterContent = UniBlockContent & {};
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
3
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
6
|
-
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
7
6
|
import { style } from '../../utils/style';
|
|
8
|
-
import
|
|
7
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
8
|
+
import { useLink } from '../../hooks/useLink';
|
|
9
9
|
import type { CarouselEventCardContent } from './CarouselEventCardContent';
|
|
10
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
10
11
|
|
|
11
12
|
export interface CarouselEventCardProps extends CarouselEventCardContent, UniBlockProps {}
|
|
12
13
|
|
|
13
14
|
export const CarouselEventCard = JSX<CarouselEventCardProps>(
|
|
14
|
-
({ className = '', icon, title, description, href, target, ...rest }) =>
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
({ className = '', icon, title, description, href, target, ...rest }) => {
|
|
16
|
+
const link = useLink();
|
|
17
|
+
const adjustedProps = link({ href, target });
|
|
18
|
+
const tagName = href ? 'a' : 'section';
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<BlockWrapper
|
|
22
|
+
className={style('flex flex-col w-[365px]', className)}
|
|
23
|
+
extraProps={adjustedProps}
|
|
24
|
+
tag={tagName}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
17
27
|
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
18
28
|
{icon?.src ? <Img image={icon} /> : null}
|
|
19
29
|
{title ? (
|
|
@@ -26,7 +36,7 @@ export const CarouselEventCard = JSX<CarouselEventCardProps>(
|
|
|
26
36
|
</Text>
|
|
27
37
|
</div>
|
|
28
38
|
) : null}
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
</BlockWrapper>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
32
42
|
);
|
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
-
import type { Picture } from '../../model/Picture';
|
|
5
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
3
|
+
import { HEADLINE_SMALL_VERSION } from '../Headline/headlineVersionStyles';
|
|
7
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
5
|
import { List } from '../../ui-kit/List/List';
|
|
9
6
|
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
10
|
-
import {
|
|
7
|
+
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
11
8
|
import { style } from '../../utils/style';
|
|
12
|
-
import {
|
|
9
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
10
|
+
import { useLink } from '../../hooks/useLink';
|
|
11
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
13
12
|
import type { CarouselProductCardContent, ListProps } from './CarouselProductCardContent';
|
|
13
|
+
import type { Picture } from '../../model/Picture';
|
|
14
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
14
15
|
|
|
15
16
|
export interface CarouselProductCardProps extends CarouselProductCardContent, UniBlockProps {}
|
|
16
17
|
|
|
17
18
|
export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
18
19
|
({
|
|
20
|
+
additionalDescription,
|
|
21
|
+
align = 'text-center',
|
|
22
|
+
button = {},
|
|
19
23
|
className = '',
|
|
20
|
-
title,
|
|
21
|
-
headlineSmallVersion = 'H6',
|
|
22
24
|
description,
|
|
23
|
-
|
|
25
|
+
headlineSmallVersion = 'H6',
|
|
26
|
+
href,
|
|
24
27
|
icon,
|
|
28
|
+
isDotted = true,
|
|
25
29
|
items = [],
|
|
26
|
-
|
|
30
|
+
target,
|
|
31
|
+
title,
|
|
27
32
|
version = 'primary',
|
|
28
|
-
isDotted = true,
|
|
29
|
-
align = 'text-center',
|
|
30
33
|
...rest
|
|
31
34
|
}) => {
|
|
35
|
+
const link = useLink();
|
|
36
|
+
const adjustedProps = link({ href, target });
|
|
37
|
+
const tagName = href ? 'a' : 'section';
|
|
38
|
+
|
|
32
39
|
return (
|
|
33
40
|
<BlockWrapper
|
|
34
41
|
className={style(
|
|
@@ -37,6 +44,8 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
|
37
44
|
align,
|
|
38
45
|
className,
|
|
39
46
|
)}
|
|
47
|
+
extraProps={adjustedProps}
|
|
48
|
+
tag={tagName}
|
|
40
49
|
version={version}
|
|
41
50
|
{...rest}
|
|
42
51
|
>
|
|
@@ -3,6 +3,7 @@ import type { ButtonCommonIconProps } from '../../model/Button';
|
|
|
3
3
|
import type { AdditionalDescriptionProps, HeadlineSmallProps } from '../../model/HeadlineType';
|
|
4
4
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
5
5
|
import type { IconProps } from '../../model/Picture';
|
|
6
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
6
7
|
import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -21,7 +22,8 @@ export type CarouselProductCardContent = UniBlockContent &
|
|
|
21
22
|
AdditionalDescriptionProps &
|
|
22
23
|
IconProps &
|
|
23
24
|
ButtonCommonIconProps &
|
|
24
|
-
BulletsProps &
|
|
25
|
+
BulletsProps &
|
|
26
|
+
LinkCommonProps & {
|
|
25
27
|
/** @title Список */
|
|
26
28
|
items?: ListProps[];
|
|
27
29
|
align?: TextAlign;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
2
2
|
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
import type { IconProps } from '../../model/Picture';
|
|
4
|
+
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @title Тип контакта
|
|
@@ -27,7 +28,5 @@ export type SubMenuItem = LinkProps & IconProps;
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* @title Подвал
|
|
30
|
-
* @hidden
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
export type FooterContent = {};
|
|
32
|
+
export type FooterContent = UniBlockContent & {};
|
package/package.json
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
3
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
6
|
-
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
7
6
|
import { style } from '../../utils/style';
|
|
8
|
-
import
|
|
7
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
8
|
+
import { useLink } from '../../hooks/useLink';
|
|
9
9
|
import type { CarouselEventCardContent } from './CarouselEventCardContent';
|
|
10
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
10
11
|
|
|
11
12
|
export interface CarouselEventCardProps extends CarouselEventCardContent, UniBlockProps {}
|
|
12
13
|
|
|
13
14
|
export const CarouselEventCard = JSX<CarouselEventCardProps>(
|
|
14
|
-
({ className = '', icon, title, description, href, target, ...rest }) =>
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
({ className = '', icon, title, description, href, target, ...rest }) => {
|
|
16
|
+
const link = useLink();
|
|
17
|
+
const adjustedProps = link({ href, target });
|
|
18
|
+
const tagName = href ? 'a' : 'section';
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<BlockWrapper
|
|
22
|
+
className={style('flex flex-col w-[365px]', className)}
|
|
23
|
+
extraProps={adjustedProps}
|
|
24
|
+
tag={tagName}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
17
27
|
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
18
28
|
{icon?.src ? <Img image={icon} /> : null}
|
|
19
29
|
{title ? (
|
|
@@ -26,7 +36,7 @@ export const CarouselEventCard = JSX<CarouselEventCardProps>(
|
|
|
26
36
|
</Text>
|
|
27
37
|
</div>
|
|
28
38
|
) : null}
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
</BlockWrapper>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
32
42
|
);
|
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
-
import type { Picture } from '../../model/Picture';
|
|
5
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
3
|
+
import { HEADLINE_SMALL_VERSION } from '../Headline/headlineVersionStyles';
|
|
7
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
5
|
import { List } from '../../ui-kit/List/List';
|
|
9
6
|
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
10
|
-
import {
|
|
7
|
+
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
11
8
|
import { style } from '../../utils/style';
|
|
12
|
-
import {
|
|
9
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
10
|
+
import { useLink } from '../../hooks/useLink';
|
|
11
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
13
12
|
import type { CarouselProductCardContent, ListProps } from './CarouselProductCardContent';
|
|
13
|
+
import type { Picture } from '../../model/Picture';
|
|
14
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
14
15
|
|
|
15
16
|
export interface CarouselProductCardProps extends CarouselProductCardContent, UniBlockProps {}
|
|
16
17
|
|
|
17
18
|
export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
18
19
|
({
|
|
20
|
+
additionalDescription,
|
|
21
|
+
align = 'text-center',
|
|
22
|
+
button = {},
|
|
19
23
|
className = '',
|
|
20
|
-
title,
|
|
21
|
-
headlineSmallVersion = 'H6',
|
|
22
24
|
description,
|
|
23
|
-
|
|
25
|
+
headlineSmallVersion = 'H6',
|
|
26
|
+
href,
|
|
24
27
|
icon,
|
|
28
|
+
isDotted = true,
|
|
25
29
|
items = [],
|
|
26
|
-
|
|
30
|
+
target,
|
|
31
|
+
title,
|
|
27
32
|
version = 'primary',
|
|
28
|
-
isDotted = true,
|
|
29
|
-
align = 'text-center',
|
|
30
33
|
...rest
|
|
31
34
|
}) => {
|
|
35
|
+
const link = useLink();
|
|
36
|
+
const adjustedProps = link({ href, target });
|
|
37
|
+
const tagName = href ? 'a' : 'section';
|
|
38
|
+
|
|
32
39
|
return (
|
|
33
40
|
<BlockWrapper
|
|
34
41
|
className={style(
|
|
@@ -37,6 +44,8 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
|
37
44
|
align,
|
|
38
45
|
className,
|
|
39
46
|
)}
|
|
47
|
+
extraProps={adjustedProps}
|
|
48
|
+
tag={tagName}
|
|
40
49
|
version={version}
|
|
41
50
|
{...rest}
|
|
42
51
|
>
|
|
@@ -3,6 +3,7 @@ import type { ButtonCommonIconProps } from '../../model/Button';
|
|
|
3
3
|
import type { AdditionalDescriptionProps, HeadlineSmallProps } from '../../model/HeadlineType';
|
|
4
4
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
5
5
|
import type { IconProps } from '../../model/Picture';
|
|
6
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
6
7
|
import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -21,7 +22,8 @@ export type CarouselProductCardContent = UniBlockContent &
|
|
|
21
22
|
AdditionalDescriptionProps &
|
|
22
23
|
IconProps &
|
|
23
24
|
ButtonCommonIconProps &
|
|
24
|
-
BulletsProps &
|
|
25
|
+
BulletsProps &
|
|
26
|
+
LinkCommonProps & {
|
|
25
27
|
/** @title Список */
|
|
26
28
|
items?: ListProps[];
|
|
27
29
|
align?: TextAlign;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
2
2
|
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
import type { IconProps } from '../../model/Picture';
|
|
4
|
+
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @title Тип контакта
|
|
@@ -27,7 +28,5 @@ export type SubMenuItem = LinkProps & IconProps;
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* @title Подвал
|
|
30
|
-
* @hidden
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
export type FooterContent = {};
|
|
32
|
+
export type FooterContent = UniBlockContent & {};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { deleteEmptyProps, renameProp } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export const description = 'v0.4.5';
|
|
4
|
-
|
|
5
|
-
export default (unitPath, content) => {
|
|
6
|
-
if (!content?.blocks) {
|
|
7
|
-
return content;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
for (const block of content.blocks) {
|
|
11
|
-
adjustNavigatorTabsBlock(block);
|
|
12
|
-
adjustGroupBlock(block);
|
|
13
|
-
adjustTariffsTableBlock(block);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return { ...content };
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function adjustNavigatorTabsBlock(block) {
|
|
20
|
-
if (block.type !== 'NavigatorTabs') {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
block.type = 'Tabs';
|
|
25
|
-
|
|
26
|
-
if (block.content) {
|
|
27
|
-
renameProp(block.content, 'navigatorTabs', 'tabs');
|
|
28
|
-
|
|
29
|
-
for (const item in block.content.tabs) {
|
|
30
|
-
item.type = 'link';
|
|
31
|
-
Reflect.deleteProperty(item, 'label');
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function adjustGroupBlock(block) {
|
|
37
|
-
if (block.type !== 'GroupBlock') {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// GroupBlock переделываем в Tabs
|
|
42
|
-
// Страницы в которых есть GroupBlock credit-cards / debet-cards / deposits / loans / vse-vidy-strahovaniya1
|
|
43
|
-
|
|
44
|
-
block.type = 'Tabs';
|
|
45
|
-
|
|
46
|
-
if (block.content) {
|
|
47
|
-
renameProp(block.content, 'tabs', 'labels');
|
|
48
|
-
renameProp(block.content, 'isShowCounter', 'showCounter');
|
|
49
|
-
|
|
50
|
-
for (const item of block.content.labels) {
|
|
51
|
-
item.type = 'group';
|
|
52
|
-
renameProp(item, 'tag', 'ref');
|
|
53
|
-
Reflect.deleteProperty(item, 'index');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
Reflect.deleteProperty(block.content, 'blocks');
|
|
57
|
-
Reflect.deleteProperty(block.content, 'groupBlocks');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function adjustTariffsTableBlock(block) {
|
|
62
|
-
if (block.type !== 'TariffsTable' || !block.content || !block.content.columns) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
renameProp(block.content, 'columns', 'tariffsColumns');
|
|
67
|
-
|
|
68
|
-
for (const column of block.content.tariffsColumns) {
|
|
69
|
-
for (const columnInner of column.data) {
|
|
70
|
-
adjustTariffsColumnsInner(columnInner);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function adjustTariffsColumnsInner(columnInner) {
|
|
76
|
-
for (let index = 0; index < columnInner.length; index++) {
|
|
77
|
-
const cell = columnInner[index];
|
|
78
|
-
|
|
79
|
-
deleteEmptyProps(cell);
|
|
80
|
-
|
|
81
|
-
if (Object.keys(cell).length === 2 && cell?.label && cell.description) {
|
|
82
|
-
addCellType(cell);
|
|
83
|
-
} else if (Object.keys(cell).length < 2) {
|
|
84
|
-
addCellType(cell);
|
|
85
|
-
} else {
|
|
86
|
-
// Если типов два и более и это не labels и description то разносим по разным ячейкам
|
|
87
|
-
const newArr = [];
|
|
88
|
-
for (const key in cell) {
|
|
89
|
-
newArr.push(addCellType({ [key]: cell[key] }));
|
|
90
|
-
}
|
|
91
|
-
columnInner.splice(index, 1, ...newArr);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Добавить тип в ячейку компонента TariffsTable
|
|
97
|
-
function addCellType(cell) {
|
|
98
|
-
if (cell?.label || cell?.description) {
|
|
99
|
-
cell.tableCellType = 'LabelDescription';
|
|
100
|
-
}
|
|
101
|
-
if (cell?.buttons) {
|
|
102
|
-
cell.tableCellType = 'Buttons';
|
|
103
|
-
}
|
|
104
|
-
if (cell?.list) {
|
|
105
|
-
cell.tableCellType = 'List';
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return cell;
|
|
109
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const description = 'v0.5.10';
|
|
2
|
-
|
|
3
|
-
export default (unitPath, content) => {
|
|
4
|
-
if (!content?.blocks) {
|
|
5
|
-
return content;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
for (const block of content.blocks) {
|
|
9
|
-
adjustBonusBlock(block);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return { ...content };
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function adjustBonusBlock(block) {
|
|
16
|
-
if (
|
|
17
|
-
block.type !== 'Bonus' ||
|
|
18
|
-
!block.content ||
|
|
19
|
-
!block.content.bonusItems ||
|
|
20
|
-
!block.content.bonusItems.every((i) => i.bonusCount || i.bonusName)
|
|
21
|
-
) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (block.content) {
|
|
26
|
-
for (const item of block.content.bonusItems) {
|
|
27
|
-
item.bonusItemContent = {
|
|
28
|
-
bonusType: 'count',
|
|
29
|
-
bonusCount: item.bonusCount,
|
|
30
|
-
bonusName: item.bonusName,
|
|
31
|
-
};
|
|
32
|
-
Reflect.deleteProperty(item, 'bonusCount');
|
|
33
|
-
Reflect.deleteProperty(item, 'bonusName');
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|