contentoh-components-library 21.1.84 → 21.1.85
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.
- package/dist/components/atoms/InputFormatter/index.js +3 -3
- package/dist/components/atoms/SliderToolTip/index.js +9 -23
- package/dist/components/atoms/Status/index.js +1 -1
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/molecules/StatusAsignationInfo/index.js +5 -2
- package/dist/components/organisms/VersionSelector/index.js +13 -17
- package/dist/components/organisms/VersionSelector/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/index.js +7 -6
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/index.js +8 -6
- package/dist/global-files/customHooks.js +18 -11
- package/package.json +1 -1
- package/src/components/atoms/InputFormatter/index.js +8 -3
- package/src/components/atoms/SliderToolTip/index.js +6 -22
- package/src/components/atoms/Status/index.js +1 -1
- package/src/components/molecules/StatusAsignationInfo/index.js +5 -2
- package/src/components/organisms/VersionSelector/index.js +10 -3
- package/src/components/organisms/VersionSelector/styles.js +1 -0
- package/src/components/pages/ProviderProductEdition/index.js +3 -3
- package/src/components/pages/RetailerProductEdition/index.js +4 -2
- package/src/global-files/customHooks.js +13 -14
|
@@ -62,7 +62,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
62
62
|
var maxLength = maxChar ? maxChar : 999;
|
|
63
63
|
|
|
64
64
|
var getValue = function getValue(value) {
|
|
65
|
-
var temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&");
|
|
65
|
+
var temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&").replace(/ /gm, " ");
|
|
66
66
|
return temp;
|
|
67
67
|
}; //const quillRef = useRef();
|
|
68
68
|
|
|
@@ -74,7 +74,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
var valueFormater = function valueFormater(value) {
|
|
77
|
-
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/&/gm, "&");
|
|
77
|
+
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/&/gm, "&").replace(/ /gm, " ");
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
var _onChange = function onChange(valueInput, delta, user, h) {
|
|
@@ -82,7 +82,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
82
82
|
|
|
83
83
|
try {
|
|
84
84
|
if (h.getLength() - 1 <= maxLength) {
|
|
85
|
-
var unformattedText = valueInput.replace(/<li.*?>/gm, " - ").replace(/<\/li>/gm, "\n").replace(/<\/p><p>/gm, "\n").replaceAll(/<\/?(?!\/?strong).*?>/gm, "");
|
|
85
|
+
var unformattedText = valueInput.replace(/<li.*?>/gm, " - ").replace(/<\/li>/gm, "\n").replace(/<\/p><p>/gm, "\n").replaceAll(/<\/?(?!\/?strong).*?>/gm, "").replace(/ /gm, " ");
|
|
86
86
|
setInputValue(valueInput);
|
|
87
87
|
value = unformattedText;
|
|
88
88
|
} else {
|
|
@@ -13,6 +13,8 @@ var _styles = require("./styles");
|
|
|
13
13
|
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
|
|
16
|
+
var _customHooks = require("../../../global-files/customHooks");
|
|
17
|
+
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
19
|
|
|
18
20
|
var SliderToolTip = function SliderToolTip(_ref) {
|
|
@@ -21,23 +23,10 @@ var SliderToolTip = function SliderToolTip(_ref) {
|
|
|
21
23
|
iconSize = _ref.iconSize,
|
|
22
24
|
slidePosition = _ref.slidePosition;
|
|
23
25
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
showMenu =
|
|
27
|
-
setShowMenu =
|
|
28
|
-
|
|
29
|
-
var closeMenu = function closeMenu(e) {
|
|
30
|
-
if (!e.target.closest("#div-slider") && showMenu) {
|
|
31
|
-
document.removeEventListener("click", closeMenu, false);
|
|
32
|
-
setShowMenu(false);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
(0, _react.useEffect)(function () {
|
|
37
|
-
if (showMenu) {
|
|
38
|
-
document.addEventListener("click", closeMenu, false);
|
|
39
|
-
}
|
|
40
|
-
}, [showMenu]);
|
|
26
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)("div-slider"),
|
|
27
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
28
|
+
showMenu = _useCloseModal2[0],
|
|
29
|
+
setShowMenu = _useCloseModal2[1];
|
|
41
30
|
|
|
42
31
|
var color = function color(id) {
|
|
43
32
|
for (var i = 1; i <= slidefront.length; i++) {
|
|
@@ -62,11 +51,9 @@ var SliderToolTip = function SliderToolTip(_ref) {
|
|
|
62
51
|
alt: "info icon",
|
|
63
52
|
className: iconSize,
|
|
64
53
|
onClick: function onClick(e) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
document.removeEventListener("click", closeMenu, false);
|
|
69
|
-
}
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
setShowMenu(true);
|
|
70
57
|
}
|
|
71
58
|
}), showMenu && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Slider, {
|
|
72
59
|
id: "div-slider",
|
|
@@ -92,7 +79,6 @@ var SliderToolTip = function SliderToolTip(_ref) {
|
|
|
92
79
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
93
80
|
id: "button-slide",
|
|
94
81
|
onClick: function onClick(e) {
|
|
95
|
-
document.removeEventListener("click", closeMenu, false);
|
|
96
82
|
setShowMenu(false);
|
|
97
83
|
},
|
|
98
84
|
children: "Cerrar"
|
|
@@ -15,7 +15,7 @@ var Status = function Status(_ref) {
|
|
|
15
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
16
16
|
className: "status-".concat(statusType === null || statusType === void 0 ? void 0 : statusType.replace(/\/.*/, ""), " ").concat(ovalForm && "oval-form"),
|
|
17
17
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
18
|
-
children: statusType !== null && statusType !== void 0 ? statusType : '
|
|
18
|
+
children: statusType !== null && statusType !== void 0 ? statusType : 'NS'
|
|
19
19
|
})
|
|
20
20
|
});
|
|
21
21
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.StatusTagDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var status = _variables.GlobalStatus;
|
|
19
|
+
var _default = {
|
|
20
|
+
title: "Components/atoms/StatusTag",
|
|
21
|
+
component: _index.StatusTag,
|
|
22
|
+
argTypes: {
|
|
23
|
+
statusType: {
|
|
24
|
+
options: status,
|
|
25
|
+
control: {
|
|
26
|
+
type: "select"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
ovalForm: {
|
|
30
|
+
options: [true, false],
|
|
31
|
+
control: {
|
|
32
|
+
type: "boolean"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
|
38
|
+
|
|
39
|
+
var Template = function Template(args) {
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.StatusTag, (0, _objectSpread2.default)({}, args));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var StatusTagDefault = Template.bind({});
|
|
44
|
+
exports.StatusTagDefault = StatusTagDefault;
|
|
45
|
+
StatusTagDefault.args = {
|
|
46
|
+
statusType: "-",
|
|
47
|
+
ovalForm: false
|
|
48
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StatusTag = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var StatusTag = function StatusTag(_ref) {
|
|
13
|
+
var statusType = _ref.statusType,
|
|
14
|
+
ovalForm = _ref.ovalForm;
|
|
15
|
+
|
|
16
|
+
var getShortStatus = function getShortStatus(status) {
|
|
17
|
+
switch (status) {
|
|
18
|
+
case "COMPLETED":
|
|
19
|
+
return "C";
|
|
20
|
+
|
|
21
|
+
case "RECEPTION":
|
|
22
|
+
return "Pr";
|
|
23
|
+
|
|
24
|
+
case "NULL":
|
|
25
|
+
return "-";
|
|
26
|
+
|
|
27
|
+
case "RECEIVED":
|
|
28
|
+
return "Rc";
|
|
29
|
+
|
|
30
|
+
case "IN_PROGRESS":
|
|
31
|
+
return "P";
|
|
32
|
+
|
|
33
|
+
case "ASSIGNED":
|
|
34
|
+
return "As";
|
|
35
|
+
|
|
36
|
+
case "APPROVED":
|
|
37
|
+
return "Ap";
|
|
38
|
+
|
|
39
|
+
case "VALIDATING":
|
|
40
|
+
return "V";
|
|
41
|
+
|
|
42
|
+
case "PAID_OUT":
|
|
43
|
+
return "Po";
|
|
44
|
+
|
|
45
|
+
default:
|
|
46
|
+
return status;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
51
|
+
className: "status-".concat(getShortStatus(statusType), " ").concat(ovalForm && "oval-form"),
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
53
|
+
children: getShortStatus(statusType)
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.StatusTag = StatusTag;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: fit-content;\n padding: 0 10px;\n height: 20px;\n background-color: ", ";\n border-radius: 3px;\n\n p {\n text-align: center;\n color: ", ";\n font-family: ", ";\n font-size: 12px;\n line-height: 20px;\n }\n\n &.status-As,\n &.status-P,\n &.status-IN_PROGRESS,\n &.status-QF {\n background-color: ", ";\n }\n\n &.status-Pr,\n &.status-Rr,\n &.status-Rc {\n background-color: ", ";\n }\n\n &.status-AA,\n &.status-AP,\n &.status-AC,\n &.status-AF {\n background-color: ", ";\n }\n\n &.status-RA,\n &.status-RF,\n &.status-RP,\n &.status-RC {\n background-color: ", ";\n }\n\n &.status-Dat,\n &.status-Dsc,\n &.status-Imgs {\n background-color: ", ";\n }\n\n &.status-Ex {\n background-color: ", ";\n }\n\n &.status-DDI {\n background-color: ", ";\n }\n\n &.status-GLD {\n background-color: ", ";\n }\n\n &.status-TAB {\n background-color: ", ";\n }\n\n &.status-Pt {\n background-color: ", ";\n color: ", ";\n }\n\n &.oval-form {\n border-radius: 10px;\n }\n"])), _variables.GlobalColors.s3, _variables.GlobalColors.white, _variables.FontFamily.Lato, _variables.GlobalColors.in_progress, _variables.GlobalColors.reception, _variables.GlobalColors.finished, _variables.GlobalColors.rejected_status, _variables.GlobalColors.s4, _variables.GlobalColors.exported, _variables.GlobalColors.original_purpura, _variables.GlobalColors.in_progress, _variables.GlobalColors.deep_gray, _variables.GlobalColors.s2, _variables.GlobalColors.s4);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -108,7 +108,7 @@ var StatusAsignationInfo = function StatusAsignationInfo(_ref) {
|
|
|
108
108
|
slidePosition: "bottom-slide"
|
|
109
109
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
110
110
|
buttonType: "general circular-button version-button",
|
|
111
|
-
onClick: function onClick() {
|
|
111
|
+
onClick: function onClick(e) {
|
|
112
112
|
setShowVersionSelector(true);
|
|
113
113
|
},
|
|
114
114
|
label: "V".concat(version)
|
|
@@ -144,7 +144,10 @@ var StatusAsignationInfo = function StatusAsignationInfo(_ref) {
|
|
|
144
144
|
imageType: "small-image",
|
|
145
145
|
image: (0, _data.getProfilePicture)(assignation.id, 20, 20),
|
|
146
146
|
altText: "user profile image",
|
|
147
|
-
onClick: function onClick() {
|
|
147
|
+
onClick: function onClick(e) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
console.log(e.target);
|
|
148
151
|
setShowAsignationPanel(true);
|
|
149
152
|
setAssignationType(assignation === null || assignation === void 0 ? void 0 : assignation.collaboratorType);
|
|
150
153
|
}
|
|
@@ -41,9 +41,10 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
41
41
|
setVersion = _ref.setVersion,
|
|
42
42
|
companyName = _ref.companyName,
|
|
43
43
|
currentVersion = _ref.currentVersion,
|
|
44
|
-
setShowCreateVersion = _ref.setShowCreateVersion
|
|
44
|
+
setShowCreateVersion = _ref.setShowCreateVersion,
|
|
45
|
+
setShowVersionSelector = _ref.setShowVersionSelector;
|
|
45
46
|
|
|
46
|
-
var _useState = (0, _react.useState)(),
|
|
47
|
+
var _useState = (0, _react.useState)([]),
|
|
47
48
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
48
49
|
versions = _useState2[0],
|
|
49
50
|
setVersions = _useState2[1];
|
|
@@ -84,21 +85,13 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
84
85
|
};
|
|
85
86
|
}();
|
|
86
87
|
|
|
87
|
-
(0, _react.useEffect)(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
case 2:
|
|
96
|
-
case "end":
|
|
97
|
-
return _context2.stop();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}, _callee2);
|
|
101
|
-
})), []);
|
|
88
|
+
(0, _react.useEffect)(function () {
|
|
89
|
+
loadProductVersions(articleId);
|
|
90
|
+
return function () {
|
|
91
|
+
setVersions([]);
|
|
92
|
+
setShowCreateVersion(false);
|
|
93
|
+
};
|
|
94
|
+
}, []);
|
|
102
95
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
103
96
|
id: modalId,
|
|
104
97
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -120,6 +113,9 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
120
113
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
121
114
|
image: _closeVersionSelector.default,
|
|
122
115
|
buttonType: "circular-button",
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
return setShowVersionSelector(false);
|
|
118
|
+
},
|
|
123
119
|
id: "close-button"
|
|
124
120
|
})]
|
|
125
121
|
})]
|
|
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 300px;\n height: 100%;\n background-color: ", ";\n padding: 15px;\n overflow: auto;\n position: absolute;\n right: 0;\n top: 0;\n\n .versions-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n .buttons-container {\n display: flex;\n align-items: center;\n\n button + * {\n margin-left: 10px;\n }\n }\n }\n"])), _variables.GlobalColors.deep_gray);
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 300px;\n height: 100%;\n background-color: ", ";\n padding: 15px;\n overflow: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 500;\n\n .versions-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n .buttons-container {\n display: flex;\n align-items: center;\n\n button + * {\n margin-left: 10px;\n }\n }\n }\n"])), _variables.GlobalColors.deep_gray);
|
|
19
19
|
|
|
20
20
|
exports.Container = Container;
|
|
@@ -348,8 +348,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
348
348
|
setIcon = _useState40[1];
|
|
349
349
|
|
|
350
350
|
var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
351
|
-
_useState42 = (0, _slicedToArray2.default)(_useState41,
|
|
352
|
-
version = _useState42[0]
|
|
351
|
+
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
352
|
+
version = _useState42[0],
|
|
353
|
+
setVersion = _useState42[1];
|
|
353
354
|
|
|
354
355
|
var _useState43 = (0, _react.useState)({}),
|
|
355
356
|
_useState44 = (0, _slicedToArray2.default)(_useState43, 1),
|
|
@@ -474,10 +475,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
474
475
|
showCreateVersion = _useState82[0],
|
|
475
476
|
setShowCreateVersion = _useState82[1];
|
|
476
477
|
|
|
477
|
-
var
|
|
478
|
-
|
|
479
|
-
showVersionSelector =
|
|
480
|
-
setShowVersionSelector =
|
|
478
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
479
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
480
|
+
showVersionSelector = _useCloseModal2[0],
|
|
481
|
+
setShowVersionSelector = _useCloseModal2[1];
|
|
481
482
|
|
|
482
483
|
(0, _react.useEffect)(function () {
|
|
483
484
|
checkAll && setSelectedImages(images.values);
|
package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.RegistrationLoginFirstStepDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _loginImage = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/loginImage.svg"));
|
|
15
|
+
|
|
16
|
+
var _login = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login2.svg"));
|
|
17
|
+
|
|
18
|
+
var _login2 = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login3.svg"));
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var _default = {
|
|
23
|
+
title: "Components/pages/RegistrationLoginFirstStep",
|
|
24
|
+
component: _index.RegistrationLoginFirstStep
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
27
|
+
|
|
28
|
+
var Template = function Template(args) {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.RegistrationLoginFirstStep, (0, _objectSpread2.default)({}, args));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var RegistrationLoginFirstStepDefault = Template.bind({});
|
|
33
|
+
exports.RegistrationLoginFirstStepDefault = RegistrationLoginFirstStepDefault;
|
|
34
|
+
RegistrationLoginFirstStepDefault.args = {
|
|
35
|
+
imageArrayCarousel: [_loginImage.default, _login.default, _login2.default],
|
|
36
|
+
textCarousel: "Elige la plataforma que conecta proovedores y retailers"
|
|
37
|
+
};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RegistrationLoginFirstStep = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _GradientPanel = require("../../atoms/GradientPanel");
|
|
19
|
+
|
|
20
|
+
var _CarouselImagesLogin = require("../../molecules/CarouselImagesLogin");
|
|
21
|
+
|
|
22
|
+
var _react = require("react");
|
|
23
|
+
|
|
24
|
+
var _LogoImage = require("../../atoms/LogoImage");
|
|
25
|
+
|
|
26
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
27
|
+
|
|
28
|
+
var _variables = require("../../../global-files/variables");
|
|
29
|
+
|
|
30
|
+
var _TagAndInput = require("../../molecules/TagAndInput");
|
|
31
|
+
|
|
32
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
33
|
+
|
|
34
|
+
var _GeneralInput = require("../../atoms/GeneralInput");
|
|
35
|
+
|
|
36
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
|
+
|
|
38
|
+
var RegistrationLoginFirstStep = function RegistrationLoginFirstStep(_ref) {
|
|
39
|
+
var _ref$imageArrayCarous = _ref.imageArrayCarousel,
|
|
40
|
+
imageArrayCarousel = _ref$imageArrayCarous === void 0 ? [] : _ref$imageArrayCarous,
|
|
41
|
+
textCarousel = _ref.textCarousel,
|
|
42
|
+
backogroundColorCarousel = _ref.backogroundColorCarousel;
|
|
43
|
+
|
|
44
|
+
var _useState = (0, _react.useState)(false),
|
|
45
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
46
|
+
emptyName = _useState2[0],
|
|
47
|
+
setEmptyName = _useState2[1];
|
|
48
|
+
|
|
49
|
+
var _useState3 = (0, _react.useState)(false),
|
|
50
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
51
|
+
emptyLastName = _useState4[0],
|
|
52
|
+
setEmptyLastName = _useState4[1];
|
|
53
|
+
|
|
54
|
+
var _useState5 = (0, _react.useState)(false),
|
|
55
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
56
|
+
emptyEmail = _useState6[0],
|
|
57
|
+
setEmptyEmail = _useState6[1];
|
|
58
|
+
|
|
59
|
+
var _useState7 = (0, _react.useState)(false),
|
|
60
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
61
|
+
emptyJob = _useState8[0],
|
|
62
|
+
setEmptyJob = _useState8[1];
|
|
63
|
+
|
|
64
|
+
var _useState9 = (0, _react.useState)(false),
|
|
65
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
66
|
+
emptyPhone = _useState10[0],
|
|
67
|
+
setEmptyPhone = _useState10[1];
|
|
68
|
+
|
|
69
|
+
var _useState11 = (0, _react.useState)(false),
|
|
70
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
71
|
+
invalidEmail = _useState12[0],
|
|
72
|
+
setInvalidEmail = _useState12[1];
|
|
73
|
+
|
|
74
|
+
var validate = /*#__PURE__*/function () {
|
|
75
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
76
|
+
var name, lastName, email, job, phone;
|
|
77
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
78
|
+
while (1) {
|
|
79
|
+
switch (_context.prev = _context.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
name = document.querySelector("#nameInput").value;
|
|
83
|
+
lastName = document.querySelector("#lastNameInput").value;
|
|
84
|
+
email = document.querySelector("#emailInput").value;
|
|
85
|
+
job = document.querySelector("#jobInput").value;
|
|
86
|
+
phone = document.querySelector("#phoneInput").value;
|
|
87
|
+
name === "" ? setEmptyName(true) : setEmptyName(false);
|
|
88
|
+
lastName === "" ? setEmptyLastName(true) : setEmptyLastName(false);
|
|
89
|
+
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
90
|
+
job === "" ? setEmptyJob(true) : setEmptyJob(false);
|
|
91
|
+
phone === "" ? setEmptyPhone(true) : setEmptyPhone(false);
|
|
92
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
93
|
+
|
|
94
|
+
case 12:
|
|
95
|
+
case "end":
|
|
96
|
+
return _context.stop();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, _callee);
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
return function validate(_x) {
|
|
103
|
+
return _ref2.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
}();
|
|
106
|
+
|
|
107
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
|
+
className: "credenciales",
|
|
109
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
110
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
111
|
+
color: _variables.GlobalColors.s5,
|
|
112
|
+
text: "Ingresa tus credenciales"
|
|
113
|
+
})
|
|
114
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
115
|
+
className: "user",
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
117
|
+
className: "name-registration-user",
|
|
118
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
119
|
+
inputType: "text",
|
|
120
|
+
inputId: "nameInput",
|
|
121
|
+
label: "Nombre",
|
|
122
|
+
inputPlaceHolder: "Nombre"
|
|
123
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
124
|
+
inputType: "text",
|
|
125
|
+
inputId: "lastNameInput",
|
|
126
|
+
label: "Apellido",
|
|
127
|
+
inputPlaceHolder: "Apellido"
|
|
128
|
+
})]
|
|
129
|
+
}), emptyName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
130
|
+
children: "Ingrese su nombre"
|
|
131
|
+
}), emptyLastName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
132
|
+
children: "Ingrese sus apellidos"
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
134
|
+
inputType: "text",
|
|
135
|
+
inputId: "emailInput",
|
|
136
|
+
label: "Correo electrónico",
|
|
137
|
+
inputPlaceHolder: "username@contentoh.com"
|
|
138
|
+
}), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
139
|
+
children: "Ingrese su correo"
|
|
140
|
+
}), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
141
|
+
children: "Ingrese un correo v\xE1lido"
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
143
|
+
inputType: "text",
|
|
144
|
+
inputId: "jobInput",
|
|
145
|
+
label: "Puesto laboral",
|
|
146
|
+
inputPlaceHolder: "Puesto dentro de la empresa"
|
|
147
|
+
}), emptyJob && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
148
|
+
children: "Ingrese su puesto"
|
|
149
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
150
|
+
text: "Teléfono",
|
|
151
|
+
headerType: "input-name-header"
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
153
|
+
className: "phone-registration-user",
|
|
154
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
155
|
+
name: "select",
|
|
156
|
+
className: "phone-options",
|
|
157
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
158
|
+
children: "+52"
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
160
|
+
children: "+54"
|
|
161
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
162
|
+
children: "+57"
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
164
|
+
children: "+506"
|
|
165
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
166
|
+
children: "+593"
|
|
167
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
168
|
+
children: "+503"
|
|
169
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
170
|
+
children: "+504"
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
172
|
+
children: "+507"
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
174
|
+
children: "+51"
|
|
175
|
+
})]
|
|
176
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
|
|
177
|
+
inputId: "phoneInput",
|
|
178
|
+
inputType: "text",
|
|
179
|
+
inputPlaceholder: "Teléfono"
|
|
180
|
+
})]
|
|
181
|
+
}), emptyPhone && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
182
|
+
children: "Ingrese su n\xFAmero de tel\xE9fono"
|
|
183
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
184
|
+
text: "País",
|
|
185
|
+
headerType: "input-name-header"
|
|
186
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
187
|
+
name: "select",
|
|
188
|
+
className: "country-options",
|
|
189
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
190
|
+
value: "value1",
|
|
191
|
+
selected: true,
|
|
192
|
+
children: "Selecciona tu pa\xEDs"
|
|
193
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
194
|
+
value: "value2",
|
|
195
|
+
children: "Argentina"
|
|
196
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
197
|
+
value: "value3",
|
|
198
|
+
children: "Colombia"
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
200
|
+
value: "value2",
|
|
201
|
+
children: "Ecuador"
|
|
202
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
203
|
+
value: "value3",
|
|
204
|
+
children: "El Salvador"
|
|
205
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
206
|
+
value: "value2",
|
|
207
|
+
children: "Honduras"
|
|
208
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
209
|
+
value: "value3",
|
|
210
|
+
children: "M\xE9xico"
|
|
211
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
212
|
+
value: "value2",
|
|
213
|
+
children: "Panam\xE1"
|
|
214
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
215
|
+
value: "value3",
|
|
216
|
+
children: "Per\xFA"
|
|
217
|
+
})]
|
|
218
|
+
}), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
219
|
+
children: "Seleccione su pa\xEDs"
|
|
220
|
+
})]
|
|
221
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
222
|
+
className: "button-end",
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
224
|
+
buttonType: "general-default-button",
|
|
225
|
+
label: "Enviar",
|
|
226
|
+
onClick: function onClick(e) {
|
|
227
|
+
return validate(e);
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
231
|
+
className: "progress-bar",
|
|
232
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
233
|
+
className: "progress-bar-first-step"
|
|
234
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
235
|
+
className: "progress-bar-registration"
|
|
236
|
+
})]
|
|
237
|
+
}, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
238
|
+
text: "Paso 1",
|
|
239
|
+
headerType: "date-header",
|
|
240
|
+
color: _variables.GlobalColors.s4
|
|
241
|
+
}, "6"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
242
|
+
className: "new-login",
|
|
243
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
244
|
+
className: "pre-registro",
|
|
245
|
+
children: ["\xBFYa tienes una cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
246
|
+
children: " Inicia Sesi\xF3n"
|
|
247
|
+
})]
|
|
248
|
+
})
|
|
249
|
+
}, "7")];
|
|
250
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
251
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
252
|
+
className: "home-retailer",
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselImagesLogin.CarouselImagesLogin, {
|
|
254
|
+
panelImg: imageArrayCarousel,
|
|
255
|
+
panelText: textCarousel,
|
|
256
|
+
panelColor: backogroundColorCarousel
|
|
257
|
+
})
|
|
258
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
259
|
+
className: "home-login-retailer",
|
|
260
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
261
|
+
componentsArray: loginRight,
|
|
262
|
+
panelType: "home-login",
|
|
263
|
+
panelColor: _variables.GlobalColors.white
|
|
264
|
+
})
|
|
265
|
+
})]
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
exports.RegistrationLoginFirstStep = RegistrationLoginFirstStep;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 100%;\n height: 100vh;\n .user {\n .name-registration-user {\n display: flex;\n justify-content: space-between;\n input {\n width: 160px;\n }\n }\n .input-name-header {\n margin-bottom: 4px;\n margin-top: 12px;\n }\n .phone-registration-user {\n display: flex;\n justify-content: space-between;\n .phone-options {\n width: 80px;\n }\n input {\n width: 100%;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .country-options,\n .phone-options {\n width: 100%;\n border: 1px solid ", ";\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n .button-end {\n text-align: end;\n .general-default-button {\n width: 160px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .progress-bar {\n width: 100%;\n height: 8px;\n display: flex;\n justify-content: space-between;\n .progress-bar-first-step {\n width: 33.33%;\n background-color: rgb(196, 196, 196);\n }\n .progress-bar-registration {\n background-color: rgb(226, 226, 226);\n width: 66.66%;\n }\n }\n .date-header {\n .new-login {\n & + * {\n margin-top: 20px;\n }\n }\n }\n .home-login-retailer,\n .home-retailer {\n width: 50%;\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -392,10 +392,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
392
392
|
showCreateVersion = _useState72[0],
|
|
393
393
|
setShowCreateVersion = _useState72[1];
|
|
394
394
|
|
|
395
|
-
var
|
|
396
|
-
|
|
397
|
-
showVersionSelector =
|
|
398
|
-
setShowVersionSelector =
|
|
395
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
396
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
397
|
+
showVersionSelector = _useCloseModal2[0],
|
|
398
|
+
setShowVersionSelector = _useCloseModal2[1];
|
|
399
399
|
|
|
400
400
|
(0, _react.useEffect)(function () {
|
|
401
401
|
checkAll && setSelectedImages(images.values);
|
|
@@ -1791,7 +1791,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1791
1791
|
default:
|
|
1792
1792
|
break;
|
|
1793
1793
|
}
|
|
1794
|
-
}
|
|
1794
|
+
},
|
|
1795
|
+
canAssign: ![7, 8].includes(user.id_role)
|
|
1795
1796
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1796
1797
|
className: "services-information-container " + (imageLayout && activeTab === "Imágenes" ? "image-services" : ""),
|
|
1797
1798
|
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -1914,7 +1915,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1914
1915
|
setVersion: setVersion,
|
|
1915
1916
|
companyName: product.article.company_name,
|
|
1916
1917
|
currentVersion: version,
|
|
1917
|
-
setShowCreateVersion: setShowCreateVersion
|
|
1918
|
+
setShowCreateVersion: setShowCreateVersion,
|
|
1919
|
+
setShowVersionSelector: setShowVersionSelector
|
|
1918
1920
|
}), showCreateVersion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreateVersion.CreateVersion, {
|
|
1919
1921
|
idArticle: product.article.id_article,
|
|
1920
1922
|
version: version,
|
|
@@ -5,31 +5,38 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.useCloseModal = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var useCloseModal = function useCloseModal(id) {
|
|
15
15
|
var _useState = (0, _react.useState)(false),
|
|
16
16
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
17
17
|
showModal = _useState2[0],
|
|
18
18
|
setShowModal = _useState2[1];
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
var closeModal = function closeModal(e) {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
|
|
24
|
+
if (!e.target.closest("#".concat(id)) && showModal) {
|
|
25
|
+
document.removeEventListener("click", closeModal, false);
|
|
26
|
+
setShowModal(false);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
27
29
|
|
|
30
|
+
(0, _react.useEffect)(function () {
|
|
28
31
|
if (showModal) {
|
|
29
|
-
document.addEventListener("click", closeModal);
|
|
32
|
+
document.addEventListener("click", closeModal, false);
|
|
30
33
|
}
|
|
34
|
+
|
|
35
|
+
return function () {
|
|
36
|
+
document.removeEventListener("click", closeModal, false);
|
|
37
|
+
};
|
|
31
38
|
}, [showModal]);
|
|
32
39
|
return [showModal, setShowModal];
|
|
33
40
|
};
|
|
34
41
|
|
|
35
|
-
exports.
|
|
42
|
+
exports.useCloseModal = useCloseModal;
|
package/package.json
CHANGED
|
@@ -22,7 +22,10 @@ export const InputFormatter = ({
|
|
|
22
22
|
const maxLength = maxChar ? maxChar : 999;
|
|
23
23
|
|
|
24
24
|
const getValue = (value) => {
|
|
25
|
-
let temp = value
|
|
25
|
+
let temp = value
|
|
26
|
+
.replace(/\n/gm, "<br>")
|
|
27
|
+
.replace(/&/gm, "&")
|
|
28
|
+
.replace(/ /gm, " ");
|
|
26
29
|
return temp;
|
|
27
30
|
};
|
|
28
31
|
|
|
@@ -37,7 +40,8 @@ export const InputFormatter = ({
|
|
|
37
40
|
return value
|
|
38
41
|
.replace(/<\/p><p>/gm, "\n")
|
|
39
42
|
.replace(/<\/?br>|<\/?p>/gm, "")
|
|
40
|
-
.replace(/&/gm, "&")
|
|
43
|
+
.replace(/&/gm, "&")
|
|
44
|
+
.replace(/ /gm, " ");
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
const onChange = (valueInput, delta, user, h) => {
|
|
@@ -48,7 +52,8 @@ export const InputFormatter = ({
|
|
|
48
52
|
.replace(/<li.*?>/gm, " - ")
|
|
49
53
|
.replace(/<\/li>/gm, "\n")
|
|
50
54
|
.replace(/<\/p><p>/gm, "\n")
|
|
51
|
-
.replaceAll(/<\/?(?!\/?strong).*?>/gm, "")
|
|
55
|
+
.replaceAll(/<\/?(?!\/?strong).*?>/gm, "")
|
|
56
|
+
.replace(/ /gm, " ");
|
|
52
57
|
setInputValue(valueInput);
|
|
53
58
|
value = unformattedText;
|
|
54
59
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Container, Slider } from "./styles";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
3
4
|
|
|
4
5
|
export const SliderToolTip = ({
|
|
5
6
|
infoIcon,
|
|
@@ -7,19 +8,8 @@ export const SliderToolTip = ({
|
|
|
7
8
|
iconSize,
|
|
8
9
|
slidePosition,
|
|
9
10
|
}) => {
|
|
10
|
-
const [showMenu, setShowMenu] =
|
|
11
|
-
|
|
12
|
-
const closeMenu = (e) => {
|
|
13
|
-
if (!e.target.closest("#div-slider") && showMenu) {
|
|
14
|
-
document.removeEventListener("click", closeMenu, false);
|
|
15
|
-
setShowMenu(false);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (showMenu) {
|
|
20
|
-
document.addEventListener("click", closeMenu, false);
|
|
21
|
-
}
|
|
22
|
-
}, [showMenu]);
|
|
11
|
+
const [showMenu, setShowMenu] = useCloseModal("div-slider");
|
|
12
|
+
|
|
23
13
|
const color = (id) => {
|
|
24
14
|
for (let i = 1; i <= slidefront.length; i++) {
|
|
25
15
|
if (id === `slidea${i}`) {
|
|
@@ -43,10 +33,9 @@ export const SliderToolTip = ({
|
|
|
43
33
|
alt="info icon"
|
|
44
34
|
className={iconSize}
|
|
45
35
|
onClick={(e) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
setShowMenu(true);
|
|
50
39
|
}}
|
|
51
40
|
/>
|
|
52
41
|
{showMenu && (
|
|
@@ -73,11 +62,6 @@ export const SliderToolTip = ({
|
|
|
73
62
|
<button
|
|
74
63
|
id="button-slide"
|
|
75
64
|
onClick={(e) => {
|
|
76
|
-
document.removeEventListener(
|
|
77
|
-
"click",
|
|
78
|
-
closeMenu,
|
|
79
|
-
false
|
|
80
|
-
);
|
|
81
65
|
setShowMenu(false);
|
|
82
66
|
}}
|
|
83
67
|
>
|
|
@@ -76,7 +76,7 @@ export const StatusAsignationInfo = ({
|
|
|
76
76
|
/>
|
|
77
77
|
<Button
|
|
78
78
|
buttonType={"general circular-button version-button"}
|
|
79
|
-
onClick={() => {
|
|
79
|
+
onClick={(e) => {
|
|
80
80
|
setShowVersionSelector(true);
|
|
81
81
|
}}
|
|
82
82
|
label={`V${version}`}
|
|
@@ -120,7 +120,10 @@ export const StatusAsignationInfo = ({
|
|
|
120
120
|
imageType={"small-image"}
|
|
121
121
|
image={getProfilePicture(assignation.id, 20, 20)}
|
|
122
122
|
altText="user profile image"
|
|
123
|
-
onClick={() => {
|
|
123
|
+
onClick={(e) => {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
e.stopPropagation();
|
|
126
|
+
console.log(e.target);
|
|
124
127
|
setShowAsignationPanel(true);
|
|
125
128
|
setAssignationType(assignation?.collaboratorType);
|
|
126
129
|
}}
|
|
@@ -16,8 +16,9 @@ export const VersionSelector = ({
|
|
|
16
16
|
companyName,
|
|
17
17
|
currentVersion,
|
|
18
18
|
setShowCreateVersion,
|
|
19
|
+
setShowVersionSelector,
|
|
19
20
|
}) => {
|
|
20
|
-
const [versions, setVersions] = useState();
|
|
21
|
+
const [versions, setVersions] = useState([]);
|
|
21
22
|
|
|
22
23
|
const loadProductVersions = async (articleId) => {
|
|
23
24
|
try {
|
|
@@ -32,8 +33,13 @@ export const VersionSelector = ({
|
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
useEffect(
|
|
36
|
-
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
loadProductVersions(articleId);
|
|
38
|
+
|
|
39
|
+
return () => {
|
|
40
|
+
setVersions([]);
|
|
41
|
+
setShowCreateVersion(false);
|
|
42
|
+
};
|
|
37
43
|
}, []);
|
|
38
44
|
|
|
39
45
|
return (
|
|
@@ -55,6 +61,7 @@ export const VersionSelector = ({
|
|
|
55
61
|
<Button
|
|
56
62
|
image={closeIcon}
|
|
57
63
|
buttonType={"circular-button"}
|
|
64
|
+
onClick={() => setShowVersionSelector(false)}
|
|
58
65
|
id="close-button"
|
|
59
66
|
/>
|
|
60
67
|
</div>
|
|
@@ -41,7 +41,7 @@ import Slide1_3 from "../../../assets/images/sliderToolTip/slide3.svg";
|
|
|
41
41
|
import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
42
42
|
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
43
43
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
44
|
-
import {
|
|
44
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
45
45
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
46
46
|
|
|
47
47
|
const reducerImages = (state, action) => {
|
|
@@ -164,7 +164,7 @@ export const ProviderProductEdition = ({
|
|
|
164
164
|
: productToEdit
|
|
165
165
|
);
|
|
166
166
|
const [icon, setIcon] = useState(null);
|
|
167
|
-
const [version] = useState(product?.version);
|
|
167
|
+
const [version, setVersion] = useState(product?.version);
|
|
168
168
|
const [comments] = useState({});
|
|
169
169
|
const [comment, setComment] = useState("");
|
|
170
170
|
const [crossComment, setCrossComment] = useState(false);
|
|
@@ -211,7 +211,7 @@ export const ProviderProductEdition = ({
|
|
|
211
211
|
);
|
|
212
212
|
const [showCreateVersion, setShowCreateVersion] = useState(false);
|
|
213
213
|
const [showVersionSelector, setShowVersionSelector] =
|
|
214
|
-
|
|
214
|
+
useCloseModal("version-selector");
|
|
215
215
|
|
|
216
216
|
useEffect(() => {
|
|
217
217
|
checkAll && setSelectedImages(images.values);
|
|
@@ -31,7 +31,7 @@ import { Loading } from "../../atoms/Loading";
|
|
|
31
31
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
32
|
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
33
33
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
34
|
-
import {
|
|
34
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
35
35
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
36
36
|
|
|
37
37
|
const reducerImages = (state, action) => {
|
|
@@ -169,7 +169,7 @@ export const RetailerProductEdition = ({
|
|
|
169
169
|
const isAuditor = user.id_role === 6;
|
|
170
170
|
const [showCreateVersion, setShowCreateVersion] = useState(false);
|
|
171
171
|
const [showVersionSelector, setShowVersionSelector] =
|
|
172
|
-
|
|
172
|
+
useCloseModal("version-selector");
|
|
173
173
|
|
|
174
174
|
useEffect(() => {
|
|
175
175
|
checkAll && setSelectedImages(images.values);
|
|
@@ -1267,6 +1267,7 @@ export const RetailerProductEdition = ({
|
|
|
1267
1267
|
break;
|
|
1268
1268
|
}
|
|
1269
1269
|
}}
|
|
1270
|
+
canAssign={![7, 8].includes(user.id_role)}
|
|
1270
1271
|
/>
|
|
1271
1272
|
<div
|
|
1272
1273
|
className={
|
|
@@ -1440,6 +1441,7 @@ export const RetailerProductEdition = ({
|
|
|
1440
1441
|
companyName={product.article.company_name}
|
|
1441
1442
|
currentVersion={version}
|
|
1442
1443
|
setShowCreateVersion={setShowCreateVersion}
|
|
1444
|
+
setShowVersionSelector={setShowVersionSelector}
|
|
1443
1445
|
/>
|
|
1444
1446
|
)}
|
|
1445
1447
|
{showCreateVersion && (
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const useCloseModal = (id) => {
|
|
5
5
|
const [showModal, setShowModal] = useState(false);
|
|
6
6
|
|
|
7
|
+
const closeModal = (e) => {
|
|
8
|
+
e.stopPropagation();
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
if (!e.target.closest(`#${id}`) && showModal) {
|
|
11
|
+
document.removeEventListener("click", closeModal, false);
|
|
12
|
+
setShowModal(false);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
7
15
|
useEffect(() => {
|
|
8
|
-
const closeModal = (e) => {
|
|
9
|
-
if (
|
|
10
|
-
(!e.target.closest(`#${id}`) ||
|
|
11
|
-
e.target.closest("#close-button") ||
|
|
12
|
-
e.target.closest("#add-version")) &&
|
|
13
|
-
showModal
|
|
14
|
-
) {
|
|
15
|
-
document.removeEventListener("click", closeModal);
|
|
16
|
-
setShowModal(false);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
16
|
if (showModal) {
|
|
21
|
-
document.addEventListener("click", closeModal);
|
|
17
|
+
document.addEventListener("click", closeModal, false);
|
|
22
18
|
}
|
|
19
|
+
return () => {
|
|
20
|
+
document.removeEventListener("click", closeModal, false);
|
|
21
|
+
};
|
|
23
22
|
}, [showModal]);
|
|
24
23
|
|
|
25
24
|
return [showModal, setShowModal];
|