ecomlab-components-next 0.1.62 → 0.1.63

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.
@@ -90,7 +90,8 @@ var ArticleViewV2 = function ArticleViewV2(_ref) {
90
90
  listLinks = _ref.listLinks,
91
91
  setListLinks = _ref.setListLinks,
92
92
  setBreadcrumbs = _ref.setBreadcrumbs,
93
- fetchDataById = _ref.fetchDataById;
93
+ fetchDataById = _ref.fetchDataById,
94
+ activeLang = _ref.activeLang;
94
95
  var _useState = (0, _react.useState)(false),
95
96
  _useState2 = _slicedToArray(_useState, 2),
96
97
  showAddBlockPopup = _useState2[0],
@@ -108,29 +109,22 @@ var ArticleViewV2 = function ArticleViewV2(_ref) {
108
109
  _useState8 = _slicedToArray(_useState7, 2),
109
110
  changeId = _useState8[0],
110
111
  setChangeId = _useState8[1];
111
- var _useState9 = (0, _react.useState)(function () {
112
- var _localStorage$getItem;
113
- return (_localStorage$getItem = localStorage.getItem('lang')) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : 'ru';
114
- }),
112
+ var _useState9 = (0, _react.useState)(false),
115
113
  _useState10 = _slicedToArray(_useState9, 2),
116
- activeLang = _useState10[0],
117
- setActiveLang = _useState10[1];
114
+ isDropShare = _useState10[0],
115
+ setIsDropShare = _useState10[1];
118
116
  var _useState11 = (0, _react.useState)(false),
119
117
  _useState12 = _slicedToArray(_useState11, 2),
120
- isDropShare = _useState12[0],
121
- setIsDropShare = _useState12[1];
118
+ isModalSocial = _useState12[0],
119
+ setIsModalSocial = _useState12[1];
122
120
  var _useState13 = (0, _react.useState)(false),
123
121
  _useState14 = _slicedToArray(_useState13, 2),
124
- isModalSocial = _useState14[0],
125
- setIsModalSocial = _useState14[1];
122
+ isChangeTypeModal = _useState14[0],
123
+ setIsChangeTypeModal = _useState14[1];
126
124
  var _useState15 = (0, _react.useState)(false),
127
125
  _useState16 = _slicedToArray(_useState15, 2),
128
- isChangeTypeModal = _useState16[0],
129
- setIsChangeTypeModal = _useState16[1];
130
- var _useState17 = (0, _react.useState)(false),
131
- _useState18 = _slicedToArray(_useState17, 2),
132
- isViewMode = _useState18[0],
133
- setIsViewMode = _useState18[1];
126
+ isViewMode = _useState16[0],
127
+ setIsViewMode = _useState16[1];
134
128
  var componentRefs = [];
135
129
  var onSetTitle = function onSetTitle(value) {
136
130
  var url = "".concat(_fetchUrls.RavshanHttps, "/api/v2/article/set_name");
@@ -785,7 +779,8 @@ var ArticleViewV2 = function ArticleViewV2(_ref) {
785
779
  apiData: apiData,
786
780
  articleId: articleId,
787
781
  setListLinks: setListLinks,
788
- fetchDataById: fetchDataById
782
+ fetchDataById: fetchDataById,
783
+ activeLang: activeLang
789
784
  })))));
790
785
  };
791
786
  var _default = exports["default"] = ArticleViewV2;
@@ -24,7 +24,6 @@ var formStubTitle = '';
24
24
  var formStubSubTitle = '';
25
25
  var formStubBitrixToken = 'hxdxe0cpclw65c0j';
26
26
  var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
27
- var _window$location$href;
28
27
  var data = _ref.data,
29
28
  onChange = _ref.onChange,
30
29
  changeContent = _ref.changeContent,
@@ -43,14 +42,14 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
43
42
  setDraggableElement = _ref.setDraggableElement,
44
43
  articleId = _ref.articleId,
45
44
  fetchDataById = _ref.fetchDataById,
46
- changeBlock = _ref.changeBlock;
45
+ changeBlock = _ref.changeBlock,
46
+ activeLang = _ref.activeLang;
47
47
  var _useState = (0, _react.useState)(false),
