contentoh-components-library 15.0.0 → 18.0.0
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/assets/images/generalButton/downloadIcon.svg +3 -0
- package/dist/components/atoms/CheckBox/index.js +4 -2
- package/dist/components/atoms/GeneralButton/styles.js +4 -2
- package/dist/components/atoms/GeneralInput/index.js +14 -27
- package/dist/components/atoms/GenericModal/index.js +4 -2
- package/dist/components/atoms/GenericModal/styles.js +1 -1
- package/dist/components/atoms/Input/index.js +1 -1
- package/dist/components/atoms/Input/style.js +4 -4
- package/dist/components/atoms/InputFormatter/Wysiwyg.stories.js +30 -0
- package/dist/components/atoms/InputFormatter/index.js +119 -0
- package/dist/components/atoms/InputFormatter/styles.js +33 -0
- package/dist/components/atoms/LabelToInput/style.js +3 -3
- package/dist/components/atoms/ProductPercentCard/Percent.stories.js +41 -0
- package/dist/components/atoms/ProductPercentCard/index.js +45 -0
- package/dist/components/atoms/ProductPercentCard/styles.js +20 -0
- package/dist/components/molecules/GalleryElement/index.js +24 -2
- package/dist/components/molecules/GalleryHeader/index.js +19 -2
- package/dist/components/molecules/StatusAsignationInfo/index.js +12 -27
- package/dist/components/molecules/TableHeader/index.js +4 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/organisms/FullTabsMenu/index.js +8 -8
- package/dist/components/organisms/ImageDataTable/index.js +4 -2
- package/dist/components/organisms/ProductImageModal/index.js +2 -3
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -14
- package/dist/components/pages/RetailerProductEdition/index.js +330 -169
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/package.json +5 -1
- package/src/assets/images/generalButton/downloadIcon.svg +3 -0
- package/src/components/atoms/CheckBox/index.js +8 -2
- package/src/components/atoms/GeneralButton/styles.js +14 -0
- package/src/components/atoms/GeneralInput/index.js +12 -29
- package/src/components/atoms/GenericModal/index.js +2 -2
- package/src/components/atoms/GenericModal/styles.js +3 -0
- package/src/components/atoms/Input/index.js +2 -1
- package/src/components/atoms/Input/style.js +9 -5
- package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/InputFormatter/index.js +76 -0
- package/src/components/atoms/InputFormatter/styles.js +34 -0
- package/src/components/atoms/LabelToInput/style.js +10 -2
- package/src/components/atoms/ProductPercentCard/Percent.stories.js +41 -0
- package/src/components/atoms/ProductPercentCard/index.js +23 -0
- package/src/components/atoms/{Percent → ProductPercentCard}/styles.js +11 -7
- package/src/components/molecules/GalleryElement/index.js +18 -1
- package/src/components/molecules/GalleryHeader/index.js +8 -2
- package/src/components/molecules/StatusAsignationInfo/index.js +12 -24
- package/src/components/molecules/TableHeader/index.js +2 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/FullTabsMenu/index.js +6 -6
- package/src/components/organisms/ImageDataTable/index.js +2 -0
- package/src/components/organisms/ProductImageModal/index.js +8 -2
- package/src/components/organisms/ProductImageModal/styles.js +3 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -14
- package/src/components/pages/RetailerProductEdition/index.js +250 -90
- package/src/components/pages/RetailerProductEdition/styles.js +11 -3
- package/src/components/atoms/Percent/Percent.stories.js +0 -38
- package/src/components/atoms/Percent/index.js +0 -15
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="17" height="18" viewBox="0 0 17 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M13.7063 7.61134C13.2246 5.16759 11.0783 3.33301 8.5 3.33301C6.45292 3.33301 4.675 4.49467 3.78958 6.19467C1.6575 6.42134 0 8.22759 0 10.4163C0 12.7609 1.90542 14.6663 4.25 14.6663H13.4583C15.4133 14.6663 17 13.0797 17 11.1247C17 9.25467 15.5479 7.73884 13.7063 7.61134ZM12.0417 9.70801L8.5 13.2497L4.95833 9.70801H7.08333V6.87467H9.91667V9.70801H12.0417Z" fill="#817393"/>
|
|
3
|
+
</svg>
|
|
@@ -13,13 +13,15 @@ var CheckBox = function CheckBox(_ref) {
|
|
|
13
13
|
var id = _ref.id,
|
|
14
14
|
label = _ref.label,
|
|
15
15
|
onChange = _ref.onChange,
|
|
16
|
-
isFilter = _ref.isFilter
|
|
16
|
+
isFilter = _ref.isFilter,
|
|
17
|
+
defaultChecked = _ref.defaultChecked;
|
|
17
18
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
18
19
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
19
20
|
type: "checkbox",
|
|
20
21
|
name: id,
|
|
21
22
|
id: id,
|
|
22
|
-
onChange: onChange
|
|
23
|
+
onChange: onChange,
|
|
24
|
+
defaultChecked: defaultChecked
|
|
23
25
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
24
26
|
htmlFor: id,
|
|
25
27
|
children: label && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -37,12 +37,14 @@ var _deleteIcon = _interopRequireDefault(require("../../../assets/images/general
|
|
|
37
37
|
|
|
38
38
|
var _deleteIconHover = _interopRequireDefault(require("../../../assets/images/generalButton/deleteIconHover.svg"));
|
|
39
39
|
|
|
40
|
+
var _downloadIcon = _interopRequireDefault(require("../../../assets/images/generalButton/downloadIcon.svg"));
|
|
41
|
+
|
|
40
42
|
var _variables = require("../../../global-files/variables");
|
|
41
43
|
|
|
42
44
|
var _templateObject;
|
|
43
45
|
|
|
44
|
-
var Container = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: #e33aa9;\n border: none;\n border-radius: 30px;\n color: #fff;\n font-family: ", ";\n font-style: normal;\n font-weight: normal;\n font-size: 18px;\n line-height: 22px;\n padding: 10px 25px;\n cursor: pointer;\n\n &:hover {\n opacity: 0.7;\n }\n\n &.general-purple-button {\n background-color: #603888;\n }\n\n &.general-transparent-button {\n background-color: transparent;\n border: 1px solid #503d66;\n color: #503d66;\n }\n &.general-white-button {\n background-color: ", ";\n color: ", ";\n }\n\n &.general-green-button {\n background-color: #71de56;\n }\n\n &.circular-button {\n width: 25px;\n height: 25px;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n &.accept-button {\n background-image: url(", ");\n }\n\n &.reject-button {\n background-image: url(", ");\n }\n\n &.null-button {\n background-image: url(", ");\n }\n\n &.save-button {\n background-image: url(", ");\n border: 1px solid ", ";\n border-radius: 15px;\n\n &:hover {\n background-image: url(", ");\n background-color: ", ";\n border: 1px solid ", ";\n }\n }\n\n &.delete-button {\n background-image: url(", ");\n border: 1px solid ", ";\n border-radius: 15px;\n background-size: 15px;\n\n &:hover {\n background-image: url(", ");\n background-color: ", ";\n border: 1px solid ", ";\n }\n }\n }\n\n &.general-arrow-button {\n background-image: url(", ");\n width: 27px;\n height: 27px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n }\n\n &.close-button {\n width: 52px;\n height: 52px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(", ");\n }\n\n &.open-modal-button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n position: absolute;\n right: 10px;\n bottom: 10px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n width: 21px;\n height: 21px;\n padding: 0;\n border-radius: 0;\n background-image: url(", ");\n }\n\n &.grid-layout,\n &.row-layout {\n background-color: transparent;\n background-repeat: no-repeat;\n width: 24px;\n height: 24px;\n padding: 0;\n }\n\n &.grid-layout {\n background-image: url(", ");\n }\n\n &.row-layout {\n background-image: url(", ");\n }\n\n &.general-button-disabled {\n background-color: grey;\n color: ", ";\n\n &:hover {\n opacity: 1;\n }\n }\n"])), function (props) {
|
|
46
|
+
var Container = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: #e33aa9;\n border: none;\n border-radius: 30px;\n color: #fff;\n font-family: ", ";\n font-style: normal;\n font-weight: normal;\n font-size: 18px;\n line-height: 22px;\n padding: 10px 25px;\n cursor: pointer;\n\n &:hover {\n opacity: 0.7;\n }\n\n &.general-purple-button {\n background-color: #603888;\n }\n\n &.general-transparent-button {\n background-color: transparent;\n border: 1px solid #503d66;\n color: #503d66;\n }\n &.general-white-button {\n background-color: ", ";\n color: ", ";\n }\n\n &.general-green-button {\n background-color: #71de56;\n }\n\n &.circular-button {\n width: 25px;\n height: 25px;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n &.accept-button {\n background-image: url(", ");\n }\n\n &.reject-button {\n background-image: url(", ");\n }\n\n &.null-button {\n background-image: url(", ");\n }\n\n &.save-button {\n background-image: url(", ");\n border: 1px solid ", ";\n border-radius: 15px;\n\n &:hover {\n background-image: url(", ");\n background-color: ", ";\n border: 1px solid ", ";\n }\n }\n\n &.delete-button {\n background-image: url(", ");\n border: 1px solid ", ";\n border-radius: 15px;\n background-size: 15px;\n\n &:hover {\n background-image: url(", ");\n background-color: ", ";\n border: 1px solid ", ";\n }\n }\n\n &.download-button {\n background-image: url(", ");\n border: 1px solid ", ";\n border-radius: 15px;\n background-size: 15px;\n\n &:hover {\n color: white;\n background-color: ", ";\n border: 1px solid ", ";\n }\n }\n }\n\n &.general-arrow-button {\n background-image: url(", ");\n width: 27px;\n height: 27px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n }\n\n &.close-button {\n width: 52px;\n height: 52px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(", ");\n }\n\n &.open-modal-button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n position: absolute;\n right: 10px;\n bottom: 10px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n width: 21px;\n height: 21px;\n padding: 0;\n border-radius: 0;\n background-image: url(", ");\n }\n\n &.grid-layout,\n &.row-layout {\n background-color: transparent;\n background-repeat: no-repeat;\n width: 24px;\n height: 24px;\n padding: 0;\n }\n\n &.grid-layout {\n background-image: url(", ");\n }\n\n &.row-layout {\n background-image: url(", ");\n }\n\n &.general-button-disabled {\n background-color: grey;\n color: ", ";\n\n &:hover {\n opacity: 1;\n }\n }\n"])), function (props) {
|
|
45
47
|
return props.buttonFont;
|
|
46
|
-
}, _variables.GlobalColors.s1, _variables.GlobalColors.original_purpura, _acceptIcon.default, _rejectIcon.default, _nullIcon.default, _saveIcon.default, _variables.GlobalColors.s3, _saveIconHover.default, _variables.GlobalColors.magenta_s2, _variables.GlobalColors.magenta_s2, _deleteIcon.default, _variables.GlobalColors.s3, _deleteIconHover.default, _variables.GlobalColors.magenta_s2, _variables.GlobalColors.magenta_s2, _arrowIcon.default, _closeIcon.default, _openModal.default, _rowLayout.default, _gridLayout.default, _variables.GlobalColors.white);
|
|
48
|
+
}, _variables.GlobalColors.s1, _variables.GlobalColors.original_purpura, _acceptIcon.default, _rejectIcon.default, _nullIcon.default, _saveIcon.default, _variables.GlobalColors.s3, _saveIconHover.default, _variables.GlobalColors.magenta_s2, _variables.GlobalColors.magenta_s2, _deleteIcon.default, _variables.GlobalColors.s3, _deleteIconHover.default, _variables.GlobalColors.magenta_s2, _variables.GlobalColors.magenta_s2, _downloadIcon.default, _variables.GlobalColors.s3, _variables.GlobalColors.magenta_s2, _variables.GlobalColors.magenta_s2, _arrowIcon.default, _closeIcon.default, _openModal.default, _rowLayout.default, _gridLayout.default, _variables.GlobalColors.white);
|
|
47
49
|
|
|
48
50
|
exports.Container = Container;
|
|
@@ -9,28 +9,22 @@ exports.GeneralInput = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
11
|
|
|
12
|
-
var _jsBase = require("js-base64");
|
|
13
|
-
|
|
14
12
|
var _react = require("react");
|
|
15
13
|
|
|
16
|
-
var _styledComponents = require("styled-components");
|
|
17
|
-
|
|
18
14
|
var _styles = require("./styles");
|
|
19
15
|
|
|
16
|
+
var _InputFormatter = require("../InputFormatter");
|
|
17
|
+
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
19
|
|
|
22
20
|
var GeneralInput = function GeneralInput(_ref) {
|
|
23
21
|
var inputType = _ref.inputType,
|
|
24
22
|
inputId = _ref.inputId,
|
|
25
|
-
inputCols = _ref.inputCols,
|
|
26
|
-
inputRows = _ref.inputRows,
|
|
27
|
-
inputName = _ref.inputName,
|
|
28
23
|
inputValue = _ref.inputValue,
|
|
29
24
|
articleId = _ref.articleId,
|
|
30
25
|
isRequired = _ref.isRequired,
|
|
31
26
|
version = _ref.version,
|
|
32
27
|
inputPlaceholder = _ref.inputPlaceholder,
|
|
33
|
-
updatedDescriptions = _ref.updatedDescriptions,
|
|
34
28
|
setUpdatedDescriptions = _ref.setUpdatedDescriptions,
|
|
35
29
|
updatedDatasheets = _ref.updatedDatasheets,
|
|
36
30
|
setUpdatedDatasheets = _ref.setUpdatedDatasheets,
|
|
@@ -52,14 +46,6 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
52
46
|
updatedDatasheets && addTextAreaToArray(e.target.value, updatedDatasheets, setUpdatedDatasheets);
|
|
53
47
|
};
|
|
54
48
|
|
|
55
|
-
var onHandleTextAreaChange = function onHandleTextAreaChange(e) {
|
|
56
|
-
setTextValue(function (_ref3) {
|
|
57
|
-
var value = _ref3.value;
|
|
58
|
-
return value = e.target.value;
|
|
59
|
-
});
|
|
60
|
-
updatedDatasheets && addTextAreaToArray(e.target.value, updatedDescriptions, setUpdatedDescriptions);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
49
|
(0, _react.useEffect)(function () {
|
|
64
50
|
if (dinamicHeight) {
|
|
65
51
|
var input = document.querySelector("textarea#description-".concat(inputId, "-").concat(index));
|
|
@@ -70,7 +56,9 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
70
56
|
}
|
|
71
57
|
}, [textValue]);
|
|
72
58
|
|
|
73
|
-
var addTextAreaToArray = function addTextAreaToArray(textValue
|
|
59
|
+
var addTextAreaToArray = function addTextAreaToArray(textValue) {
|
|
60
|
+
var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
61
|
+
var setArray = arguments.length > 2 ? arguments[2] : undefined;
|
|
74
62
|
var tempDescriptions = array;
|
|
75
63
|
var newArticle = {
|
|
76
64
|
articleId: articleId,
|
|
@@ -78,18 +66,18 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
78
66
|
value: textValue,
|
|
79
67
|
versionId: version
|
|
80
68
|
};
|
|
81
|
-
var isOnArray = tempDescriptions.some(function (desc, index) {
|
|
69
|
+
var isOnArray = tempDescriptions === null || tempDescriptions === void 0 ? void 0 : tempDescriptions.some(function (desc, index) {
|
|
82
70
|
if (desc.attributeId === newArticle.attributeId) {
|
|
83
71
|
tempDescriptions[index] = newArticle;
|
|
84
72
|
return true;
|
|
85
73
|
}
|
|
86
74
|
});
|
|
87
|
-
!isOnArray && tempDescriptions.push(newArticle);
|
|
75
|
+
!isOnArray && (tempDescriptions === null || tempDescriptions === void 0 ? void 0 : tempDescriptions.push(newArticle));
|
|
88
76
|
setArray(tempDescriptions);
|
|
89
77
|
};
|
|
90
78
|
|
|
91
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
92
|
-
isRequired: isRequired && !textValue,
|
|
80
|
+
isRequired: isRequired && !textValue.value,
|
|
93
81
|
children: inputType !== "textarea" ? /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
94
82
|
type: inputType,
|
|
95
83
|
id: "datasheet-" + inputId + "-" + index,
|
|
@@ -97,14 +85,13 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
97
85
|
placeholder: inputPlaceholder,
|
|
98
86
|
value: textValue === null || textValue === void 0 ? void 0 : textValue.value,
|
|
99
87
|
onChange: onHandleChange
|
|
100
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
101
|
-
name: inputName,
|
|
88
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputFormatter.InputFormatter, {
|
|
102
89
|
id: "description-" + inputId + "-" + index,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
addTextAreaToArray: addTextAreaToArray,
|
|
91
|
+
updatedDescriptions: updatedDatasheets,
|
|
92
|
+
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
93
|
+
inputValue: inputValue === null || inputValue === void 0 ? void 0 : inputValue.replace(/<br>/gm, "<p><br></p>"),
|
|
94
|
+
isRequired: isRequired && !inputValue
|
|
108
95
|
})
|
|
109
96
|
});
|
|
110
97
|
};
|
|
@@ -12,12 +12,14 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
var GenericModal = function GenericModal(_ref) {
|
|
13
13
|
var _ref$componentsArray = _ref.componentsArray,
|
|
14
14
|
componentsArray = _ref$componentsArray === void 0 ? [] : _ref$componentsArray,
|
|
15
|
-
buttonType = _ref.buttonType
|
|
15
|
+
buttonType = _ref.buttonType,
|
|
16
|
+
onClick = _ref.onClick;
|
|
16
17
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
17
18
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
18
19
|
className: "global-styles " + buttonType,
|
|
19
20
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
20
|
-
className: "close-button"
|
|
21
|
+
className: "close-button",
|
|
22
|
+
onClick: onClick
|
|
21
23
|
}), componentsArray === null || componentsArray === void 0 ? void 0 : componentsArray.map(function (component) {
|
|
22
24
|
return component;
|
|
23
25
|
})]
|
|
@@ -17,6 +17,6 @@ var _genericModalClose = _interopRequireDefault(require("../../../assets/images/
|
|
|
17
17
|
|
|
18
18
|
var _templateObject;
|
|
19
19
|
|
|
20
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n background-color: rgba(59, 59, 59, 0.53);\n backdrop-filter: blur(4px);\n\n .global-styles {\n background-color: ", ";\n height: auto;\n width: auto;\n position: relative;\n border-radius: 15px;\n padding: 40px;\n text-align: center;\n .close-button {\n background-image: url(", ");\n background-color: transparent;\n width: 14px;\n height: 14px;\n cursor: pointer;\n border: none;\n position: absolute;\n right: 20px;\n top: 20px;\n }\n .general-white-button {\n width: 160px;\n height: 40px;\n color: ", ";\n border: 1px solid ", ";\n background-color: transparent;\n & + * {\n margin-left: 45px;\n height: 40px;\n width: 161px;\n }\n }\n\n &.log-out {\n padding-bottom: 60px;\n img {\n & + * {\n margin-top: 20px;\n }\n }\n .with-bold-text {\n font-size: 24px;\n & + * {\n margin-top: 20px;\n }\n }\n }\n\n &.delete-product {\n img {\n height: 50px;\n width: 56px;\n & + * {\n margin-top: 30px;\n }\n }\n .product-name-header {\n & + * {\n margin-bottom: 30px;\n }\n }\n }\n\n &.product-edition {\n padding-top: 50px;\n .product-name-header {\n & + * {\n margin-top: 25px;\n }\n }\n }\n\n &.send-invitation {\n width: 604px;\n img {\n & + * {\n margin-top: 40px;\n }\n }\n p {\n font-family: ", ";\n font-style: normal;\n font-size: 24px;\n color: ", ";\n line-height: 28px;\n span {\n font-family: ", ";\n }\n }\n }\n\n &.upload-image {\n width: 430px;\n padding: 50px;\n img {\n & + * {\n margin-top: 33px;\n }\n }\n .input-name-header {\n & + * {\n margin-top: 20px;\n }\n }\n .list-container {\n & + .general-button-default {\n margin-top: 40px;\n }\n }\n }\n }\n"])), _variables.GlobalColors.white, _variables.GlobalColors.deep_gray, _genericModalClose.default, _variables.GlobalColors.s2, _variables.GlobalColors.white, _variables.FontFamily.Raleway_500, _variables.GlobalColors.white, _variables.FontFamily.Raleway_700);
|
|
20
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n background-color: rgba(59, 59, 59, 0.53);\n backdrop-filter: blur(4px);\n z-index: 100;\n\n .global-styles {\n background-color: ", ";\n height: auto;\n width: auto;\n position: relative;\n border-radius: 15px;\n padding: 40px;\n text-align: center;\n .close-button {\n background-image: url(", ");\n background-color: transparent;\n width: 14px;\n height: 14px;\n cursor: pointer;\n border: none;\n position: absolute;\n right: 20px;\n top: 20px;\n }\n .general-white-button {\n width: 160px;\n height: 40px;\n color: ", ";\n border: 1px solid ", ";\n background-color: transparent;\n & + * {\n margin-left: 45px;\n height: 40px;\n width: 161px;\n }\n }\n\n &.log-out {\n padding-bottom: 60px;\n img {\n & + * {\n margin-top: 20px;\n }\n }\n .with-bold-text {\n font-size: 24px;\n & + * {\n margin-top: 20px;\n }\n }\n }\n\n &.delete-product {\n img {\n height: 50px;\n width: 56px;\n & + * {\n margin-top: 30px;\n }\n }\n .product-name-header {\n & + * {\n margin-bottom: 30px;\n }\n }\n }\n\n &.product-edition {\n padding-top: 50px;\n .product-name-header {\n & + * {\n margin-top: 25px;\n }\n }\n }\n\n &.send-invitation {\n width: 604px;\n img {\n & + * {\n margin-top: 40px;\n }\n }\n p {\n font-family: ", ";\n font-style: normal;\n font-size: 24px;\n color: ", ";\n line-height: 28px;\n span {\n font-family: ", ";\n }\n }\n }\n\n &.upload-image {\n width: 430px;\n padding: 50px;\n img {\n & + * {\n margin-top: 33px;\n }\n }\n .input-name-header {\n & + * {\n margin-top: 20px;\n }\n }\n .list-container {\n & + .general-button-default {\n margin-top: 40px;\n }\n }\n }\n }\n"])), _variables.GlobalColors.white, _variables.GlobalColors.deep_gray, _genericModalClose.default, _variables.GlobalColors.s2, _variables.GlobalColors.white, _variables.FontFamily.Raleway_500, _variables.GlobalColors.white, _variables.FontFamily.Raleway_700);
|
|
21
21
|
|
|
22
22
|
exports.Container = Container;
|
|
@@ -15,9 +15,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
|
|
16
16
|
function Input(props) {
|
|
17
17
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.MainContainer, {
|
|
18
|
-
width: props.width,
|
|
19
18
|
error: props.error,
|
|
20
19
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.InputCustom, (0, _objectSpread2.default)({
|
|
20
|
+
autoFocus: true,
|
|
21
21
|
onChange: function onChange(event) {
|
|
22
22
|
return props.onChange && props.onChange(event.target.value);
|
|
23
23
|
}
|
|
@@ -11,16 +11,16 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
14
16
|
var _templateObject, _templateObject2;
|
|
15
17
|
|
|
16
|
-
var MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n width:
|
|
17
|
-
return props.width ? props.width : "150px";
|
|
18
|
-
}, function (props) {
|
|
18
|
+
var MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n width: fit-content;\n height: 20px;\n padding: 0 5px;\n box-sizing: border-box;\n background: #fafafa;\n border-radius: 2px;\n border: ", ";\n"])), function (props) {
|
|
19
19
|
return props.error && "1px solid red";
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
exports.MainContainer = MainContainer;
|
|
23
23
|
|
|
24
|
-
var InputCustom = _styledComponents.default.input(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 0;\n width: 100%;\n font-family:
|
|
24
|
+
var InputCustom = _styledComponents.default.input(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 0;\n width: 100%;\n font-family: ", ";\n font-weight: 400;\n font-size: 11px;\n line-height: 19px;\n border-width: 0;\n color: ", ";\n background-color: ", ";\n outline: none;\n &::placeholder {\n font-size: 12px;\n color: #d4d1d7;\n }\n"])), _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.s2);
|
|
25
25
|
|
|
26
26
|
exports.InputCustom = InputCustom;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.DefaultInputFormatter = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/InputFormatter",
|
|
18
|
+
component: _index.InputFormatter
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.InputFormatter, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var DefaultInputFormatter = Template.bind({});
|
|
27
|
+
exports.DefaultInputFormatter = DefaultInputFormatter;
|
|
28
|
+
DefaultInputFormatter.args = {
|
|
29
|
+
text: "hola mundo"
|
|
30
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
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.InputFormatter = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _reactQuill = _interopRequireDefault(require("react-quill"));
|
|
13
|
+
|
|
14
|
+
require("react-quill/dist/quill.snow.css");
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
var _styles = require("./styles");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var InputFormatter = function InputFormatter(_ref) {
|
|
23
|
+
var _ref$inputValue = _ref.inputValue,
|
|
24
|
+
inputValue = _ref$inputValue === void 0 ? "" : _ref$inputValue,
|
|
25
|
+
id = _ref.id,
|
|
26
|
+
updatedDescriptions = _ref.updatedDescriptions,
|
|
27
|
+
setUpdatedDescriptions = _ref.setUpdatedDescriptions,
|
|
28
|
+
addTextAreaToArray = _ref.addTextAreaToArray,
|
|
29
|
+
isRequired = _ref.isRequired;
|
|
30
|
+
|
|
31
|
+
var _useState = (0, _react.useState)(inputValue),
|
|
32
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
+
convertedText = _useState2[0],
|
|
34
|
+
setConvertedText = _useState2[1];
|
|
35
|
+
|
|
36
|
+
var _useState3 = (0, _react.useState)(false),
|
|
37
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
38
|
+
focus = _useState4[0],
|
|
39
|
+
setFocus = _useState4[1];
|
|
40
|
+
|
|
41
|
+
var _useState5 = (0, _react.useState)(false),
|
|
42
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
43
|
+
selection = _useState6[0],
|
|
44
|
+
setSelection = _useState6[1];
|
|
45
|
+
|
|
46
|
+
var _useState7 = (0, _react.useState)({
|
|
47
|
+
left: 0,
|
|
48
|
+
top: 0
|
|
49
|
+
}),
|
|
50
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
51
|
+
position = _useState8[0],
|
|
52
|
+
setPosition = _useState8[1];
|
|
53
|
+
|
|
54
|
+
var onHandleTextAreaChange = function onHandleTextAreaChange(value) {
|
|
55
|
+
setConvertedText(function (current) {
|
|
56
|
+
return current = value;
|
|
57
|
+
});
|
|
58
|
+
!id.includes("commentary") && addTextAreaToArray(value.replace(/<\/?p>/gm, ""), updatedDescriptions, setUpdatedDescriptions);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
function getSelectionText() {
|
|
62
|
+
setPosition({
|
|
63
|
+
left: 0,
|
|
64
|
+
top: 0
|
|
65
|
+
});
|
|
66
|
+
var text = "";
|
|
67
|
+
|
|
68
|
+
if (window.getSelection) {
|
|
69
|
+
text = window.getSelection().toString();
|
|
70
|
+
} else if (document.selection && document.selection.type != "Control") {
|
|
71
|
+
text = document.selection.createRange().text;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
setSelection(text.length > 0);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var getCursorPosition = function getCursorPosition(e) {
|
|
78
|
+
var input = document.getElementById(id);
|
|
79
|
+
var elementPosition = input.getBoundingClientRect();
|
|
80
|
+
position.top === 0 && position.left === 0 && setPosition({
|
|
81
|
+
left: e.clientX - elementPosition.x,
|
|
82
|
+
top: e.clientY - elementPosition.y
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
87
|
+
focus: focus,
|
|
88
|
+
selection: selection,
|
|
89
|
+
position: position,
|
|
90
|
+
isRequired: isRequired,
|
|
91
|
+
onClick: function onClick(e) {
|
|
92
|
+
getCursorPosition(e);
|
|
93
|
+
},
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactQuill.default, {
|
|
95
|
+
id: id,
|
|
96
|
+
value: convertedText,
|
|
97
|
+
onChange: onHandleTextAreaChange,
|
|
98
|
+
modules: {
|
|
99
|
+
toolbar: ["bold"]
|
|
100
|
+
},
|
|
101
|
+
onFocus: function onFocus() {
|
|
102
|
+
return setFocus(true);
|
|
103
|
+
},
|
|
104
|
+
onBlur: function onBlur() {
|
|
105
|
+
setFocus(false);
|
|
106
|
+
setSelection(false);
|
|
107
|
+
setPosition({
|
|
108
|
+
left: 0,
|
|
109
|
+
top: 0
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
onChangeSelection: function onChangeSelection() {
|
|
113
|
+
return getSelectionText();
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
exports.InputFormatter = InputFormatter;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 .quill {\n border: 1px solid\n ", ";\n position: relative;\n border-radius: 2px;\n\n .ql-toolbar {\n background-color: ", ";\n position: absolute;\n z-index: 10;\n border: 1px solid ", ";\n width: 45px;\n height: 45px;\n border-radius: 4px;\n visibility: ", ";\n top: ", "px;\n left: ", "px;\n }\n\n .ql-container {\n border: none;\n font-family: ", ";\n color: ", ";\n strong {\n font-family: ", ";\n }\n }\n }\n"])), function (_ref) {
|
|
19
|
+
var focus = _ref.focus,
|
|
20
|
+
isRequired = _ref.isRequired;
|
|
21
|
+
return focus ? _variables.GlobalColors.magenta_s2 : isRequired ? "red" : _variables.GlobalColors.s3;
|
|
22
|
+
}, _variables.GlobalColors.s2, _variables.GlobalColors.s3, function (_ref2) {
|
|
23
|
+
var selection = _ref2.selection;
|
|
24
|
+
return selection ? "visible" : "hidden";
|
|
25
|
+
}, function (_ref3) {
|
|
26
|
+
var position = _ref3.position;
|
|
27
|
+
return position.top;
|
|
28
|
+
}, function (_ref4) {
|
|
29
|
+
var position = _ref4.position;
|
|
30
|
+
return position.left;
|
|
31
|
+
}, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.FontFamily.Raleway_900);
|
|
32
|
+
|
|
33
|
+
exports.Container = Container;
|
|
@@ -11,11 +11,11 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
14
16
|
var _templateObject;
|
|
15
17
|
|
|
16
|
-
var MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n width:
|
|
17
|
-
return props.width ? props.width : "150px";
|
|
18
|
-
}, function (props) {
|
|
18
|
+
var MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n width: fit-content;\n height: 20px;\n padding: 0 5px;\n box-sizing: border-box;\n border-radius: 2px;\n margin-left: 15px;\n white-space: nowrap;\n overflow-x: auto;\n overflow-y: hidden;\n & > p {\n font-family: ", ";\n font-weight: 400;\n font-size: 11px;\n line-height: 19px;\n color: ", ";\n background-color: ", ";\n padding: 1px 3px;\n border-radius: 3px;\n }\n border: ", ";\n ::-webkit-scrollbar {\n width: 3px;\n height: 3px;\n }\n ::-webkit-scrollbar-track {\n background: #f1f1f1;\n }\n ::-webkit-scrollbar-thumb {\n background: #d4d1d7;\n border-radius: 3px;\n }\n"])), _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.s2, function (props) {
|
|
19
19
|
return props.error && "1px solid red";
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -0,0 +1,41 @@
|
|
|
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.ProductPercentCardDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var status = ["-", "Pr", "Rc", "As", "P", "QF", "AF", "AA", "AP", "AC", "RA", "RF", "RP", "RC", "Ex"];
|
|
17
|
+
var _default = {
|
|
18
|
+
title: "Components/atoms/ProductPercentCard",
|
|
19
|
+
component: _index.ProductPercentCard,
|
|
20
|
+
argTypes: {
|
|
21
|
+
statusType: {
|
|
22
|
+
options: status,
|
|
23
|
+
control: {
|
|
24
|
+
type: "select"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.default = _default;
|
|
30
|
+
|
|
31
|
+
var Template = function Template(args) {
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProductPercentCard, (0, _objectSpread2.default)({}, args));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var ProductPercentCardDefault = Template.bind({});
|
|
36
|
+
exports.ProductPercentCardDefault = ProductPercentCardDefault;
|
|
37
|
+
ProductPercentCardDefault.args = {
|
|
38
|
+
statusType: "-",
|
|
39
|
+
productsInStatus: 0,
|
|
40
|
+
totalProcucts: 0
|
|
41
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
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.ProductPercentCard = void 0;
|
|
9
|
+
|
|
10
|
+
var _styles = require("./styles");
|
|
11
|
+
|
|
12
|
+
var _polygon = _interopRequireDefault(require("../../../assets/images/arrow/polygon.svg"));
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var ProductPercentCard = function ProductPercentCard(_ref) {
|
|
17
|
+
var statusType = _ref.statusType,
|
|
18
|
+
_ref$totalProcucts = _ref.totalProcucts,
|
|
19
|
+
totalProcucts = _ref$totalProcucts === void 0 ? 0 : _ref$totalProcucts,
|
|
20
|
+
_ref$productsInStatus = _ref.productsInStatus,
|
|
21
|
+
productsInStatus = _ref$productsInStatus === void 0 ? 0 : _ref$productsInStatus;
|
|
22
|
+
var result = productsInStatus / totalProcucts * 100;
|
|
23
|
+
var percent = result.toString().search(/\./) ? result.toFixed(2) : result;
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
25
|
+
className: "status-".concat(statusType),
|
|
26
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
27
|
+
className: "text",
|
|
28
|
+
children: "Productos en proceso"
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
30
|
+
className: "percent-text",
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
32
|
+
className: "number",
|
|
33
|
+
children: productsInStatus
|
|
34
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
35
|
+
src: _polygon.default,
|
|
36
|
+
alt: ""
|
|
37
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
38
|
+
className: "span",
|
|
39
|
+
children: [percent == "NaN" ? 0 : percent, "%"]
|
|
40
|
+
})]
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.ProductPercentCard = ProductPercentCard;
|
|
@@ -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 border-radius: 7px;\n max-width: fit-content;\n flex-direction: column;\n height: 83px;\n padding: 10px;\n\n &.status-Pr,\n &.status-Rc {\n border: 1px solid ", ";\n .span {\n color: ", ";\n }\n }\n &.status-- {\n border: 1px solid ", ";\n .span {\n color: ", ";\n }\n }\n\n &.status-As,\n &.status-P,\n &.status-QF {\n border: 1px solid ", ";\n .span {\n color: ", ";\n }\n }\n\n &.status-AF,\n &.status-AA,\n &.status-AP,\n &.status-AC {\n border: 1px solid ", ";\n .span {\n color: ", ";\n }\n }\n\n &.status-RA,\n &.status-RF,\n &.status-RP,\n &.status-RC {\n border: 1px solid #d74ded;\n .span {\n color: #d74ded;\n }\n }\n\n &.status-Ex {\n border: 1px solid ", ";\n .span {\n color: ", ";\n }\n }\n\n .text {\n color: ", ";\n text-align: center;\n font-size: 12px;\n width: 70px;\n font-family: ", ";\n line-height: 14px;\n margin: auto;\n }\n .percent-text {\n display: flex;\n font-family: ", ";\n align-items: center;\n .number {\n font-size: 28px;\n color: ", ";\n }\n .span {\n padding-top: 8px;\n font-size: 18px;\n }\n }\n"])), _variables.GlobalColors.reception, _variables.GlobalColors.reception, _variables.GlobalColors.s3, _variables.GlobalColors.s3, _variables.GlobalColors.in_progress, _variables.GlobalColors.in_progress, _variables.GlobalColors.finished, _variables.GlobalColors.finished, _variables.GlobalColors.exported, _variables.GlobalColors.exported, _variables.GlobalColors.s4, _variables.FontFamily.Raleway, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -38,7 +38,10 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
38
38
|
imageInputs = _ref.imageInputs,
|
|
39
39
|
imageType = _ref.imageType,
|
|
40
40
|
imagePackagingType = _ref.imagePackagingType,
|
|
41
|
-
changeImage = _ref.changeImage
|
|
41
|
+
changeImage = _ref.changeImage,
|
|
42
|
+
selectedImages = _ref.selectedImages,
|
|
43
|
+
setSelectedImages = _ref.setSelectedImages,
|
|
44
|
+
setCheckAll = _ref.setCheckAll;
|
|
42
45
|
|
|
43
46
|
var _useState = (0, _react.useState)(validation),
|
|
44
47
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -57,6 +60,22 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
62
|
|
|
63
|
+
var checkOnChange = function checkOnChange(e) {
|
|
64
|
+
var chkGlobal = document.getElementById("check-all-images");
|
|
65
|
+
var checkboxList = document.querySelectorAll("[id^='gallery-element-']");
|
|
66
|
+
var temp = selectedImages.slice();
|
|
67
|
+
e.target.checked ? temp.push(image) : temp = temp.filter(function (img) {
|
|
68
|
+
return image.id !== img.id;
|
|
69
|
+
});
|
|
70
|
+
var counter = 0;
|
|
71
|
+
checkboxList === null || checkboxList === void 0 ? void 0 : checkboxList.forEach(function (chk) {
|
|
72
|
+
return chk.checked && counter++;
|
|
73
|
+
});
|
|
74
|
+
chkGlobal.checked = checkboxList.length === counter;
|
|
75
|
+
setCheckAll(checkboxList.length === counter);
|
|
76
|
+
setSelectedImages(temp);
|
|
77
|
+
};
|
|
78
|
+
|
|
60
79
|
(0, _react.useEffect)(function () {
|
|
61
80
|
if (showValidationPanel) {
|
|
62
81
|
document.addEventListener("click", closeValidationPanel, false);
|
|
@@ -68,7 +87,10 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
68
87
|
className: "buttons-container",
|
|
69
88
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
|
|
70
89
|
id: id,
|
|
71
|
-
label: label
|
|
90
|
+
label: label,
|
|
91
|
+
onChange: function onChange(e) {
|
|
92
|
+
return checkOnChange(e);
|
|
93
|
+
}
|
|
72
94
|
})
|
|
73
95
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
74
96
|
className: "image-container",
|
|
@@ -11,10 +11,27 @@ var _CheckBox = require("../../atoms/CheckBox");
|
|
|
11
11
|
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
|
|
14
|
-
var GalleryHeader = function GalleryHeader() {
|
|
14
|
+
var GalleryHeader = function GalleryHeader(_ref) {
|
|
15
|
+
var setCheckAll = _ref.setCheckAll,
|
|
16
|
+
setSelectedImages = _ref.setSelectedImages;
|
|
17
|
+
|
|
18
|
+
var checkAll = function checkAll(e) {
|
|
19
|
+
var checkboxList = document.querySelectorAll("[id^='gallery-element-']");
|
|
20
|
+
checkboxList.forEach(function (chk) {
|
|
21
|
+
return chk.checked = e.target.checked;
|
|
22
|
+
});
|
|
23
|
+
setCheckAll(e.target.checked);
|
|
24
|
+
if (!e.target.checked) setSelectedImages([]);
|
|
25
|
+
};
|
|
26
|
+
|
|
15
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
16
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
17
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
|
|
29
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
|
|
30
|
+
id: "check-all-images",
|
|
31
|
+
onChange: function onChange(e) {
|
|
32
|
+
return checkAll(e);
|
|
33
|
+
}
|
|
34
|
+
})
|
|
18
35
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
19
36
|
className: "image-header",
|
|
20
37
|
children: "Image"
|