@redneckz/wildless-cms-uni-blocks 0.14.815 → 0.14.817

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 (50) hide show
  1. package/bundle/bundle.umd.js +21 -11
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  4. package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  5. package/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  6. package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  7. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  8. package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  9. package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  10. package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  11. package/lib/common.css +1 -1
  12. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  13. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
  14. package/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  15. package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  16. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  17. package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  18. package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  19. package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  20. package/mobile/bundle/bundle.umd.js +21 -11
  21. package/mobile/bundle/bundle.umd.min.js +1 -1
  22. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  23. package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  24. package/mobile/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  25. package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  26. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  27. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  28. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  29. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  30. package/mobile/lib/common.css +1 -1
  31. package/mobile/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  32. package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  33. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  34. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  35. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  36. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  37. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +87 -0
  38. package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  39. package/mobile/src/model/FormTypeFieldDef.ts +2 -1
  40. package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  41. package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
  42. package/package.json +1 -1
  43. package/src/components/ApplicationForm/ApplicationForm.example.json +87 -0
  44. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +60 -0
  45. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +60 -0
  46. package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +4 -15
  47. package/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  48. package/src/model/FormTypeFieldDef.ts +2 -1
  49. package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  50. package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
@@ -33,7 +33,7 @@ const LINK_SCHEMA: Record<string, JSONSchema7Definition> = {
33
33
  },
34
34
  },
35
35
  ],
36
- title: 'Ссылка',
36
+ title: 'Ссылка (если заполнено, то кнопка скрывается)',
37
37
  required: ['href'],
38
38
  },
39
39
  };
@@ -109,15 +109,18 @@ const blockDecoratorWrapper =
109
109
 
110
110
  const productBlockDecorator =
111
111
  (idx: number): BlockDecorator =>
112
- ({ blockClassName, block, render }, i) =>
113
- (
114
- <LinkWrapper key={i} {...block.content?.link} className={getChildStyle(idx)}>
112
+ ({ blockClassName, block, render }, i) => {
113
+ const modifiedBlock = modifyBlock(block, idx);
114
+
115
+ return (
116
+ <LinkWrapper key={String(i)} {...modifiedBlock.content?.link} className={getChildStyle(idx)}>
115
117
  {render({
116
118
  blockClassName: style(blockClassName, 'h-full'),
117
- block: modifyBlock(block, idx),
119
+ block: modifiedBlock,
118
120
  })}
119
121
  </LinkWrapper>
120
122
  );
123
+ };
121
124
 
122
125
  const getChildStyle = (index: number) =>
123
126
  SHORT_TILE_INDEXES.includes(index)
@@ -127,13 +130,21 @@ const getChildStyle = (index: number) =>
127
130
  const modifyBlock = (block: BlockDef, i: number) => {
128
131
  const content: ProductBlockContent & { link?: LinkProps } = { ...block.content };
129
132
 
130
- if (SHORT_TILE_INDEXES.includes(i)) {
133
+ const isSmallTile = SHORT_TILE_INDEXES.includes(i);
134
+
135
+ if (isSmallTile) {
131
136
  delete content.description;
132
137
  delete content.benefits;
133
- }
134
138
 
135
- if (content.link?.href) {
136
- delete content.buttons;
139
+ if (content.link?.href) {
140
+ delete content.buttons;
141
+ }
142
+
143
+ content.imageOptions = { ...content.imageOptions, className: 'max-w-max !h-auto' };
144
+ } else {
145
+ if ((content.buttons ?? []).length) {
146
+ delete content.link;
147
+ }
137
148
  }
138
149
 
139
150
  return { ...block, content };
@@ -20,4 +20,5 @@ export type FormTypeFieldDef =
20
20
  | 'OUTSERVICE'
21
21
  | 'RFB'
22
22
  | 'SUPPORT'
23
- | 'INVESTADVISER';
23
+ | 'INVESTADVISER'
24
+ | 'FINOMBUDSMAN';
@@ -54,12 +54,13 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
54
54
  directionRight = true,
55
55
  isImageAlwaysOnRight,
56
56
  isImageSecondary = false,
57
+ className: imageClassName,
57
58
  } = {},
58
59
  backwardButton,
59
60
  children,
60
61
  ...rest
61
62
  }) => {
62
- const img = image?.src ? <Img image={image} /> : null;
63
+ const img = image?.src ? <Img image={image} imageClassName={imageClassName} /> : null;
63
64
  const headline = (
64
65
  <Headline
65
66
  title={title}
@@ -19,6 +19,8 @@ export interface TileImageOptions {
19
19
  isImageSecondary?: boolean;
20
20
  /** @title Изображение всегда справа */
21
21
  isImageAlwaysOnRight?: boolean;
22
+ /** @hidden */
23
+ className?: string;
22
24
  }
23
25
 
24
26
  /** @title Цены */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.815",
3
+ "version": "0.14.817",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1222,5 +1222,92 @@
1222
1222
  }
1223
1223
  }