48
48
  _useState2 = _slicedToArray(_useState, 2),
49
49
  isModalBitrix = _useState2[0],
50
50
  setIsModalBitrix = _useState2[1];
51
- var activeLang = localStorage.getItem('lang');
52
51
  var activePortal = localStorage.getItem('portal_id');
53
- var formStubData = [{
52
+ var formStubData_RU = [{
54
53
  id: 'FIELDS[TITLE]',
55
54
  placeholder: 'Название лида',
56
55
  hidden: true,
@@ -60,41 +59,201 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
60
59
  }, {
61
60
  id: 'FIELDS[NAME]',
62
61
  placeholder: 'Имя',
63
- inputType: 'text',
62
+ inputType: 'name',
64
63
  type: 'input',
65
64
  required: true
66
65
  }, {
67
66
  id: 'FIELDS[EMAIL][0][VALUE]',
68
67
  placeholder: 'Email',
69
68
  type: 'input',
70
- inputType: 'email'
69
+ inputType: 'email',
70
+ required: true
71
71
  }, {
72
72
  id: 'FIELDS[PHONE][0][VALUE]',
73
73
  placeholder: 'Номер телефона',
74
74
  type: 'input',
75
- inputType: 'tel'
75
+ inputType: 'tel',
76
+ required: true
77
+ }, {
78
+ id: 'FIELDS[COMMENTS]',
79
+ placeholder: 'Комментарии',
80
+ type: 'textarea',
81
+ inputType: 'description'
82
+ }, {
83
+ id: 'FIELDS[SOURCE_ID]',
84
+ placeholder: 'выбирается из справочника источников в CRM',
85
+ type: 'input',
86
+ hidden: true,
87
+ value: 17
88
+ }, {
89
+ id: 'FIELDS[SOURCE_DESCRIPTION]',
90
+ placeholder: 'URL страницы',
91
+ type: 'input',
92
+ value: url,
93
+ hidden: true
94
+ }, {
95
+ id: 'FIELDS[ASSIGNED_BY_ID]',
96
+ placeholder: 'ФИО ответственного',
97
+ type: 'input',
98
+ value: 219,
99
+ hidden: true
100
+ }, {
101
+ id: 'FIELDS[UTM_CAMPAIGN]',
102
+ placeholder: 'Обозначение рекламной кампании',
103
+ type: 'input',
104
+ value: '',
105
+ hidden: true
106
+ }, {
107
+ id: 'FIELDS[UTM_CONTENT]',
108
+ placeholder: 'Содержание кампании',
109
+ type: 'input',
110
+ value: '',
111
+ hidden: true
112
+ }, {
113
+ id: 'FIELDS[UTM_MEDIUM]',
114
+ placeholder: 'Тип трафика',
115
+ value: '',
116
+ type: 'input',
117
+ hidden: true
118
+ }, {
119
+ id: 'FIELDS[UTM_SOURCE]',
120
+ placeholder: 'Рекламная система',
121
+ value: '',
122
+ type: 'input',
123
+ hidden: true
124
+ }, {
125
+ id: 'FIELDS[UTM_TERM]',
126
+ placeholder: 'Условие поиска кампании',
127
+ value: '',
128
+ type: 'input',
129
+ hidden: true
130
+ }];
131
+ var formStubData_EN = [{
132
+ id: 'FIELDS[TITLE]',
133
+ placeholder: 'Название лида',
134
+ hidden: true,
135
+ value: 'Лид клиент',
136
+ inputType: 'text',
137
+ type: 'input'
138
+ }, {
139
+ id: 'FIELDS[NAME]',
140
+ placeholder: 'Name',
141
+ inputType: 'name',
142
+ type: 'input',
143
+ required: true
144
+ }, {
145
+ id: 'FIELDS[EMAIL][0][VALUE]',
146
+ placeholder: 'Email',
147
+ type: 'input',
148
+ inputType: 'email',
149
+ required: true
150
+ }, {
151
+ id: 'FIELDS[PHONE][0][VALUE]',
152
+ placeholder: 'Phone Number',
153
+ type: 'input',
154
+ inputType: 'tel',
155
+ required: true
156
+ }, {
157
+ id: 'FIELDS[COMMENTS]',
158
+ placeholder: 'Комментарии',
159
+ type: 'textarea',
160
+ inputType: 'description'
161
+ }, {
162
+ id: 'FIELDS[SOURCE_ID]',
163
+ placeholder: 'выбирается из справочника источников в CRM',
164
+ type: 'input',
165
+ hidden: true,
166
+ value: 17
167
+ }, {
168
+ id: 'FIELDS[SOURCE_DESCRIPTION]',
169
+ placeholder: 'URL страницы',
170
+ type: 'input',
171
+ value: url,
172
+ hidden: true
173
+ }, {
174
+ id: 'FIELDS[ASSIGNED_BY_ID]',
175
+ placeholder: 'ФИО ответственного',
176
+ type: 'input',
177
+ value: 219,
178
+ hidden: true
179
+ }, {
180
+ id: 'FIELDS[UTM_CAMPAIGN]',
181
+ placeholder: 'Обозначение рекламной кампании',
182
+ type: 'input',
183
+ value: '',
184
+ hidden: true
185
+ }, {
186
+ id: 'FIELDS[UTM_CONTENT]',
187
+ placeholder: 'Содержание кампании',
188
+ type: 'input',
189
+ value: '',
190
+ hidden: true
191
+ }, {
192
+ id: 'FIELDS[UTM_MEDIUM]',
193
+ placeholder: 'Тип трафика',
194
+ value: '',
195
+ type: 'input',
196
+ hidden: true
197
+ }, {
198
+ id: 'FIELDS[UTM_SOURCE]',
199
+ placeholder: 'Рекламная система',
200
+ value: '',
201
+ type: 'input',
202
+ hidden: true
203
+ }, {
204
+ id: 'FIELDS[UTM_TERM]',
205
+ placeholder: 'Условие поиска кампании',
206
+ value: '',
207
+ type: 'input',
208
+ hidden: true
209
+ }];
210
+ var formStubData_TH = [{
211
+ id: 'FIELDS[TITLE]',
212
+ placeholder: 'Название лида',
213
+ hidden: true,
214
+ value: 'Лид клиент',
215
+ inputType: 'text',
216
+ type: 'input'
217
+ }, {
218
+ id: 'FIELDS[NAME]',
219
+ placeholder: 'ชื่อ',
220
+ inputType: 'name',
221
+ type: 'input',
222
+ required: true
223
+ }, {
224
+ id: 'FIELDS[EMAIL][0][VALUE]',
225
+ placeholder: 'อีเมล',
226
+ type: 'input',
227
+ inputType: 'email',
228
+ required: true
229
+ }, {
230
+ id: 'FIELDS[PHONE][0][VALUE]',
231
+ placeholder: 'หมายเลขโทรศัพท์',
232
+ type: 'input',
233
+ inputType: 'tel',
234
+ required: true
76
235
  }, {
77
236
  id: 'FIELDS[COMMENTS]',
78
237
  placeholder: 'Комментарии',
79
238
  type: 'textarea',
80
- inputType: 'text'
239
+ inputType: 'description'
81
240
  }, {
82
241
  id: 'FIELDS[SOURCE_ID]',
83
242
  placeholder: 'выбирается из справочника источников в CRM',
84
243
  type: 'input',
85
244
  hidden: true,
86
- value: ((_window$location$href = window.location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.indexOf('ecomru')) > -1 ? 4 : 13
245
+ value: 17
87
246
  }, {
88
247
  id: 'FIELDS[SOURCE_DESCRIPTION]',
89
248
  placeholder: 'URL страницы',
90
249
  type: 'input',
91
- value: window.location.href,
250
+ value: url,
92
251
  hidden: true
93
252
  }, {
94
253
  id: 'FIELDS[ASSIGNED_BY_ID]',
95
254
  placeholder: 'ФИО ответственного',
96
255
  type: 'input',
97
- value: 11,
256
+ value: 219,
98
257
  hidden: true
99
258
  }, {
100
259
  id: 'FIELDS[UTM_CAMPAIGN]',
@@ -149,6 +308,22 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
149
308
  if (activeLang == 'tr') return 'danışmanlık';
150
309
  return 'от нашего специалиста';
151
310
  };
311
+ var translateSubmitRequest = function translateSubmitRequest() {
312
+ if (activeLang == 'en') return 'Submit a request';
313
+ if (activeLang == 'th') return 'ส่งคำขอ';
314
+ return 'Заявка на консультацию';
315
+ };
316
+ var translateFreeConsultation = function translateFreeConsultation() {
317
+ if (activeLang == 'en') return 'Submit a request and get a free consultation';
318
+ if (activeLang == 'tr') return 'ส่งคำขอและรับคำปรึกษาฟรี';
319
+ return 'Оставьте заявку и получите бесплатную консультацию';
320
+ };
321
+ var translateformStubData = function translateformStubData() {
322
+ if (activeLang == 'en') return formStubData_EN;
323
+ if (activeLang == 'th') return formStubData_TH;
324
+ return formStubData_RU;
325
+ };
326
+
152
327
  // Удалить блок
153
328
  var handleDeleteBlock = function handleDeleteBlock(e) {
154
329
  // setContent(e.currentTarget.textContent)
@@ -194,13 +369,14 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
194
369
  }
195
370
  }
196
371
  }, isModalBitrix && /*#__PURE__*/_react["default"].createElement(_ModalBitrixForm.ModalBitrixForm, {
197
- formTitle: "\u0417\u0430\u044F\u0432\u043A\u0430 \u043D\u0430 \u043A\u043E\u043D\u0441\u0443\u043B\u044C\u0442\u0430\u0446\u0438\u044E",
372
+ activeLang: activeLang,
373
+ formTitle: translateSubmitRequest(),
198
374
  setIsModal: function setIsModal(e) {
199
375
  return setIsModalBitrix(e);
200
376
  },
201
- inputArr: formStubData,
377
+ inputArr: translateformStubData(),
202
378
  bitrixToken: formStubBitrixToken,
203
- subTitle: 'Оставьте заявку и получите бесплатную консультацию'
379
+ subTitle: translateFreeConsultation()
204
380
  }), /*#__PURE__*/_react["default"].createElement("p", {
205
381
  className: "text_blue",
206
382
  onClick: function onClick(e) {
@@ -82,6 +82,7 @@ var ModalBitrixForm = exports.ModalBitrixForm = function ModalBitrixForm(_ref) {
82
82
  var translateBtn = function translateBtn() {
83
83
  if (activeLang == 'en') return 'Send';
84
84
  if (activeLang == 'tr') return 'Gönder';
85
+ if (activeLang == 'th') return 'ฝากคำร้องไว้ ';
85
86
  return 'Отправить';
86
87
  };
87
88
  var fetchTest = function fetchTest() {
@@ -40,7 +40,9 @@ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
40
40
  setListLinks = _ref.setListLinks,
41
41
  readonly = _ref.readonly,
42
42
  fetchDataById = _ref.fetchDataById,
43
- data = _ref.data;
43
+ data = _ref.data,
44
+ _ref$activeLang = _ref.activeLang,
45
+ activeLang = _ref$activeLang === void 0 ? 'ru' : _ref$activeLang;
44
46
  var _useState = (0, _react.useState)([]),
45
47
  _useState2 = _slicedToArray(_useState, 2),
46
48
  content = _useState2[0],
@@ -274,6 +276,7 @@ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
274
276
  editMode: true
275
277
  }));
276
278
  if (block_type == 'form') return /*#__PURE__*/_react["default"].createElement(_FormBtn.FormBtn, _extends({}, commonProps, {
279
+ activeLang: activeLang,
277
280
  editMode: true
278
281
  }));
279
282
  if (block_type == 'video') return /*#__PURE__*/_react["default"].createElement(_VideoArticle.VideoArticle, _extends({}, commonProps, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecomlab-components-next",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
4
4
  "description": "A set of common and reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "files": [