@redneckz/wildless-cms-uni-blocks 0.14.353 → 0.14.354

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.
@@ -4,21 +4,11 @@ export const description = 'v0.14.169';
4
4
 
5
5
  export default traversePageBlocks(
6
6
  adjustClearBlock,
7
- adjustApplicationFormCorruptionBlock,
8
- adjustApplicationFormAntiFraudBlock,
9
- );
10
-
11
- function adjustApplicationFormCorruptionBlock(block) {
12
- if (isMigrateForm(block, 'ApplicationFormCorruption')) {
13
- block.type = 'ApplicationFormCustom';
14
- const formBlock = block.content?.formBlock;
15
- block.content = {
16
- title: formBlock?.title,
17
- typeForm: 'CORRUPTION',
18
- endpoint: 'lead',
19
- formColumns: 1,
20
- inputs: [
21
- ...userInputs,
7
+ (block) =>
8
+ adjustApplicationFormBlock(block, {
9
+ type: 'ApplicationFormCorruption',
10
+ newType: 'CORRUPTION',
11
+ inputEntries: [
22
12
  {
23
13
  name: 'region',
24
14
  required: true,
@@ -26,29 +16,13 @@ function adjustApplicationFormCorruptionBlock(block) {
26
16
  {
27
17
  name: 'email',
28
18
  },
29
- comment,
30
- consentDataProcessing,
31
19
  ],
32
- button: formBlock?.button || { text: 'Отправить заявку' },
33
- link: formBlock?.link || {
34
- text: 'обработкой персональных данных',
35
- href: 'https://beta.rshb.ru/natural/privacy-policy',
36
- },
37
- };
38
- }
39
- }
40
-
41
- function adjustApplicationFormAntiFraudBlock(block) {
42
- if (isMigrateForm(block, 'ApplicationFormAntiFraud')) {
43
- block.type = 'ApplicationFormCorruption';
44
- const formBlock = block.content?.formBlock;
45
- block.content = {
46
- title: formBlock?.title,
47
- typeForm: 'ANTIFRAUD',
48
- endpoint: 'lead',
49
- formColumns: 1,
50
- inputs: [
51
- ...userInputs,
20
+ }),
21
+ (block) =>
22
+ adjustApplicationFormBlock(block, {
23
+ type: 'ApplicationFormAntiFraud',
24
+ newType: 'ANTIFRAUD',
25
+ inputEntries: [
52
26
  {
53
27
  name: 'birthday',
54
28
  required: true,
@@ -56,9 +30,20 @@ function adjustApplicationFormAntiFraudBlock(block) {
56
30
  {
57
31
  name: 'client',
58
32
  },
59
- comment,
60
- consentDataProcessing,
61
33
  ],
34
+ }),
35
+ );
36
+
37
+ function adjustApplicationFormBlock(block, { type, newType, inputEntries }) {
38
+ if (isMigrateForm(block, type)) {
39
+ block.type = type;
40
+ const formBlock = block.content?.formBlock;
41
+ block.content = {
42
+ endpoint: 'lead',
43
+ formColumns: 1,
44
+ title: formBlock?.title,
45
+ typeForm: newType,
46
+ inputs: [...userInputs, ...inputEntries, comment, consentDataProcessing].push(inputEntries),
62
47
  button: formBlock?.button || { text: 'Отправить заявку' },
63
48
  link: formBlock?.link || {
64
49
  text: 'обработкой персональных данных',
@@ -1097,8 +1097,8 @@
1097
1097
  const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1098
1098
  return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
1099
1099
  });
1100
- const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
1101
- const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1100
+ const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1101
+ const checkboxStyle = (value = false) => style('rounded border', value ? 'bg-primary-main' : '');
1102
1102
 
1103
1103
  const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
1104
1104
 
@@ -3401,7 +3401,7 @@
3401
3401
  buttonClassName,
3402
3402
  }) }), children ? (jsx(Text, { size: "text-s", font: "font-light", color: "text-secondary-text", children: children })) : null] }));
3403
3403
  });
3404
- const getStretchedStyle = (stretched) => (stretched ? 'flex-1 justify-center' : '');
3404
+ const getStretchedStyle = (stretched = false) => (stretched ? 'flex-1 justify-center' : '');
3405
3405
 
3406
3406
  const ImageAlwaysOnRight = true;
3407
3407
 
@@ -6254,7 +6254,7 @@
6254
6254
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6255
6255
  });
6256
6256
 
6257
- const packageVersion = "0.14.352";
6257
+ const packageVersion = "0.14.353";
6258
6258
 
6259
6259
  exports.Blocks = Blocks;
6260
6260
  exports.ContentPage = ContentPage;