1224
1224
  }
1225
+ ],
1226
+ [
1227
+ "Финансовый омбудсмен",
1228
+ {
1229
+ "content": {
1230
+ "version": "primary",
1231
+ "title": "Финансовый омбудсмен",
1232
+ "typeForm": "FINOMBUDSMAN",
1233
+ "endpoint": "lead",
1234
+ "sections": [
1235
+ {
1236
+ "inputs": [
1237
+ {
1238
+ "name": "serviceDirection"
1239
+ },
1240
+ {
1241
+ "name": "surname",
1242
+ "required": true
1243
+ },
1244
+ {
1245
+ "name": "name",
1246
+ "required": true
1247
+ },
1248
+ {
1249
+ "name": "inn",
1250
+ "required": true,
1251
+ "condition": {
1252
+ "name": "serviceDirection",
1253
+ "values": ["Юридическое лицо / ИП"]
1254
+ }
1255
+ },
1256
+ {
1257
+ "name": "fullName",
1258
+ "label": "Наименование организации",
1259
+ "condition": {
1260
+ "name": "serviceDirection",
1261
+ "values": ["Юридическое лицо / ИП"]
1262
+ }
1263
+ },
1264
+ {
1265
+ "name": "phone",
1266
+ "required": true
1267
+ },
1268
+ {
1269
+ "name": "email",
1270
+ "required": true
1271
+ },
1272
+ {
1273
+ "name": "comment",
1274
+ "required": true,
1275
+ "label": "Ваше сообщение",
1276
+ "condition": {
1277
+ "name": "serviceDirection",
1278
+ "values": ["Физическое лицо"]
1279
+ }
1280
+ },
1281
+ {
1282
+ "name": "partnerComments",
1283
+ "label": "Ваше сообщение",
1284
+ "required": true,
1285
+ "condition": {
1286
+ "name": "serviceDirection",
1287
+ "values": ["Юридическое лицо / ИП"]
1288
+ }
1289
+ }
1290
+ ]
1291
+ },
1292
+ {
1293
+ "inputs": [
1294
+ {
1295
+ "name": "consentDataProcessing",
1296
+ "required": true
1297
+ }
1298
+ ]
1299
+ }
1300
+ ],
1301
+ "button": {
1302
+ "text": "Отправить заявку",
1303
+ "version": "primary"
1304
+ },
1305
+ "link": {
1306
+ "text": "Согласен на обработку персональных данных",
1307
+ "href": "/privacy-policy",
1308
+ "target": "_blank"
1309
+ }
1310
+ }
1311
+ }
1225
1312
  ]
1226
1313
  ]
@@ -735,4 +735,64 @@ export default {
735
735
  <DialogManager />
736
736
  </div>
737
737
  ),
