ecomlab-components-next 0.1.211 → 0.1.213
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.
|
@@ -179,15 +179,14 @@ var ModalBitrixForm = exports.ModalBitrixForm = function ModalBitrixForm(_ref) {
|
|
|
179
179
|
return setInputValue(function (prev) {
|
|
180
180
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, id, e));
|
|
181
181
|
});
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
,
|
|
182
|
+
},
|
|
183
|
+
countrySelect: inputType === 'tel',
|
|
184
|
+
countryDefault: 'RU',
|
|
186
185
|
autoComplete: false,
|
|
187
186
|
err: err === null || err === void 0 ? void 0 : err[id],
|
|
188
187
|
required: required,
|
|
189
188
|
textErr: err === null || err === void 0 ? void 0 : err[id],
|
|
190
|
-
mask: '+{7} (000) 000-00-00'
|
|
189
|
+
mask: inputType === 'tel' ? '+{7} (000) 000-00-00' : ''
|
|
191
190
|
});
|
|
192
191
|
}
|
|
193
192
|
})));
|
|
@@ -239,7 +238,7 @@ var ModalBitrixForm = exports.ModalBitrixForm = function ModalBitrixForm(_ref) {
|
|
|
239
238
|
className: "modal-bitrix-form"
|
|
240
239
|
}, successfulResponse && /*#__PURE__*/_react["default"].createElement("div", {
|
|
241
240
|
className: "modal-bitrix-form__successful"
|
|
242
|
-
}, /*#__PURE__*/_react["default"].createElement("
|
|
241
|
+
}, /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
243
242
|
className: "modal-bitrix-form__icon-done",
|
|
244
243
|
alt: "icon",
|
|
245
244
|
src: _done_icon["default"]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.ModalBitrixTeeeeeest = void 0;
|
|
7
|
+
var _ModalBitrixForm = require("./ModalBitrixForm");
|
|
8
|
+
// import { action } from '@storybook/addon-actions'
|
|
9
|
+
|
|
10
|
+
var formStubTitle = 'Тестовая формаfffffffffff аааааааааааа ииииииииииииииииииии';
|
|
11
|
+
var formStubSubTitle = 'Подзаголовок тестовой формы';
|
|
12
|
+
var formStubBitrixToken = 'gAAAAABopIEPlTICTdgD52GgH_GRFS30Tou2Ok2ICeC3ECQ8_aSQMMjTqU0HS7y9krbifcKbXroyR0iMmN6UXq1KL4xP0UtjYg==';
|
|
13
|
+
var urlFetch = "https://apps0.ecomru.ru:4447/api/crm/deals/create?step_id=167&token=".concat(formStubBitrixToken, "&author=546&responsible=546");
|
|
14
|
+
var formStubData = [{
|
|
15
|
+
id: 'name',
|
|
16
|
+
placeholder: '',
|
|
17
|
+
hidden: true,
|
|
18
|
+
value: 'Лид клиент',
|
|
19
|
+
inputType: 'text',
|
|
20
|
+
type: 'input'
|
|
21
|
+
}, {
|
|
22
|
+
id: 'f_61',
|
|
23
|
+
placeholder: 'Имя',
|
|
24
|
+
inputType: 'name',
|
|
25
|
+
required: true,
|
|
26
|
+
type: 'input'
|
|
27
|
+
}, {
|
|
28
|
+
id: 'f_62',
|
|
29
|
+
placeholder: 'Email',
|
|
30
|
+
inputType: 'email',
|
|
31
|
+
type: 'input',
|
|
32
|
+
required: true
|
|
33
|
+
}, {
|
|
34
|
+
id: 'f_63',
|
|
35
|
+
placeholder: 'Телефон',
|
|
36
|
+
inputType: 'tel',
|
|
37
|
+
type: 'input',
|
|
38
|
+
required: true
|
|
39
|
+
}, {
|
|
40
|
+
id: 'f_64',
|
|
41
|
+
placeholder: 'Комментарий',
|
|
42
|
+
inputType: 'description',
|
|
43
|
+
type: 'textarea',
|
|
44
|
+
required: true
|
|
45
|
+
}];
|
|
46
|
+
var _default = exports["default"] = {
|
|
47
|
+
title: 'Components/ModalBitrixForm',
|
|
48
|
+
component: _ModalBitrixForm.ModalBitrixForm,
|
|
49
|
+
parameters: {
|
|
50
|
+
layout: 'centered'
|
|
51
|
+
},
|
|
52
|
+
tags: ['autodocs'],
|
|
53
|
+
args: {
|
|
54
|
+
// setIsModal: action('setIsOpen'),
|
|
55
|
+
inputArr: formStubData,
|
|
56
|
+
formTitle: formStubTitle,
|
|
57
|
+
bitrixToken: formStubBitrixToken,
|
|
58
|
+
subTitle: formStubSubTitle,
|
|
59
|
+
urlFetch: urlFetch
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var ModalBitrixTeeeeeest = exports.ModalBitrixTeeeeeest = {
|
|
63
|
+
render: function render(args) {
|
|
64
|
+
return /*#__PURE__*/React.createElement(_ModalBitrixForm.ModalBitrixForm, args);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -115,7 +115,7 @@ var InputDinamycPlaceholder = function InputDinamycPlaceholder(_ref) {
|
|
|
115
115
|
if (type === 'tel' && inputRef.current) {
|
|
116
116
|
var code = (0, _libphonenumberJs.getCountryCallingCode)(newCountry);
|
|
117
117
|
var newMask = {
|
|
118
|
-
mask:
|
|
118
|
+
mask: "+".concat(code, " (000) 000-00-00")
|
|
119
119
|
}; // Пример маски для России
|
|
120
120
|
|
|
121
121
|
if (maskRef.current) {
|
|
@@ -144,18 +144,17 @@ var InputDinamycPlaceholder = function InputDinamycPlaceholder(_ref) {
|
|
|
144
144
|
(0, _react.useEffect)(function () {
|
|
145
145
|
setValueInside(changeValue || '');
|
|
146
146
|
}, [changeValue]);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
// }, [type, country]);
|
|
147
|
+
(0, _react.useEffect)(function () {
|
|
148
|
+
if (type === 'tel' && inputRef.current) {
|
|
149
|
+
var maskOptions = {
|
|
150
|
+
mask: '+{7} (000) 000-00-00'
|
|
151
|
+
};
|
|
152
|
+
var _mask = (0, _imask["default"])(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, maskOptions);
|
|
153
|
+
return function () {
|
|
154
|
+
return _mask.destroy();
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}, [type]);
|
|
159
158
|
|
|
160
159
|
// Обновление значения из props
|
|
161
160
|
(0, _react.useEffect)(function () {
|
|
@@ -173,19 +172,7 @@ var InputDinamycPlaceholder = function InputDinamycPlaceholder(_ref) {
|
|
|
173
172
|
width: '100%',
|
|
174
173
|
marginBottom: tooltip ? '24px' : ''
|
|
175
174
|
}
|
|
176
|
-
},
|
|
177
|
-
options_prop: options_country,
|
|
178
|
-
state: selectedCountry,
|
|
179
|
-
setState: function setState(e) {
|
|
180
|
-
setSelectedCountry(e);
|
|
181
|
-
handleCountryChange(e);
|
|
182
|
-
},
|
|
183
|
-
width: "100%",
|
|
184
|
-
isClearable: false,
|
|
185
|
-
style: {
|
|
186
|
-
marginBottom: '12px'
|
|
187
|
-
}
|
|
188
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
175
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
189
176
|
className: "".concat(err ? 'input-box__err' : 'input-box', " ").concat(size === 's' ? 'size-s' : 'size-l', " ").concat(disabled ? 'input-box_disabled' : '')
|
|
190
177
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
191
178
|
ref: inputRef,
|