@redneckz/wildless-cms-uni-blocks 0.14.1006 → 0.14.1012

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.
Files changed (137) hide show
  1. package/bundle/bundle.umd.js +101 -82
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/api/apiBaseUrl.d.ts +2 -1
  4. package/bundle/retail/utils/getBaseUrl.d.ts +1 -0
  5. package/bundle/retail/validator/validators.d.ts +1 -0
  6. package/dist/components/CalculatorRko/CalculatorRko.js +16 -16
  7. package/dist/components/CalculatorRko/CalculatorRko.js.map +1 -1
  8. package/dist/components/DebitForm/DebitFormStatus.js +2 -2
  9. package/dist/components/DebitForm/DebitFormStatus.js.map +1 -1
  10. package/dist/components/RkoTariffCardsTable/RkoTariffCard.js +1 -1
  11. package/dist/components/RkoTariffCardsTable/RkoTariffCard.js.map +1 -1
  12. package/dist/components/RkoTariffCardsTable/RkoTariffCardsTable.js +3 -3
  13. package/dist/components/RkoTariffCardsTable/RkoTariffCardsTable.js.map +1 -1
  14. package/dist/components/RkoTariffCardsTable/constants.js +1 -1
  15. package/dist/retail/api/apiBaseUrl.d.ts +2 -1
  16. package/dist/retail/api/apiBaseUrl.js +3 -2
  17. package/dist/retail/api/apiBaseUrl.js.map +1 -1
  18. package/dist/retail/api/doRequest.js +3 -4
  19. package/dist/retail/api/doRequest.js.map +1 -1
  20. package/dist/retail/components/Fields/CodeWordField.js +12 -1
  21. package/dist/retail/components/Fields/CodeWordField.js.map +1 -1
  22. package/dist/retail/hooks/useLeadFormData.js +3 -2
  23. package/dist/retail/hooks/useLeadFormData.js.map +1 -1
  24. package/dist/retail/utils/getBaseUrl.d.ts +1 -0
  25. package/dist/retail/utils/getBaseUrl.js +13 -0
  26. package/dist/retail/utils/getBaseUrl.js.map +1 -0
  27. package/dist/retail/validator/validators.d.ts +1 -0
  28. package/dist/retail/validator/validators.js +3 -3
  29. package/dist/retail/validator/validators.js.map +1 -1
  30. package/lib/common.css +1 -1
  31. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.d.ts +1 -0
  32. package/lib/components/CalculatorRko/CalculatorRko.js +16 -16
  33. package/lib/components/CalculatorRko/CalculatorRko.js.map +1 -1
  34. package/lib/components/DebitForm/DebitFormStatus.js +2 -2
  35. package/lib/components/DebitForm/DebitFormStatus.js.map +1 -1
  36. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  37. package/lib/components/RkoTariffCardsTable/RkoTariffCard.js +1 -1
  38. package/lib/components/RkoTariffCardsTable/RkoTariffCard.js.map +1 -1
  39. package/lib/components/RkoTariffCardsTable/RkoTariffCardsTable.js +3 -3
  40. package/lib/components/RkoTariffCardsTable/RkoTariffCardsTable.js.map +1 -1
  41. package/lib/components/RkoTariffCardsTable/constants.js +1 -1
  42. package/lib/retail/api/apiBaseUrl.d.ts +2 -1
  43. package/lib/retail/api/apiBaseUrl.js +2 -1
  44. package/lib/retail/api/apiBaseUrl.js.map +1 -1
  45. package/lib/retail/api/doRequest.js +3 -4
  46. package/lib/retail/api/doRequest.js.map +1 -1
  47. package/lib/retail/components/Fields/CodeWordField.js +12 -1
  48. package/lib/retail/components/Fields/CodeWordField.js.map +1 -1
  49. package/lib/retail/hooks/useLeadFormData.js +3 -2
  50. package/lib/retail/hooks/useLeadFormData.js.map +1 -1
  51. package/lib/retail/utils/getBaseUrl.d.ts +1 -0
  52. package/lib/retail/utils/getBaseUrl.js +10 -0
  53. package/lib/retail/utils/getBaseUrl.js.map +1 -0
  54. package/lib/retail/validator/validators.d.ts +1 -0
  55. package/lib/retail/validator/validators.js +1 -1
  56. package/lib/retail/validator/validators.js.map +1 -1
  57. package/mobile/bundle/bundle.umd.js +101 -82
  58. package/mobile/bundle/bundle.umd.min.js +1 -1
  59. package/mobile/bundle/retail/api/apiBaseUrl.d.ts +2 -1
  60. package/mobile/bundle/retail/utils/getBaseUrl.d.ts +1 -0
  61. package/mobile/bundle/retail/validator/validators.d.ts +1 -0
  62. package/mobile/dist/components/CalculatorRko/CalculatorRko.js +16 -16
  63. package/mobile/dist/components/CalculatorRko/CalculatorRko.js.map +1 -1
  64. package/mobile/dist/components/DebitForm/DebitFormStatus.js +2 -2
  65. package/mobile/dist/components/DebitForm/DebitFormStatus.js.map +1 -1
  66. package/mobile/dist/components/RkoTariffCardsTable/RkoTariffCard.js +1 -1
  67. package/mobile/dist/components/RkoTariffCardsTable/RkoTariffCard.js.map +1 -1
  68. package/mobile/dist/components/RkoTariffCardsTable/RkoTariffCardsTable.js +3 -3
  69. package/mobile/dist/components/RkoTariffCardsTable/RkoTariffCardsTable.js.map +1 -1
  70. package/mobile/dist/components/RkoTariffCardsTable/constants.js +1 -1
  71. package/mobile/dist/retail/api/apiBaseUrl.d.ts +2 -1
  72. package/mobile/dist/retail/api/apiBaseUrl.js +3 -2
  73. package/mobile/dist/retail/api/apiBaseUrl.js.map +1 -1
  74. package/mobile/dist/retail/api/doRequest.js +3 -4
  75. package/mobile/dist/retail/api/doRequest.js.map +1 -1
  76. package/mobile/dist/retail/components/Fields/CodeWordField.js +12 -1
  77. package/mobile/dist/retail/components/Fields/CodeWordField.js.map +1 -1
  78. package/mobile/dist/retail/hooks/useLeadFormData.js +3 -2
  79. package/mobile/dist/retail/hooks/useLeadFormData.js.map +1 -1
  80. package/mobile/dist/retail/utils/getBaseUrl.d.ts +1 -0
  81. package/mobile/dist/retail/utils/getBaseUrl.js +13 -0
  82. package/mobile/dist/retail/utils/getBaseUrl.js.map +1 -0
  83. package/mobile/dist/retail/validator/validators.d.ts +1 -0
  84. package/mobile/dist/retail/validator/validators.js +3 -3
  85. package/mobile/dist/retail/validator/validators.js.map +1 -1
  86. package/mobile/lib/common.css +1 -1
  87. package/mobile/lib/components/CalculatorRko/CalculatorRko.js +16 -16
  88. package/mobile/lib/components/CalculatorRko/CalculatorRko.js.map +1 -1
  89. package/mobile/lib/components/DebitForm/DebitFormStatus.js +2 -2
  90. package/mobile/lib/components/DebitForm/DebitFormStatus.js.map +1 -1
  91. package/mobile/lib/components/RkoTariffCardsTable/RkoTariffCard.js +1 -1
  92. package/mobile/lib/components/RkoTariffCardsTable/RkoTariffCard.js.map +1 -1
  93. package/mobile/lib/components/RkoTariffCardsTable/RkoTariffCardsTable.js +3 -3
  94. package/mobile/lib/components/RkoTariffCardsTable/RkoTariffCardsTable.js.map +1 -1
  95. package/mobile/lib/components/RkoTariffCardsTable/constants.js +1 -1
  96. package/mobile/lib/retail/api/apiBaseUrl.d.ts +2 -1
  97. package/mobile/lib/retail/api/apiBaseUrl.js +2 -1
  98. package/mobile/lib/retail/api/apiBaseUrl.js.map +1 -1
  99. package/mobile/lib/retail/api/doRequest.js +3 -4
  100. package/mobile/lib/retail/api/doRequest.js.map +1 -1
  101. package/mobile/lib/retail/components/Fields/CodeWordField.js +12 -1
  102. package/mobile/lib/retail/components/Fields/CodeWordField.js.map +1 -1
  103. package/mobile/lib/retail/hooks/useLeadFormData.js +3 -2
  104. package/mobile/lib/retail/hooks/useLeadFormData.js.map +1 -1
  105. package/mobile/lib/retail/utils/getBaseUrl.d.ts +1 -0
  106. package/mobile/lib/retail/utils/getBaseUrl.js +10 -0
  107. package/mobile/lib/retail/utils/getBaseUrl.js.map +1 -0
  108. package/mobile/lib/retail/validator/validators.d.ts +1 -0
  109. package/mobile/lib/retail/validator/validators.js +1 -1
  110. package/mobile/lib/retail/validator/validators.js.map +1 -1
  111. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +2 -3
  112. package/mobile/src/components/CalculatorRko/CalculatorRko.tsx +4 -4
  113. package/mobile/src/components/DebitForm/DebitFormStatus.tsx +2 -2
  114. package/mobile/src/components/RkoTariffCardsTable/RkoTariffCard.tsx +1 -1
  115. package/mobile/src/components/RkoTariffCardsTable/RkoTariffCardsTable.tsx +5 -3
  116. package/mobile/src/components/RkoTariffCardsTable/constants.ts +1 -1
  117. package/mobile/src/retail/api/apiBaseUrl.ts +2 -1
  118. package/mobile/src/retail/api/doRequest.ts +13 -17
  119. package/mobile/src/retail/components/Fields/CodeWordField.tsx +24 -8
  120. package/mobile/src/retail/hooks/useLeadFormData.ts +4 -3
  121. package/mobile/src/retail/utils/getBaseUrl.ts +17 -0
  122. package/mobile/src/retail/validator/validators.ts +1 -1
  123. package/package.json +1 -1
  124. package/src/components/ApplicationForm/ApplicationForm.example.json +2 -3
  125. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +1 -2
  126. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +15 -0
  127. package/src/components/CalculatorRko/CalculatorRko.tsx +4 -4
  128. package/src/components/DebitForm/DebitFormStatus.tsx +2 -2
  129. package/src/components/RkoTariffCardsTable/RkoTariffCard.tsx +1 -1
  130. package/src/components/RkoTariffCardsTable/RkoTariffCardsTable.tsx +5 -3
  131. package/src/components/RkoTariffCardsTable/constants.ts +1 -1
  132. package/src/retail/api/apiBaseUrl.ts +2 -1
  133. package/src/retail/api/doRequest.ts +13 -17
  134. package/src/retail/components/Fields/CodeWordField.tsx +24 -8
  135. package/src/retail/hooks/useLeadFormData.ts +4 -3
  136. package/src/retail/utils/getBaseUrl.ts +17 -0
  137. package/src/retail/validator/validators.ts +1 -1