738
+ finOmbudsman: (
739
+ <div className="container grid grid-cols-12">
740
+ <ApplicationForm
741
+ className="col-span-12"
742
+ title="Финансовый омбудсмен"
743
+ typeForm="FINOMBUDSMAN"
744
+ endpoint="lead"
745
+ sections={[
746
+ {
747
+ inputs: [
748
+ { name: 'serviceDirection' },
749
+ { name: 'surname', required: true },
750
+ { name: 'name', required: true },
751
+ {
752
+ name: 'inn',
753
+ required: true,
754
+ condition: {
755
+ name: 'serviceDirection',
756
+ values: ['Юридическое лицо / ИП'],
757
+ },
758
+ },
759
+ {
760
+ name: 'fullName',
761
+ label: 'Наименование организации',
762
+ condition: {
763
+ name: 'serviceDirection',
764
+ values: ['Юридическое лицо / ИП'],
765
+ },
766
+ },
767
+ { name: 'phone', required: true },
768
+ { name: 'email', required: true },
769
+ {
770
+ name: 'comment',
771
+ required: true,
772
+ label: 'Ваше сообщение',
773
+ condition: {
774
+ name: 'serviceDirection',
775
+ values: ['Физическое лицо'],
776
+ },
777
+ },
778
+ {
779
+ name: 'partnerComments',
780
+ required: true,
781
+ label: 'Ваше сообщение',
782
+ condition: {
783
+ name: 'serviceDirection',
784
+ values: ['Юридическое лицо / ИП'],
785
+ },
786
+ },
787
+ ],
788
+ },
789
+ { inputs: [{ name: 'consentDataProcessing', required: true }] },
790
+ ]}
791
+ button={button}
792
+ link={link}
793
+ />
794
+ <PopupManager />
795
+ <DialogManager />
796
+ </div>
797
+ ),
738
798
  };
@@ -730,4 +730,64 @@ export default {
730
730
  <DialogManager />
731
731
  </div>
732
732
  ),
733
+ finOmbudsman: (
734
+ <div className="container grid grid-cols-12">
735
+ <ApplicationForm
736
+ className="col-span-12"
737
+ title="Финансовый омбудсмен"
738
+ typeForm="FINOMBUDSMAN"
739
+ endpoint="lead"
740
+ sections={[
741
+ {
742
+ inputs: [
743
+ { name: 'serviceDirection' },
744
+ { name: 'surname', required: true },
745
+ { name: 'name', required: true },
746
+ {
747
+ name: 'inn',
748
+ required: true,
749
+ condition: {
750
+ name: 'serviceDirection',
751
+ values: ['Юридическое лицо / ИП'],
752
+ },
753
+ },
754
+ {
755
+ name: 'fullName',
756
+ label: 'Наименование организации',
757
+ condition: {
758
+ name: 'serviceDirection',
759
+ values: ['Юридическое лицо / ИП'],
760
+ },
761
+ },
762
+ { name: 'phone', required: true },
763
+ { name: 'email', required: true },
764
+ {
765
+ name: 'comment',
766
+ required: true,
767
+ label: 'Ваше сообщение',
768
+ condition: {
769
+ name: 'serviceDirection',
770
+ values: ['Физическое лицо'],
771
+ },
772
+ },
773
+ {
774
+ name: 'partnerComments',
775
+ required: true,
776
+ label: 'Ваше сообщение',
777
+ condition: {
778
+ name: 'serviceDirection',
779
+ values: ['Юридическое лицо / ИП'],
780
+ },
781
+ },
782
+ ],
783
+ },
784
+ { inputs: [{ name: 'consentDataProcessing', required: true }] },
785
+ ]}
786
+ button={button}
787
+ link={link}
788
+ />
789
+ <PopupManager />
790
+ <DialogManager />
791
+ </div>
792
+ ),
733
793
  };
@@ -26,17 +26,6 @@ const CONTENT: ProductBlockContent & UniBlockProps & { link?: LinkProps } = {
26
26
  },
27
27
  };
28
28
 
29
- const SHORT_TILE_CONTENT: ProductBlockContent & UniBlockProps = {
30
- ...CONTENT,
31
- image: {
32
- ...CONTENT.image,
33
- size: {
34
- width: 130,
35
- height: 130,
36
- },
37
- },
38
- };
39
-
40
29
  export default {
41
30
  default: (
42
31
  <div className="container grid grid-cols-12">
@@ -48,10 +37,10 @@ export default {
48
37
  type: 'GalleryLayout',
49
38
  blocks: [
50
39
  { type: PRODUCT_BLOCK_TYPE, content: CONTENT },
51
- { type: PRODUCT_BLOCK_TYPE, content: SHORT_TILE_CONTENT },
52
- { type: PRODUCT_BLOCK_TYPE, content: SHORT_TILE_CONTENT },
53
- { type: PRODUCT_BLOCK_TYPE, content: SHORT_TILE_CONTENT },
54
- { type: PRODUCT_BLOCK_TYPE, content: SHORT_TILE_CONTENT },
40
+ { type: PRODUCT_BLOCK_TYPE, content: CONTENT },
41
+ { type: PRODUCT_BLOCK_TYPE, content: CONTENT },
42
+ { type: PRODUCT_BLOCK_TYPE, content: CONTENT },
43
+ { type: PRODUCT_BLOCK_TYPE, content: CONTENT },
55
44
  ],
56
45
  }}
57
46
  options={options}
@@ -33,7 +33,7 @@ const LINK_SCHEMA: Record<string, JSONSchema7Definition> = {
33
33
  },
34
34
  },
