@redneckz/wildless-cms-uni-blocks 0.14.975 → 0.14.977
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 +17 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/GalleryLayout/utils.d.ts +1 -1
- package/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/model/HeadlineType.d.ts +15 -8
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/dist/components/GalleryLayout/utils.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +15 -10
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/model/HeadlineType.d.ts +15 -8
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/lib/components/GalleryLayout/utils.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +15 -10
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/model/HeadlineType.d.ts +15 -8
- package/mobile/bundle/bundle.umd.js +17 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/model/HeadlineType.d.ts +15 -8
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js +15 -10
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/model/HeadlineType.d.ts +15 -8
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js +15 -10
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/model/HeadlineType.d.ts +15 -8
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +7 -2
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +26 -17
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -5
- package/mobile/src/model/HeadlineType.ts +16 -8
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +7 -2
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +16 -7
- package/src/components/ProductBlock/ProductBlock.tsx +26 -17
- package/src/components/ProductBlock/ProductBlockContent.ts +2 -5
- package/src/model/HeadlineType.ts +16 -8
|
@@ -2,7 +2,7 @@ import { type BlockDef } from '../../model/ContentPageDef';
|
|
|
2
2
|
import { type LinkProps } from '../../model/LinkProps';
|
|
3
3
|
export declare const getChildStyle: (index: number) => "lg:col-span-1 lg:row-span-1" | "lg:col-span-2 lg:row-span-2";
|
|
4
4
|
export declare const modifyBlock: (block: BlockDef, i: number) => {
|
|
5
|
-
content: import("../../UniBlock/UniBlockProps").UniBlockContent & import("../../model/HeadlineType").TitleProps & import("../../model/HeadlineType").DescriptionProps & import("../../model/HeadlineType").AlignProps & import("../../model/HeadlineType").AdditionalDescriptionProps & import("../../model/HeadlineType").
|
|
5
|
+
content: import("../../UniBlock/UniBlockProps").UniBlockContent & import("../../model/HeadlineType").TitleProps & import("../../model/HeadlineType").DescriptionProps & import("../../model/HeadlineType").AlignProps & import("../../model/HeadlineType").AdditionalDescriptionProps & import("../../model/HeadlineType").DynamicTextProps & {
|
|
6
6
|
headlineVersion?: import("../../model/HeadlineType").HeadlineVersion | undefined;
|
|
7
7
|
} & import("../../ui-kit/BenefitsList/BenefitsListContent").BenefitsListContent & import("../../model/Bullets").BulletsProps & {
|
|
8
8
|
__html?: string | undefined;
|
|
@@ -2,7 +2,7 @@ import type { JSONRefObject } from '../../data/JSONRefObject';
|
|
|
2
2
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
3
3
|
import { type ProductBlockContent } from './ProductBlockContent';
|
|
4
4
|
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
|
|
5
|
-
|
|
5
|
+
dynamicTextSource?: JSONRefObject & {
|
|
6
6
|
list?: Record<string, string>[];
|
|
7
7
|
};
|
|
8
8
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type AdditionalDescriptionProps, type
|
|
1
|
+
import { type AdditionalDescriptionProps, type DynamicTextProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
|
|
3
3
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
4
4
|
/**
|
|
5
5
|
* @title Продуктовый блок
|
|
6
6
|
*/
|
|
7
|
-
export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & AdditionalDescriptionProps &
|
|
7
|
+
export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & AdditionalDescriptionProps & DynamicTextProps & {
|
|
8
8
|
/** @title Отображать кнопку возврата */
|
|
9
9
|
backwardButton?: boolean;
|
|
10
10
|
};
|
|
@@ -36,19 +36,26 @@ export declare type AdditionalDescriptionProps = {
|
|
|
36
36
|
/** @title Дополнительное описание */
|
|
37
37
|
additionalDescription?: string;
|
|
38
38
|
};
|
|
39
|
-
export declare type
|
|
40
|
-
/** @title Динамическое описание по значению
|
|
41
|
-
|
|
39
|
+
export declare type DynamicTextProps = {
|
|
40
|
+
/** @title Динамическое описание по значению query-параметра */
|
|
41
|
+
dynamicQueryParamText?: DynamicText;
|
|
42
42
|
/** @title Справочник значений */
|
|
43
|
-
|
|
43
|
+
dynamicTextSource?: JSONRefObject;
|
|
44
44
|
};
|
|
45
|
-
export declare type HeadlineCommonProps = TitleProps & DescriptionProps & AlignProps & AdditionalDescriptionProps &
|
|
45
|
+
export declare type HeadlineCommonProps = TitleProps & DescriptionProps & AlignProps & AdditionalDescriptionProps & DynamicTextProps;
|
|
46
46
|
export declare type HeadlineProps = HeadlineCommonProps & {
|
|
47
47
|
headlineVersion?: HeadlineVersion;
|
|
48
48
|
};
|
|
49
|
-
export declare type
|
|
50
|
-
/** @title
|
|
51
|
-
|
|
49
|
+
export declare type DynamicText = {
|
|
50
|
+
/** @title query-параметр */
|
|
51
|
+
queryParam?: string;
|
|
52
52
|
/** @title Заменяемый текст */
|
|
53
53
|
value?: string;
|
|
54
|
+
/** @title Тип текста, где будет произведена замена */
|
|
55
|
+
textType?: TextType;
|
|
54
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* @title Тип текста
|
|
59
|
+
* @enumNames ["Описание", "Заголовок"]
|
|
60
|
+
*/
|
|
61
|
+
export declare type TextType = 'description' | 'title';
|
|
@@ -28,6 +28,6 @@ exports.EsiaLoginBanner = (0, uni_jsx_1.JSX)(({ onChangeEsiaStatus, productType
|
|
|
28
28
|
onChangeEsiaStatus(ApplicationLeadFormContent_1.EsiaStatuses.Error);
|
|
29
29
|
}
|
|
30
30
|
}, [frameLocation]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center rounded-md bg-main-gray p-4xl", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-m flex-col justify-around w-full", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xl", children: `Заполните данные через Госуслуги${productType === 'debitCard' ? '
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center rounded-md bg-main-gray p-4xl", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-m flex-col justify-around w-full", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xl", children: `Заполните данные через Госуслуги${productType === 'debitCard' ? ': ' : ''}` }), productType === 'debitCard' ? ((0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside", children: [(0, jsx_runtime_1.jsx)("li", { children: "\u0437\u043D\u0430\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0441\u043E\u043A\u0440\u0430\u0442\u0438\u0442 \u0432\u0440\u0435\u043C\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2060\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u043A\u0443\u0440\u044C\u0435\u0440\u0441\u043A\u0430\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430 \u0432 \u0433. \u041C\u043E\u0441\u043A\u0432\u0430 (\u0432 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u0445 \u041C\u041A\u0410\u0414)" })] })) : ((0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside", children: [(0, jsx_runtime_1.jsx)("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), (0, jsx_runtime_1.jsx)("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), (0, jsx_runtime_1.jsx)("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] })), (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "block self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
|
|
32
32
|
});
|
|
33
33
|
//# sourceMappingURL=EsiaLoginBanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EsiaLoginBanner.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/EsiaLoginBanner.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,iFAA8E;AAC9E,wEAAqE;AACrE,sDAAmD;AAEnD,uDAAoD;AACpD,8CAA2C;AAC3C,6EAA8E;AAOjE,QAAA,eAAe,GAAG,IAAA,aAAG,EAAuB,CAAC,EAAE,kBAAkB,EAAE,WAAW,EAAE,EAAE,EAAE;IAC/F,MAAM,SAAS,GAAG,IAAA,qCAAiB,GAAE,CAAC;IACtC,MAAM,YAAY,GAAG,IAAA,iCAAe,GAAe,CAAC;IACpD,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;IAEjD,MAAM,UAAU,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC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AkB,uEAE9D,IACL,EACN,uBAAC,SAAG,IACF,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,EACvD,MAAM,EAAC,KAAK,GACZ,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type BlockDef } from '../../model/ContentPageDef';
|
|
|
2
2
|
import { type LinkProps } from '../../model/LinkProps';
|
|
3
3
|
export declare const getChildStyle: (index: number) => "lg:col-span-1 lg:row-span-1" | "lg:col-span-2 lg:row-span-2";
|
|
4
4
|
export declare const modifyBlock: (block: BlockDef, i: number) => {
|
|
5
|
-
content: import("../../UniBlock/UniBlockProps").UniBlockContent & import("../../model/HeadlineType").TitleProps & import("../../model/HeadlineType").DescriptionProps & import("../../model/HeadlineType").AlignProps & import("../../model/HeadlineType").AdditionalDescriptionProps & import("../../model/HeadlineType").
|
|
5
|
+
content: import("../../UniBlock/UniBlockProps").UniBlockContent & import("../../model/HeadlineType").TitleProps & import("../../model/HeadlineType").DescriptionProps & import("../../model/HeadlineType").AlignProps & import("../../model/HeadlineType").AdditionalDescriptionProps & import("../../model/HeadlineType").DynamicTextProps & {
|
|
6
6
|
headlineVersion?: import("../../model/HeadlineType").HeadlineVersion | undefined;
|
|
7
7
|
} & import("../../ui-kit/BenefitsList/BenefitsListContent").BenefitsListContent & import("../../model/Bullets").BulletsProps & {
|
|
8
8
|
__html?: string | undefined;
|
|
@@ -2,7 +2,7 @@ import type { JSONRefObject } from '../../data/JSONRefObject';
|
|
|
2
2
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
3
3
|
import { type ProductBlockContent } from './ProductBlockContent';
|
|
4
4
|
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
|
|
5
|
-
|
|
5
|
+
dynamicTextSource?: JSONRefObject & {
|
|
6
6
|
list?: Record<string, string>[];
|
|
7
7
|
};
|
|
8
8
|
}
|
|
@@ -6,19 +6,24 @@ const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
|
6
6
|
const UniBlock_1 = require("../../UniBlock/UniBlock");
|
|
7
7
|
const getSessionQuery_1 = require("../../utils/getSessionQuery");
|
|
8
8
|
const style_1 = require("../../utils/style");
|
|
9
|
-
exports.ProductBlock = (0, UniBlock_1.UniBlock)(({ className, padding, defaultPadding,
|
|
10
|
-
const
|
|
11
|
-
|
|
9
|
+
exports.ProductBlock = (0, UniBlock_1.UniBlock)(({ className, padding, defaultPadding, dynamicQueryParamText = {}, dynamicTextSource, description, title, ...rest }) => {
|
|
10
|
+
const { textType } = dynamicQueryParamText;
|
|
11
|
+
const formatText = getFormatDescription(dynamicQueryParamText, dynamicTextSource?.list, textType === 'title' ? title : description);
|
|
12
|
+
const textProps = {
|
|
13
|
+
title: textType === 'title' ? formatText : title,
|
|
14
|
+
description: textType === 'description' ? formatText : description,
|
|
15
|
+
};
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: (0, jsx_runtime_1.jsx)(BaseProductTile_1.BaseProductTile, { defaultPadding: defaultPadding || 'p-6xl', padding: padding, className: "grow h-full", ...textProps, ...rest }) }));
|
|
12
17
|
});
|
|
13
|
-
const getFormatDescription = (
|
|
14
|
-
const {
|
|
18
|
+
const getFormatDescription = (dynamicQueryParamText = {}, valuesList = [], text = '') => {
|
|
19
|
+
const { queryParam, value } = dynamicQueryParamText;
|
|
15
20
|
const sessionQuery = (0, getSessionQuery_1.saveSessionQuery)();
|
|
16
|
-
const utmValue =
|
|
17
|
-
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
18
|
-
return dynamicValue ?
|
|
21
|
+
const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
|
|
22
|
+
const dynamicValue = valuesList.find((item) => item?.id?.toLowerCase() === utmValue?.toLowerCase())?.value;
|
|
23
|
+
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
19
24
|
};
|
|
20
|
-
const
|
|
25
|
+
const getQueryParamValue = (queryParam, queryString) => {
|
|
21
26
|
const params = new URLSearchParams(queryString);
|
|
22
|
-
return params.get(
|
|
27
|
+
return params.get(queryParam);
|
|
23
28
|
};
|
|
24
29
|
//# sourceMappingURL=ProductBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductBlock.js","sourceRoot":"","sources":["../../../src/components/ProductBlock/ProductBlock.tsx"],"names":[],"mappings":";;;AAEA,kFAA+E;AAC/E,4DAAyD;AACzD,sDAAmD;AAEnD,iEAA+D;AAC/D,6CAA0C;AAS7B,QAAA,YAAY,GAAG,IAAA,mBAAQ,EAClC,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,EACd,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ProductBlock.js","sourceRoot":"","sources":["../../../src/components/ProductBlock/ProductBlock.tsx"],"names":[],"mappings":";;;AAEA,kFAA+E;AAC/E,4DAAyD;AACzD,sDAAmD;AAEnD,iEAA+D;AAC/D,6CAA0C;AAS7B,QAAA,YAAY,GAAG,IAAA,mBAAQ,EAClC,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,EACd,qBAAqB,GAAG,EAAE,EAC1B,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,GAAG,qBAAqB,CAAC;IAC3C,MAAM,UAAU,GAAG,oBAAoB,CACrC,qBAAqB,EACrB,iBAAiB,EAAE,IAAI,EACvB,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAC3C,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;QAChD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@
|
|
|
1
|
-
import { type AdditionalDescriptionProps, type
|
|
1
|
+
import { type AdditionalDescriptionProps, type DynamicTextProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
|
|
3
3
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
4
4
|
/**
|
|
5
5
|
* @title Продуктовый блок
|
|
6
6
|
*/
|
|
7
|
-
export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & AdditionalDescriptionProps &
|
|
7
|
+
export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & AdditionalDescriptionProps & DynamicTextProps & {
|
|
8
8
|
/** @title Отображать кнопку возврата */
|
|
9
9
|
backwardButton?: boolean;
|
|
10
10
|
};
|
|
@@ -36,19 +36,26 @@ export declare type AdditionalDescriptionProps = {
|
|
|
36
36
|
/** @title Дополнительное описание */
|
|
37
37
|
additionalDescription?: string;
|
|
38
38
|
};
|
|
39
|
-
export declare type
|
|
40
|
-
/** @title Динамическое описание по значению
|
|
41
|
-
|
|
39
|
+
export declare type DynamicTextProps = {
|
|
40
|
+
/** @title Динамическое описание по значению query-параметра */
|
|
41
|
+
dynamicQueryParamText?: DynamicText;
|
|
42
42
|
/** @title Справочник значений */
|
|
43
|
-
|
|
43
|
+
dynamicTextSource?: JSONRefObject;
|
|
44
44
|
};
|
|
45
|
-
export declare type HeadlineCommonProps = TitleProps & DescriptionProps & AlignProps & AdditionalDescriptionProps &
|
|
45
|
+
export declare type HeadlineCommonProps = TitleProps & DescriptionProps & AlignProps & AdditionalDescriptionProps & DynamicTextProps;
|
|
46
46
|
export declare type HeadlineProps = HeadlineCommonProps & {
|
|
47
47
|
headlineVersion?: HeadlineVersion;
|
|
48
48
|
};
|
|
49
|
-
export declare type
|
|
50
|
-
/** @title
|
|
51
|
-
|
|
49
|
+
export declare type DynamicText = {
|
|
50
|
+
/** @title query-параметр */
|
|
51
|
+
queryParam?: string;
|
|
52
52
|
/** @title Заменяемый текст */
|
|
53
53
|
value?: string;
|
|
54
|
+
/** @title Тип текста, где будет произведена замена */
|
|
55
|
+
textType?: TextType;
|
|
54
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* @title Тип текста
|
|
59
|
+
* @enumNames ["Описание", "Заголовок"]
|
|
60
|
+
*/
|
|
61
|
+
export declare type TextType = 'description' | 'title';
|
|
@@ -26,6 +26,6 @@ export const EsiaLoginBanner = JSX(({ onChangeEsiaStatus, productType }) => {
|
|
|
26
26
|
onChangeEsiaStatus(EsiaStatuses.Error);
|
|
27
27
|
}
|
|
28
28
|
}, [frameLocation]);
|
|
29
|
-
return (_jsxs("div", { className: "flex items-center rounded-md bg-main-gray p-4xl", children: [_jsxs("div", { className: "flex gap-m flex-col justify-around w-full", children: [_jsx("p", { className: "text-xl", children: `Заполните данные через Госуслуги${productType === 'debitCard' ? '
|
|
29
|
+
return (_jsxs("div", { className: "flex items-center rounded-md bg-main-gray p-4xl", children: [_jsxs("div", { className: "flex gap-m flex-col justify-around w-full", children: [_jsx("p", { className: "text-xl", children: `Заполните данные через Госуслуги${productType === 'debitCard' ? ': ' : ''}` }), productType === 'debitCard' ? (_jsxs("ul", { className: "list-disc list-inside", children: [_jsx("li", { children: "\u0437\u043D\u0430\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0441\u043E\u043A\u0440\u0430\u0442\u0438\u0442 \u0432\u0440\u0435\u043C\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438" }), _jsx("li", { children: "\u2060\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u043A\u0443\u0440\u044C\u0435\u0440\u0441\u043A\u0430\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430 \u0432 \u0433. \u041C\u043E\u0441\u043A\u0432\u0430 (\u0432 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u0445 \u041C\u041A\u0410\u0414)" })] })) : (_jsxs("ul", { className: "list-disc list-inside", children: [_jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), _jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), _jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] })), _jsx(Img, { className: "block self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), _jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), _jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
|
|
30
30
|
});
|
|
31
31
|
//# sourceMappingURL=EsiaLoginBanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EsiaLoginBanner.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/EsiaLoginBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,GAAG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eAAK,SAAS,EAAC,2CAA2C,aACxD,YAAG,SAAS,EAAC,SAAS,YAAE,mCACtB,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EACvC,EAAE,GAAK,EACN,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,CAC7B,cAAI,SAAS,EAAC,uBAAuB,aACnC,gRAAqD,EACrD,uUAAoE,IACjE,CACN,CAAC,CAAC,CAAC,CACF,cAAI,SAAS,EAAC,uBAAuB,aACnC,8KAAmC,EACnC,6OAAgD,EAChD,iJAA+B,IAC5B,CACN,EACD,KAAC,GAAG,IACF,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,EACvD,MAAM,EAAC,IAAI,EACX,KAAK,EAAC,IAAI,GACV,EACF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAC,kBAAkB,uEAE9D,IACL,EACN,KAAC,GAAG,IACF,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,EACvD,MAAM,EAAC,KAAK,GACZ,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type BlockDef } from '../../model/ContentPageDef';
|
|
|
2
2
|
import { type LinkProps } from '../../model/LinkProps';
|
|
3
3
|
export declare const getChildStyle: (index: number) => "lg:col-span-1 lg:row-span-1" | "lg:col-span-2 lg:row-span-2";
|
|
4
4
|
export declare const modifyBlock: (block: BlockDef, i: number) => {
|
|
5
|
-
content: import("../../UniBlock/UniBlockProps").UniBlockContent & import("../../model/HeadlineType").TitleProps & import("../../model/HeadlineType").DescriptionProps & import("../../model/HeadlineType").AlignProps & import("../../model/HeadlineType").AdditionalDescriptionProps & import("../../model/HeadlineType").
|
|
5
|
+
content: import("../../UniBlock/UniBlockProps").UniBlockContent & import("../../model/HeadlineType").TitleProps & import("../../model/HeadlineType").DescriptionProps & import("../../model/HeadlineType").AlignProps & import("../../model/HeadlineType").AdditionalDescriptionProps & import("../../model/HeadlineType").DynamicTextProps & {
|
|
6
6
|
headlineVersion?: import("../../model/HeadlineType").HeadlineVersion | undefined;
|
|
7
7
|
} & import("../../ui-kit/BenefitsList/BenefitsListContent").BenefitsListContent & import("../../model/Bullets").BulletsProps & {
|
|
8
8
|
__html?: string | undefined;
|
|
@@ -2,7 +2,7 @@ import type { JSONRefObject } from '../../data/JSONRefObject';
|
|
|
2
2
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
3
3
|
import { type ProductBlockContent } from './ProductBlockContent';
|
|
4
4
|
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
|
|
5
|
-
|
|
5
|
+
dynamicTextSource?: JSONRefObject & {
|
|
6
6
|
list?: Record<string, string>[];
|
|
7
7
|
};
|
|
8
8
|
}
|
|
@@ -4,19 +4,24 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
|
4
4
|
import { UniBlock } from '../../UniBlock/UniBlock.js';
|
|
5
5
|
import { saveSessionQuery } from '../../utils/getSessionQuery.js';
|
|
6
6
|
import { style } from '../../utils/style.js';
|
|
7
|
-
export const ProductBlock = UniBlock(({ className, padding, defaultPadding,
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
export const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicQueryParamText = {}, dynamicTextSource, description, title, ...rest }) => {
|
|
8
|
+
const { textType } = dynamicQueryParamText;
|
|
9
|
+
const formatText = getFormatDescription(dynamicQueryParamText, dynamicTextSource?.list, textType === 'title' ? title : description);
|
|
10
|
+
const textProps = {
|
|
11
|
+
title: textType === 'title' ? formatText : title,
|
|
12
|
+
description: textType === 'description' ? formatText : description,
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: _jsx(BaseProductTile, { defaultPadding: defaultPadding || 'p-6xl', padding: padding, className: "grow h-full", ...textProps, ...rest }) }));
|
|
10
15
|
});
|
|
11
|
-
const getFormatDescription = (
|
|
12
|
-
const {
|
|
16
|
+
const getFormatDescription = (dynamicQueryParamText = {}, valuesList = [], text = '') => {
|
|
17
|
+
const { queryParam, value } = dynamicQueryParamText;
|
|
13
18
|
const sessionQuery = saveSessionQuery();
|
|
14
|
-
const utmValue =
|
|
15
|
-
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
16
|
-
return dynamicValue ?
|
|
19
|
+
const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
|
|
20
|
+
const dynamicValue = valuesList.find((item) => item?.id?.toLowerCase() === utmValue?.toLowerCase())?.value;
|
|
21
|
+
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
17
22
|
};
|
|
18
|
-
const
|
|
23
|
+
const getQueryParamValue = (queryParam, queryString) => {
|
|
19
24
|
const params = new URLSearchParams(queryString);
|
|
20
|
-
return params.get(
|
|
25
|
+
return params.get(queryParam);
|
|
21
26
|
};
|
|
22
27
|
//# sourceMappingURL=ProductBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductBlock.js","sourceRoot":"","sources":["../../../src/components/ProductBlock/ProductBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAS1C,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAClC,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,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,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAC3B,wBAAqC,EAAE,EACvC,aAAuC,EAAE,EACzC,IAAI,GAAG,EAAE,EACT,EAAE;IACF,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC;IACpD,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,UAAU,IAAI,YAAY,EAAE,YAAY,CAAC,CAAC;IAC9E,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAClC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,CAC9D,EAAE,KAAK,CAAC;IAET,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAE,WAAmB,EAAE,EAAE;IACrE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;IAEhD,OAAO,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type AdditionalDescriptionProps, type
|
|
1
|
+
import { type AdditionalDescriptionProps, type DynamicTextProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
|
|
3
3
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
4
4
|
/**
|
|
5
5
|
* @title Продуктовый блок
|
|
6
6
|
*/
|
|
7
|
-
export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & AdditionalDescriptionProps &
|
|
7
|
+
export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & AdditionalDescriptionProps & DynamicTextProps & {
|
|
8
8
|
/** @title Отображать кнопку возврата */
|
|
9
9
|
backwardButton?: boolean;
|
|
10
10
|
};
|
|
@@ -36,19 +36,26 @@ export declare type AdditionalDescriptionProps = {
|
|
|
36
36
|
/** @title Дополнительное описание */
|
|
37
37
|
additionalDescription?: string;
|
|
38
38
|
};
|
|
39
|
-
export declare type
|
|
40
|
-
/** @title Динамическое описание по значению
|
|
41
|
-
|
|
39
|
+
export declare type DynamicTextProps = {
|
|
40
|
+
/** @title Динамическое описание по значению query-параметра */
|
|
41
|
+
dynamicQueryParamText?: DynamicText;
|
|
42
42
|
/** @title Справочник значений */
|
|
43
|
-
|
|
43
|
+
dynamicTextSource?: JSONRefObject;
|
|
44
44
|
};
|
|
45
|
-
export declare type HeadlineCommonProps = TitleProps & DescriptionProps & AlignProps & AdditionalDescriptionProps &
|
|
45
|
+
export declare type HeadlineCommonProps = TitleProps & DescriptionProps & AlignProps & AdditionalDescriptionProps & DynamicTextProps;
|
|
46
46
|
export declare type HeadlineProps = HeadlineCommonProps & {
|
|
47
47
|
headlineVersion?: HeadlineVersion;
|
|
48
48
|
};
|
|
49
|
-
export declare type
|
|
50
|
-
/** @title
|
|
51
|
-
|
|
49
|
+
export declare type DynamicText = {
|
|
50
|
+
/** @title query-параметр */
|
|
51
|
+
queryParam?: string;
|
|
52
52
|
/** @title Заменяемый текст */
|
|
53
53
|
value?: string;
|
|
54
|
+
/** @title Тип текста, где будет произведена замена */
|
|
55
|
+
textType?: TextType;
|
|
54
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* @title Тип текста
|
|
59
|
+
* @enumNames ["Описание", "Заголовок"]
|
|
60
|
+
*/
|
|
61
|
+
export declare type TextType = 'description' | 'title';
|
|
@@ -37,9 +37,14 @@ export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(({ onChangeEsiaStatus,
|
|
|
37
37
|
<div className="flex items-center rounded-md bg-main-gray p-4xl">
|
|
38
38
|
<div className="flex gap-m flex-col justify-around w-full">
|
|
39
39
|
<p className="text-xl">{`Заполните данные через Госуслуги${
|
|
40
|
-
productType === 'debitCard' ? '
|
|
40
|
+
productType === 'debitCard' ? ': ' : ''
|
|
41
41
|
}`}</p>
|
|
42
|
-
{productType === 'debitCard' ?
|
|
42
|
+
{productType === 'debitCard' ? (
|
|
43
|
+
<ul className="list-disc list-inside">
|
|
44
|
+
<li>значительно сократит время оформления заявки</li>
|
|
45
|
+
<li>доступна курьерская доставка в г. Москва (в пределах МКАД)</li>
|
|
46
|
+
</ul>
|
|
47
|
+
) : (
|
|
43
48
|
<ul className="list-disc list-inside">
|
|
44
49
|
<li>Вероятность одобрения выше</li>
|
|
45
50
|
<li>Без справок о доходах и трудоустройстве</li>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSONRefObject } from '../../data/JSONRefObject';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DynamicText } from '../../model/HeadlineType';
|
|
3
3
|
import { BaseProductTile } from '../../ui-kit/BaseProductTile/BaseProductTile';
|
|
4
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
5
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
@@ -9,7 +9,7 @@ import { style } from '../../utils/style';
|
|
|
9
9
|
import { type ProductBlockContent } from './ProductBlockContent';
|
|
10
10
|
|
|
11
11
|
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
|
|
12
|
-
|
|
12
|
+
dynamicTextSource?: JSONRefObject & {
|
|
13
13
|
list?: Record<string, string>[];
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -19,17 +19,24 @@ export const ProductBlock = UniBlock<ProductBlockProps>(
|
|
|
19
19
|
className,
|
|
20
20
|
padding,
|
|
21
21
|
defaultPadding,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
dynamicQueryParamText = {},
|
|
23
|
+
dynamicTextSource,
|
|
24
24
|
description,
|
|
25
|
+
title,
|
|
25
26
|
...rest
|
|
26
27
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const { textType } = dynamicQueryParamText;
|
|
29
|
+
const formatText = getFormatDescription(
|
|
30
|
+
dynamicQueryParamText,
|
|
31
|
+
dynamicTextSource?.list,
|
|
32
|
+
textType === 'title' ? title : description,
|
|
31
33
|
);
|
|
32
34
|
|
|
35
|
+
const textProps = {
|
|
36
|
+
title: textType === 'title' ? formatText : title,
|
|
37
|
+
description: textType === 'description' ? formatText : description,
|
|
38
|
+
};
|
|
39
|
+
|
|
33
40
|
return (
|
|
34
41
|
<BlockWrapper
|
|
35
42
|
className={style('overflow-hidden flex flex-col gap-3xl box-border', className)}
|
|
@@ -39,8 +46,8 @@ export const ProductBlock = UniBlock<ProductBlockProps>(
|
|
|
39
46
|
<BaseProductTile
|
|
40
47
|
defaultPadding={defaultPadding || 'p-6xl'}
|
|
41
48
|
padding={padding}
|
|
42
|
-
description={formatDescription}
|
|
43
49
|
className="grow h-full"
|
|
50
|
+
{...textProps}
|
|
44
51
|
{...rest}
|
|
45
52
|
/>
|
|
46
53
|
</BlockWrapper>
|
|
@@ -49,20 +56,22 @@ export const ProductBlock = UniBlock<ProductBlockProps>(
|
|
|
49
56
|
);
|
|
50
57
|
|
|
51
58
|
const getFormatDescription = (
|
|
52
|
-
|
|
59
|
+
dynamicQueryParamText: DynamicText = {},
|
|
53
60
|
valuesList: Record<string, string>[] = [],
|
|
54
|
-
|
|
61
|
+
text = '',
|
|
55
62
|
) => {
|
|
56
|
-
const {
|
|
63
|
+
const { queryParam, value } = dynamicQueryParamText;
|
|
57
64
|
const sessionQuery = saveSessionQuery();
|
|
58
|
-
const utmValue =
|
|
59
|
-
const dynamicValue = valuesList.find(
|
|
65
|
+
const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
|
|
66
|
+
const dynamicValue = valuesList.find(
|
|
67
|
+
(item) => item?.id?.toLowerCase() === utmValue?.toLowerCase(),
|
|
68
|
+
)?.value;
|
|
60
69
|
|
|
61
|
-
return dynamicValue ?
|
|
70
|
+
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
62
71
|
};
|
|
63
72
|
|
|
64
|
-
const
|
|
73
|
+
const getQueryParamValue = (queryParam: string, queryString: string) => {
|
|
65
74
|
const params = new URLSearchParams(queryString);
|
|
66
75
|
|
|
67
|
-
return params.get(
|
|
76
|
+
return params.get(queryParam);
|
|
68
77
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type AdditionalDescriptionProps,
|
|
3
|
-
type DynamicDescriptionProps,
|
|
4
|
-
} from '../../model/HeadlineType';
|
|
1
|
+
import { type AdditionalDescriptionProps, type DynamicTextProps } from '../../model/HeadlineType';
|
|
5
2
|
import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
|
|
6
3
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
7
4
|
|
|
@@ -11,7 +8,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
11
8
|
export type ProductBlockContent = UniBlockContent &
|
|
12
9
|
BaseProductTileContent &
|
|
13
10
|
AdditionalDescriptionProps &
|
|
14
|
-
|
|
11
|
+
DynamicTextProps & {
|
|
15
12
|
/** @title Отображать кнопку возврата */
|
|
16
13
|
backwardButton?: boolean;
|
|
17
14
|
};
|
|
@@ -46,26 +46,34 @@ export type AdditionalDescriptionProps = {
|
|
|
46
46
|
additionalDescription?: string;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export type
|
|
50
|
-
/** @title Динамическое описание по значению
|
|
51
|
-
|
|
49
|
+
export type DynamicTextProps = {
|
|
50
|
+
/** @title Динамическое описание по значению query-параметра */
|
|
51
|
+
dynamicQueryParamText?: DynamicText;
|
|
52
52
|
/** @title Справочник значений */
|
|
53
|
-
|
|
53
|
+
dynamicTextSource?: JSONRefObject;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export type HeadlineCommonProps = TitleProps &
|
|
57
57
|
DescriptionProps &
|
|
58
58
|
AlignProps &
|
|
59
59
|
AdditionalDescriptionProps &
|
|
60
|
-
|
|
60
|
+
DynamicTextProps;
|
|
61
61
|
|
|
62
62
|
export type HeadlineProps = HeadlineCommonProps & {
|
|
63
63
|
headlineVersion?: HeadlineVersion;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
export type
|
|
67
|
-
/** @title
|
|
68
|
-
|
|
66
|
+
export type DynamicText = {
|
|
67
|
+
/** @title query-параметр */
|
|
68
|
+
queryParam?: string;
|
|
69
69
|
/** @title Заменяемый текст */
|
|
70
70
|
value?: string;
|
|
71
|
+
/** @title Тип текста, где будет произведена замена */
|
|
72
|
+
textType?: TextType;
|
|
71
73
|
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @title Тип текста
|
|
77
|
+
* @enumNames ["Описание", "Заголовок"]
|
|
78
|
+
*/
|
|
79
|
+
export type TextType = 'description' | 'title';
|
package/package.json
CHANGED
|
@@ -37,9 +37,14 @@ export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(({ onChangeEsiaStatus,
|
|
|
37
37
|
<div className="flex items-center rounded-md bg-main-gray p-4xl">
|
|
38
38
|
<div className="flex gap-m flex-col justify-around w-full">
|
|
39
39
|
<p className="text-xl">{`Заполните данные через Госуслуги${
|
|
40
|
-
productType === 'debitCard' ? '
|
|
40
|
+
productType === 'debitCard' ? ': ' : ''
|
|
41
41
|
}`}</p>
|
|
42
|
-
{productType === 'debitCard' ?
|
|
42
|
+
{productType === 'debitCard' ? (
|
|
43
|
+
<ul className="list-disc list-inside">
|
|
44
|
+
<li>значительно сократит время оформления заявки</li>
|
|
45
|
+
<li>доступна курьерская доставка в г. Москва (в пределах МКАД)</li>
|
|
46
|
+
</ul>
|
|
47
|
+
) : (
|
|
43
48
|
<ul className="list-disc list-inside">
|
|
44
49
|
<li>Вероятность одобрения выше</li>
|
|
45
50
|
<li>Без справок о доходах и трудоустройстве</li>
|