@@ -110,11 +110,10 @@ export const CalculatorRko = UniBlock<RkoCalculatorProps>(
110
110
  </div>
111
111
  ))}
112
112
  </div>
113
- <div className={style(CalculatorStyle.result)}>{renderFootnote(footnote)}</div>
114
113
  </section>
115
114
  </CalculatorLayout>
116
115
  <BlockWrapper
117
- className={style('flex flex-col gap-4xl items-center', className)}
116
+ className={style('flex flex-col items-center', className)}
118
117
  defaultPadding="p-4xl pt-0"
119
118
  {...rest}
120
119
  >
@@ -128,6 +127,7 @@ export const CalculatorRko = UniBlock<RkoCalculatorProps>(
128
127
  ) : (
129
128
  <Loader position="static" />
130
129
  )}
130
+ <div className={style(CalculatorStyle.result)}>{renderFootnote(footnote)}</div>
131
131
  </BlockWrapper>
132
132
  </div>
133
133
  );
@@ -135,7 +135,7 @@ export const CalculatorRko = UniBlock<RkoCalculatorProps>(
135
135
  );
136
136
 
137
137
  const renderHeading = () => (
138
- <Text size="text-h6" font="font-medium" align="text-center" className="block lg:mb-0 mb-m">
139
- Расчеты за один месяц по введенным выше параметрам
138
+ <Text size="text-h6" font="font-medium" align="text-center" className="block lg:mb-xl mb-m">
139
+ Расчёты за один месяц по введенным выше параметрам
140
140
  </Text>
141
141
  );