35
35
  ],
36
- title: 'Ссылка',
36
+ title: 'Ссылка (если заполнено, то кнопка скрывается)',
37
37
  required: ['href'],
38
38
  },
39
39
  };
@@ -109,15 +109,18 @@ const blockDecoratorWrapper =
109
109
 
110
110
  const productBlockDecorator =
111
111
  (idx: number): BlockDecorator =>
112
- ({ blockClassName, block, render }, i) =>
113
- (
114
- <LinkWrapper key={i} {...block.content?.link} className={getChildStyle(idx)}>
112
+ ({ blockClassName, block, render }, i) => {
113
+ const modifiedBlock = modifyBlock(block, idx);
114
+
115
+ return (
116
+ <LinkWrapper key={String(i)} {...modifiedBlock.content?.link} className={getChildStyle(idx)}>
115
117
  {render({
116
118
  blockClassName: style(blockClassName, 'h-full'),
117
- block: modifyBlock(block, idx),
119
+ block: modifiedBlock,
118
120
  })}
119
121
  </LinkWrapper>
120
122
  );
123
+ };
121
124
 
122
125
  const getChildStyle = (index: number) =>
123
126
  SHORT_TILE_INDEXES.includes(index)
@@ -127,13 +130,21 @@ const getChildStyle = (index: number) =>
127
130
  const modifyBlock = (block: BlockDef, i: number) => {
128
131
  const content: ProductBlockContent & { link?: LinkProps } = { ...block.content };
129
132
 
130
- if (SHORT_TILE_INDEXES.includes(i)) {
133
+ const isSmallTile = SHORT_TILE_INDEXES.includes(i);
134
+
135
+ if (isSmallTile) {
131
136
  delete content.description;
132
137
  delete content.benefits;
133
- }
134
138
 
135
- if (content.link?.href) {
136
- delete content.buttons;
139
+ if (content.link?.href) {
140
+ delete content.buttons;
141
+ }
142
+
143
+ content.imageOptions = { ...content.imageOptions, className: 'max-w-max !h-auto' };
144
+ } else {
145
+ if ((content.buttons ?? []).length) {
146
+ delete content.link;
147
+ }
137
148
  }
138
149
 
139
150
  return { ...block, content };
@@ -20,4 +20,5 @@ export type FormTypeFieldDef =
20
20
  | 'OUTSERVICE'
21
21
  | 'RFB'
22
22
  | 'SUPPORT'
23
- | 'INVESTADVISER';
23
+ | 'INVESTADVISER'
24
+ | 'FINOMBUDSMAN';
@@ -54,12 +54,13 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
54
54
  directionRight = true,
55
55
  isImageAlwaysOnRight,
56
56
  isImageSecondary = false,
57
+ className: imageClassName,
57
58
  } = {},
58
59
  backwardButton,
59
60
  children,
60
61
  ...rest
61
62
  }) => {
62
- const img = image?.src ? <Img image={image} /> : null;
63
+ const img = image?.src ? <Img image={image} imageClassName={imageClassName} /> : null;
63
64
  const headline = (
64
65
  <Headline
65
66
  title={title}
@@ -19,6 +19,8 @@ export interface TileImageOptions {
19
19
  isImageSecondary?: boolean;
20
20
  /** @title Изображение всегда справа */
21
21
  isImageAlwaysOnRight?: boolean;
22
+ /** @hidden */
23
+ className?: string;
22
24
  }
23
25
 
24
26
  /** @title Цены */