@@ -15,7 +15,7 @@ type DebitFormStatusProps = UniBlockProps &
15
15
  isDboClient?: boolean;
16
16
  };
17
17
 
18
- const INTERNET_BANK_LINK = 'https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault';
18
+ const INTERNET_BANK_LINK = 'https://online.rshb.ru/d?l=dcNqSvOE';
19
19
 
20
20
  export const DebitFormStatus = JSX<DebitFormStatusProps>(
21
21
  ({ title, description: dsc, sectionInfo, buttonText, isDboClient, ...props }) => {
@@ -50,7 +50,7 @@ export const DebitFormStatus = JSX<DebitFormStatusProps>(
50
50
  />
51
51
  <LinkButton
52
52
  href={INTERNET_BANK_LINK}
53
- text="Перейти в интернет банк"
53
+ text="Выпустить карту в приложении"
54
54
  version="primary"
55
55
  className="w-full mt-lg"
56
56
  />
@@ -57,7 +57,7 @@ export const RkoTariffCard = JSX(
57
57
  <div
58
58
  className={style(
59
59
  className,
60
- 'rounded-xl min-h-24 items-center min-w-0 lg:p-xl p-3xl',
60
+ 'rounded-xl min-h-24 items-center min-w-0 lg:p-xl p-3xl lg:mb-m mb-xl',
61
61
  isBest
62
62
  ? 'bg-primary-main text-white relative'
63
63
  : 'bg-white text-primary-text border border-solid border-gray',
@@ -21,10 +21,12 @@ export const RkoTariffCardsTable = JSX(
21
21
  const commissionTypes: CommissionKey[] = getSortedCommissionTypes(items) ?? [];
22
22
  const columnsCount = commissionTypes.length + 4; // 2 на "Название тарифа" и 2 на кнопку
23
23
 
24
- const tableLayoutStyle = `lg:grid lg:grid-cols-${String(columnsCount)} gap-m lg:px-xl px-3xl`;
24
+ const tableLayoutStyle = `lg:grid lg:grid-cols-${String(
25
+ columnsCount,
26
+ )} gap-m lg:px-xl px-3xl order-first lg:mb-m mb-xl`;
25
27
 
26
28
  return (
27
- <div className="lg:space-y-m space-y-xl w-full">
29
+ <div className="w-full flex flex-col mt-s">
28
30
  {isMobileMode
29
31
  ? null
30
32
  : renderRkoTariffsTableHeader({
@@ -33,7 +35,7 @@ export const RkoTariffCardsTable = JSX(
33
35
  })}
34
36
 
35
37
  {items.map((item, index) => (
36
- <div key={index}>
38
+ <div key={index} className={item?.isBest ? 'order-first' : ''}>
37
39
  <RkoTariffCard
38
40
  {...item}
39
41
  className={tableLayoutStyle}
@@ -1,6 +1,6 @@
1
1
  export const RKO_COMMISSIONS_TITLE_MAP: Record<string, string> = {
2
2
  tariffName: 'Название тарифа',
3
- accountServiceFee: 'Обслуживание счета',
3
+ accountServiceFee: 'Обслуживание счёта',
4
4
  transferLegalCountCommission: 'Переводы Юрлицам и ИП',
5
5
  flTransferSumCommission: 'Переводы физлицам',
6
6
  cashOutSumCommission: 'Снятие наличных',
@@ -1,2 +1,3 @@
1
1
  export const RETAIL_API_BASE_URI = '/light-api-cash/v1';
2
- export const NEW_RETAIL_API_BASE_URI = '/api/credit-application';
2
+ export const NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
3
+ export const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
@@ -1,5 +1,4 @@
1
- import { checkNewMicroservice } from '../utils/checkNewMicroservice';
2
- import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from './apiBaseUrl';
1
+ import { getBaseUrl } from '../utils/getBaseUrl';
3
2
  import { getTraceId } from './getTraceId';
4
3
 
5
4
  export const fetchRetailJSON = async <R>(
@@ -23,24 +22,21 @@ export async function doRequest(
23
22
  method: 'POST' | 'GET' | 'PUT',
24
23
  body?: any,
25
24
  ): Promise<Response> {
26
- const isNewMicroservice = checkNewMicroservice();
25
+ const baseUrl = getBaseUrl();
27
26
  const traceId = getTraceId();
28
27
 
29
- return globalThis?.fetch?.(
30
- `${isNewMicroservice ? NEW_RETAIL_API_BASE_URI : RETAIL_API_BASE_URI}${url}`,
31
- {
32
- method,
33
- headers: {
34
- 'Content-Type': 'application/json',
35
- 'X-B3-Sampled': '1',
36
- 'X-B3-Spanid': traceId,
37
- 'X-B3-Traceid': traceId,
38
- ...getAuthorizationHeaders(),
39
- },
40
- credentials: 'include',
41
- body: body ? JSON.stringify(body) : null,
28
+ return globalThis?.fetch?.(`${baseUrl}${url}`, {
29
+ method,
30
+ headers: {
31
+ 'Content-Type': 'application/json',
32
+ 'X-B3-Sampled': '1',
33
+ 'X-B3-Spanid': traceId,
34
+ 'X-B3-Traceid': traceId,
35
+ ...getAuthorizationHeaders(),
42
36
  },
43
- );
37
+ credentials: 'include',
38
+ body: body ? JSON.stringify(body) : null,
39
+ });
44
40
  }
45
41
 
46
42
  export const getAuthorizationHeaders = () => {
@@ -1,12 +1,28 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
+ import { autoLayoutKeyboard } from '../../utils/autoLayoutKeyboard';
5
+ import { codeWordPattern } from '../../validator/validators';
3
6
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
7
 
5
- export const CodeWordField = JSX<CustomFieldProps>(({ field, input }) => (
6
- <DaDataInputControl
7
- label="Кодовое слово"
8
- maxLength={20}
9
- {...field(input?.name ?? '')}
10
- {...input}
11
- />
12
- ));
8
+ export const CodeWordField = JSX<CustomFieldProps>(({ field, input }) => {
9
+ const onChange = useCallback(
10
+ (value: string) => {
11
+ const translatedValue = autoLayoutKeyboard(value);
12
+ if (codeWordPattern.test(translatedValue) || translatedValue.length === 0) {
13
+ field(input?.name ?? '')?.onChange?.(translatedValue);
14
+ }
15
+ },
16
+ [field, input],
17
+ );
18
+
19
+ return (
20
+ <DaDataInputControl
21
+ label="Кодовое слово"
22
+ maxLength={20}
23
+ {...field(input?.name ?? '')}
24
+ {...input}
25
+ onChange={onChange}
26
+ />
27
+ );
28
+ });
@@ -1,8 +1,8 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
2
  import { fetchJSON } from '../../utils/fetchJSON';
3
- import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from '../api/apiBaseUrl';
4
3
  import { type DictionaryItem } from '../model/LeadFormData';
5
4
  import { checkNewMicroservice } from '../utils/checkNewMicroservice';
5
+ import { getBaseUrl } from '../utils/getBaseUrl';
6
6
 
7
7
  type ErrorProps = {
8
8
  errorMessage?: string;
@@ -10,10 +10,11 @@ type ErrorProps = {
10
10
 
11
11
  export const useLeadFormData = (typeField: string) => {
12
12
  const isNewMicroservice = checkNewMicroservice();
13
+ const baseUrl = getBaseUrl();
13
14
 
14
15
  const { data, error } = useAsyncData(
15
- `${
16
- isNewMicroservice ? `${NEW_RETAIL_API_BASE_URI}/public-data` : RETAIL_API_BASE_URI
16
+ `${baseUrl}${
17
+ isNewMicroservice ? `/public-data` : ''
17
18
  }/dictionary?dictionaryType=${encodeURIComponent(typeField)}`,
18
19
  fetchData,
19
20
  );
@@ -0,0 +1,17 @@
1
+ import {
2
+ NEW_RETAIL_CREDIT_API_BASE_URI,
3
+ NEW_RETAIL_CREDIT_CARD_API_BASE_URI,
4
+ RETAIL_API_BASE_URI,
5
+ } from '../api/apiBaseUrl';
6
+
7
+ export const getBaseUrl = () => {
8
+ const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
9
+ const productType = globalThis.localStorage?.getItem('productType');
10
+
11
+ const newRetailApi =
12
+ productType === '"credit"'
13
+ ? NEW_RETAIL_CREDIT_API_BASE_URI
14
+ : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
15
+
16
+ return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
17
+ };
@@ -12,7 +12,7 @@ export interface LimitedBirthdayValidationParams {
12
12
  errorMessage: string;
13
13
  }
14
14
 
15
- const codeWordPattern = /^[0-9а-яё]*$/i;
15
+ export const codeWordPattern = /^[а-яёА-ЯЁ\d]+$/u;
16
16
  export const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
17
17
  export const retailNotCyrillicPattern = /^(?!\s*$)[^\p{Script=Cyrillic}]+$/u;
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.1006",
3
+ "version": "0.14.1012",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1743,13 +1743,12 @@
1743
1743
  { "name": "university", "required": true },
1744
1744
  { "name": "fieldOfStudy", "required": true },
1745
1745
  { "name": "courseYear", "required": true },
1746
- { "name": "graduationYear", "required": true },
1747
- { "name": "averageGrade", "required": true },
1748
- { "name": "educationLevel", "required": true }
1746
+ { "name": "graduationYear", "required": true }
1749
1747
  ]
1750
1748
  },
1751
1749
  {
1752
1750
  "inputs": [
1751
+ { "name": "educationLevel", "required": true },
1753
1752
  {
1754
1753
  "name": "skillsAndKnowledge",
1755
1754
  "placeholder": "Навыки и знания. Что умеете делать?",
@@ -1058,12 +1058,11 @@ export default {
1058
1058
  { name: 'fieldOfStudy', required: true },
1059
1059
  { name: 'courseYear', required: true },
1060
1060
  { name: 'graduationYear', required: true },
1061
- { name: 'averageGrade', required: true },
1062
- { name: 'educationLevel', required: true },
1063
1061
  ],
1064
1062
  },
1065
1063
  {
1066
1064
  inputs: [
1065
+ { name: 'educationLevel', required: true },
1067
1066
  {
1068
1067
  name: 'skillsAndKnowledge',
1069
1068
  placeholder: 'Навыки и знания. Что умеете делать?',
@@ -39,6 +39,21 @@ export default {
39
39
  </div>
40
40
  ),
41
41
 
42
+ newMicroserviceCC: (
43
+ <div className="container grid grid-cols-12">
44
+ <ApplicationLeadForm
45
+ className="col-span-12"
46
+ title="Заявка на кредит"
47
+ programId="13"
48
+ productType="creditCard"
49
+ button={button}
50
+ isNewMicroservice={true}
51
+ />
52
+ <PopupManager />
53
+ <DialogManager />
54
+ </div>
55
+ ),
56
+
42
57
  creditCard: (
43
58
  <div className="container grid grid-cols-12">
44
59
  <ApplicationLeadForm
@@ -110,11 +110,10 @@ export const CalculatorRko = UniBlock<RkoCalculatorProps>(
110
110
  </div>
111
111
  ))}
112
112
  </div>
113
- <div className={style(CalculatorStyle.result)}>{renderFootnote(footnote)}</div>
114
113
  </section>
115
114
  </CalculatorLayout>
116
115
  <BlockWrapper
117
- className={style('flex flex-col gap-4xl items-center', className)}
116
+ className={style('flex flex-col items-center', className)}
118
117
  defaultPadding="p-4xl pt-0"
119
118
  {...rest}
120
119
  >
@@ -128,6 +127,7 @@ export const CalculatorRko = UniBlock<RkoCalculatorProps>(
128
127
  ) : (
129
128
  <Loader position="static" />
130
129
  )}
130
+ <div className={style(CalculatorStyle.result)}>{renderFootnote(footnote)}</div>
131
131
  </BlockWrapper>
132
132
  </div>
133
133
  );
@@ -135,7 +135,7 @@ export const CalculatorRko = UniBlock<RkoCalculatorProps>(
135
135
  );
136
136
 
137
137
  const renderHeading = () => (
138
- <Text size="text-h6" font="font-medium" align="text-center" className="block lg:mb-0 mb-m">
139
- Расчеты за один месяц по введенным выше параметрам
138
+ <Text size="text-h6" font="font-medium" align="text-center" className="block lg:mb-xl mb-m">
139
+ Расчёты за один месяц по введенным выше параметрам
140
140
  </Text>
141
141
  );
@@ -15,7 +15,7 @@ type DebitFormStatusProps = UniBlockProps &
15
15
  isDboClient?: boolean;
16
16
  };
17
17
 
18
- const INTERNET_BANK_LINK = 'https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault';
18
+ const INTERNET_BANK_LINK = 'https://online.rshb.ru/d?l=dcNqSvOE';
19
19
 
20
20
  export const DebitFormStatus = JSX<DebitFormStatusProps>(
21
21
  ({ title, description: dsc, sectionInfo, buttonText, isDboClient, ...props }) => {
@@ -50,7 +50,7 @@ export const DebitFormStatus = JSX<DebitFormStatusProps>(
50
50
  />
51
51
  <LinkButton
52
52
  href={INTERNET_BANK_LINK}
53
- text="Перейти в интернет банк"
53
+ text="Выпустить карту в приложении"
54
54
  version="primary"
55
55
  className="w-full mt-lg"
56
56
  />
@@ -57,7 +57,7 @@ export const RkoTariffCard = JSX(
57
57
  <div
58
58
  className={style(
59
59
  className,
60
- 'rounded-xl min-h-24 items-center min-w-0 lg:p-xl p-3xl',
60
+ 'rounded-xl min-h-24 items-center min-w-0 lg:p-xl p-3xl lg:mb-m mb-xl',
61
61
  isBest
62
62
  ? 'bg-primary-main text-white relative'
63
63
  : 'bg-white text-primary-text border border-solid border-gray',
@@ -21,10 +21,12 @@ export const RkoTariffCardsTable = JSX(
21
21
  const commissionTypes: CommissionKey[] = getSortedCommissionTypes(items) ?? [];
22
22
  const columnsCount = commissionTypes.length + 4; // 2 на "Название тарифа" и 2 на кнопку
23
23
 
24
- const tableLayoutStyle = `lg:grid lg:grid-cols-${String(columnsCount)} gap-m lg:px-xl px-3xl`;
24
+ const tableLayoutStyle = `lg:grid lg:grid-cols-${String(
25
+ columnsCount,
26
+ )} gap-m lg:px-xl px-3xl order-first lg:mb-m mb-xl`;
25
27
 
26
28
  return (
27
- <div className="lg:space-y-m space-y-xl w-full">
29
+ <div className="w-full flex flex-col mt-s">
28
30
  {isMobileMode
29
31
  ? null
30
32
  : renderRkoTariffsTableHeader({
@@ -33,7 +35,7 @@ export const RkoTariffCardsTable = JSX(
33
35
  })}
34
36
 
35
37
  {items.map((item, index) => (
36
- <div key={index}>
38
+ <div key={index} className={item?.isBest ? 'order-first' : ''}>
37
39
  <RkoTariffCard
38
40
  {...item}
39
41
  className={tableLayoutStyle}
@@ -1,6 +1,6 @@
1
1
  export const RKO_COMMISSIONS_TITLE_MAP: Record<string, string> = {
2
2
  tariffName: 'Название тарифа',
3
- accountServiceFee: 'Обслуживание счета',
3
+ accountServiceFee: 'Обслуживание счёта',
4
4
  transferLegalCountCommission: 'Переводы Юрлицам и ИП',
5
5
  flTransferSumCommission: 'Переводы физлицам',
6
6
  cashOutSumCommission: 'Снятие наличных',
@@ -1,2 +1,3 @@
1
1
  export const RETAIL_API_BASE_URI = '/light-api-cash/v1';
2
- export const NEW_RETAIL_API_BASE_URI = '/api/credit-application';
2
+ export const NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
3
+ export const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
@@ -1,5 +1,4 @@
1
- import { checkNewMicroservice } from '../utils/checkNewMicroservice';
2
- import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from './apiBaseUrl';
1
+ import { getBaseUrl } from '../utils/getBaseUrl';
3
2
  import { getTraceId } from './getTraceId';
4
3
 
5
4
  export const fetchRetailJSON = async <R>(
@@ -23,24 +22,21 @@ export async function doRequest(
23
22
  method: 'POST' | 'GET' | 'PUT',
24
23
  body?: any,
25
24
  ): Promise<Response> {
26
- const isNewMicroservice = checkNewMicroservice();
25
+ const baseUrl = getBaseUrl();
27
26
  const traceId = getTraceId();
28
27
 
29
- return globalThis?.fetch?.(
30
- `${isNewMicroservice ? NEW_RETAIL_API_BASE_URI : RETAIL_API_BASE_URI}${url}`,
31
- {
32
- method,
33
- headers: {
34
- 'Content-Type': 'application/json',
35
- 'X-B3-Sampled': '1',
36
- 'X-B3-Spanid': traceId,
37
- 'X-B3-Traceid': traceId,
38
- ...getAuthorizationHeaders(),
39
- },
40
- credentials: 'include',
41
- body: body ? JSON.stringify(body) : null,
28
+ return globalThis?.fetch?.(`${baseUrl}${url}`, {
29
+ method,
30
+ headers: {
31
+ 'Content-Type': 'application/json',
32
+ 'X-B3-Sampled': '1',
33
+ 'X-B3-Spanid': traceId,
34
+ 'X-B3-Traceid': traceId,
35
+ ...getAuthorizationHeaders(),
42
36
  },
43
- );
37
+ credentials: 'include',
38
+ body: body ? JSON.stringify(body) : null,
39
+ });
44
40
  }
45
41
 
46
42
  export const getAuthorizationHeaders = () => {
@@ -1,12 +1,28 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
+ import { autoLayoutKeyboard } from '../../utils/autoLayoutKeyboard';
5
+ import { codeWordPattern } from '../../validator/validators';
3
6
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
7
 
5
- export const CodeWordField = JSX<CustomFieldProps>(({ field, input }) => (
6
- <DaDataInputControl
7
- label="Кодовое слово"
8
- maxLength={20}
9
- {...field(input?.name ?? '')}
10
- {...input}
11
- />
12
- ));
8
+ export const CodeWordField = JSX<CustomFieldProps>(({ field, input }) => {
9
+ const onChange = useCallback(
10
+ (value: string) => {
11
+ const translatedValue = autoLayoutKeyboard(value);
12
+ if (codeWordPattern.test(translatedValue) || translatedValue.length === 0) {
13
+ field(input?.name ?? '')?.onChange?.(translatedValue);
14
+ }
15
+ },
16
+ [field, input],
17
+ );
18
+
19
+ return (
20
+ <DaDataInputControl
21
+ label="Кодовое слово"
22
+ maxLength={20}
23
+ {...field(input?.name ?? '')}
24
+ {...input}
25
+ onChange={onChange}
26
+ />
27
+ );
28
+ });
@@ -1,8 +1,8 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
2
  import { fetchJSON } from '../../utils/fetchJSON';
3
- import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from '../api/apiBaseUrl';
4
3
  import { type DictionaryItem } from '../model/LeadFormData';
5
4
  import { checkNewMicroservice } from '../utils/checkNewMicroservice';
5
+ import { getBaseUrl } from '../utils/getBaseUrl';
6
6
 
7
7
  type ErrorProps = {
8
8
  errorMessage?: string;
@@ -10,10 +10,11 @@ type ErrorProps = {
10
10
 
11
11
  export const useLeadFormData = (typeField: string) => {
12
12
  const isNewMicroservice = checkNewMicroservice();
13
+ const baseUrl = getBaseUrl();
13
14
 
14
15
  const { data, error } = useAsyncData(
15
- `${
16
- isNewMicroservice ? `${NEW_RETAIL_API_BASE_URI}/public-data` : RETAIL_API_BASE_URI
16
+ `${baseUrl}${
17
+ isNewMicroservice ? `/public-data` : ''
17
18
  }/dictionary?dictionaryType=${encodeURIComponent(typeField)}`,
18
19
  fetchData,
19
20
  );
@@ -0,0 +1,17 @@
1
+ import {
2
+ NEW_RETAIL_CREDIT_API_BASE_URI,
3
+ NEW_RETAIL_CREDIT_CARD_API_BASE_URI,
4
+ RETAIL_API_BASE_URI,
5
+ } from '../api/apiBaseUrl';
6
+
7
+ export const getBaseUrl = () => {
8
+ const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
9
+ const productType = globalThis.localStorage?.getItem('productType');
10
+
11
+ const newRetailApi =
12
+ productType === '"credit"'
13
+ ? NEW_RETAIL_CREDIT_API_BASE_URI
14
+ : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
15
+
16
+ return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
17
+ };
@@ -12,7 +12,7 @@ export interface LimitedBirthdayValidationParams {
12
12
  errorMessage: string;
13
13
  }
14
14
 
15
- const codeWordPattern = /^[0-9а-яё]*$/i;
15
+ export const codeWordPattern = /^[а-яёА-ЯЁ\d]+$/u;
16
16
  export const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
17
17
  export const retailNotCyrillicPattern = /^(?!\s*$)[^\p{Script=Cyrillic}]+$/u;
18
18