contentoh-components-library 21.4.99 → 21.4.100
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/ObservationFlag/index.js +8 -9
- package/dist/components/molecules/ProductNameHeader/index.js +2 -3
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -3
- package/dist/components/pages/RetailerProductEdition/index.js +17 -15
- package/package.json +1 -1
- package/src/components/atoms/ObservationFlag/index.js +10 -8
- package/src/components/molecules/ProductNameHeader/index.js +4 -4
- package/src/components/organisms/FullProductNameHeader/index.js +4 -4
- package/src/components/pages/RetailerProductEdition/index.js +18 -18
|
@@ -47,9 +47,8 @@ var ObservationFlag = function ObservationFlag(_ref) {
|
|
|
47
47
|
dataProduct = _ref.dataProduct,
|
|
48
48
|
isObservationVisible = _ref.isObservationVisible,
|
|
49
49
|
toggleObservation = _ref.toggleObservation,
|
|
50
|
-
handleClickOutside = _ref.handleClickOutside,
|
|
51
50
|
hideObservation = _ref.hideObservation;
|
|
52
|
-
var PriorityFlags = (_PriorityFlags = {}, (0, _defineProperty2.default)(_PriorityFlags, "none", _noPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "low", _lowPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "medium", _mediumPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "high", _highPriority.default), _PriorityFlags); //
|
|
51
|
+
var PriorityFlags = (_PriorityFlags = {}, (0, _defineProperty2.default)(_PriorityFlags, "none", _noPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "low", _lowPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "medium", _mediumPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "high", _highPriority.default), _PriorityFlags); //const [isObservationVisible, setObservationVisible] = useState(false);
|
|
53
52
|
|
|
54
53
|
var _useState = (0, _react.useState)(contentObservation || ""),
|
|
55
54
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -86,13 +85,13 @@ var ObservationFlag = function ObservationFlag(_ref) {
|
|
|
86
85
|
return function () {
|
|
87
86
|
document.removeEventListener("click", handleClickOutside);
|
|
88
87
|
};
|
|
89
|
-
}, [isObservationVisible]);
|
|
90
|
-
(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
}, [isObservationVisible]); // useEffect(() => {
|
|
89
|
+
// document.addEventListener("click", handleClickOutside);
|
|
90
|
+
// return () => {
|
|
91
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
92
|
+
// };
|
|
93
|
+
// }, [isObservationVisible, handleClickOutside]);
|
|
94
|
+
|
|
96
95
|
(0, _react.useEffect)(function () {
|
|
97
96
|
setMaterial(contentObservation || "");
|
|
98
97
|
}, [contentObservation]);
|
|
@@ -29,7 +29,6 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
29
29
|
dataProduct = _ref.dataProduct,
|
|
30
30
|
isObservationVisible = _ref.isObservationVisible,
|
|
31
31
|
toggleObservation = _ref.toggleObservation,
|
|
32
|
-
handleClickOutside = _ref.handleClickOutside,
|
|
33
32
|
hideObservation = _ref.hideObservation;
|
|
34
33
|
var typeFlag = productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
35
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
@@ -47,8 +46,8 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
47
46
|
contentObservation: productObservation,
|
|
48
47
|
dataProduct: dataProduct,
|
|
49
48
|
isObservationVisible: isObservationVisible,
|
|
50
|
-
toggleObservation: toggleObservation
|
|
51
|
-
|
|
49
|
+
toggleObservation: toggleObservation // handleClickOutside = {handleClickOutside}
|
|
50
|
+
,
|
|
52
51
|
hideObservation: hideObservation
|
|
53
52
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
54
53
|
headerType: "date-header",
|
|
@@ -38,7 +38,6 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
38
38
|
productObservation = _ref.productObservation,
|
|
39
39
|
isObservationVisible = _ref.isObservationVisible,
|
|
40
40
|
toggleObservation = _ref.toggleObservation,
|
|
41
|
-
handleClickOutside = _ref.handleClickOutside,
|
|
42
41
|
hideObservation = _ref.hideObservation;
|
|
43
42
|
|
|
44
43
|
var _useState = (0, _react.useState)([]),
|
|
@@ -77,8 +76,8 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
77
76
|
date: getTime((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp)),
|
|
78
77
|
dataProduct: headerData,
|
|
79
78
|
isObservationVisible: isObservationVisible,
|
|
80
|
-
toggleObservation: toggleObservation
|
|
81
|
-
|
|
79
|
+
toggleObservation: toggleObservation // handleClickOutside ={handleClickOutside}
|
|
80
|
+
,
|
|
82
81
|
hideObservation: hideObservation
|
|
83
82
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
84
83
|
className: "features-bar-container",
|
|
@@ -514,20 +514,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
514
514
|
|
|
515
515
|
var toggleObservation = function toggleObservation() {
|
|
516
516
|
setObservationVisible(!isObservationVisible);
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
517
|
+
}; // const handleClickOutside = (event) => {
|
|
518
|
+
// if (
|
|
519
|
+
// isObservationVisible &&
|
|
520
|
+
// !event.target.closest(".Observation") &&
|
|
521
|
+
// !event.target.closest(".Container")
|
|
522
|
+
// ) {
|
|
523
|
+
// hideObservation();
|
|
524
|
+
// }
|
|
525
|
+
// };
|
|
526
|
+
// useEffect(() => {
|
|
527
|
+
// document.addEventListener("click", handleClickOutside);
|
|
528
|
+
// return () => {
|
|
529
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
530
|
+
// };
|
|
531
|
+
// }, [isObservationVisible]);
|
|
524
532
|
|
|
525
|
-
(0, _react.useEffect)(function () {
|
|
526
|
-
document.addEventListener("click", handleClickOutside);
|
|
527
|
-
return function () {
|
|
528
|
-
document.removeEventListener("click", handleClickOutside);
|
|
529
|
-
};
|
|
530
|
-
}, [isObservationVisible]);
|
|
531
533
|
|
|
532
534
|
var hideObservation = function hideObservation() {
|
|
533
535
|
setObservationVisible(false);
|
|
@@ -2050,8 +2052,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2050
2052
|
setValRejAll(true);
|
|
2051
2053
|
},
|
|
2052
2054
|
isObservationVisible: isObservationVisible,
|
|
2053
|
-
toggleObservation: toggleObservation
|
|
2054
|
-
|
|
2055
|
+
toggleObservation: toggleObservation // handleClickOutside={handleClickOutside}
|
|
2056
|
+
,
|
|
2055
2057
|
hideObservation: hideObservation
|
|
2056
2058
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2057
2059
|
tabsSections: tabsSections,
|
package/package.json
CHANGED
|
@@ -13,7 +13,9 @@ export const ObservationFlag = ({
|
|
|
13
13
|
observation,
|
|
14
14
|
contentObservation,
|
|
15
15
|
dataProduct,
|
|
16
|
-
isObservationVisible, toggleObservation,
|
|
16
|
+
isObservationVisible, toggleObservation,
|
|
17
|
+
// handleClickOutside,
|
|
18
|
+
hideObservation
|
|
17
19
|
}) => {
|
|
18
20
|
const PriorityFlags = {
|
|
19
21
|
["none"]: without,
|
|
@@ -22,7 +24,7 @@ export const ObservationFlag = ({
|
|
|
22
24
|
["high"]: high,
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
//const [isObservationVisible, setObservationVisible] = useState(false);
|
|
26
28
|
const [material, setMaterial] = useState(contentObservation || "");
|
|
27
29
|
const [currentObservation, setCurrentObservation] = useState(observation);
|
|
28
30
|
|
|
@@ -48,12 +50,12 @@ export const ObservationFlag = ({
|
|
|
48
50
|
document.removeEventListener("click", handleClickOutside);
|
|
49
51
|
};
|
|
50
52
|
}, [isObservationVisible]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, [isObservationVisible, handleClickOutside]);
|
|
53
|
+
// useEffect(() => {
|
|
54
|
+
// document.addEventListener("click", handleClickOutside);
|
|
55
|
+
// return () => {
|
|
56
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
57
|
+
// };
|
|
58
|
+
// }, [isObservationVisible, handleClickOutside]);
|
|
57
59
|
|
|
58
60
|
useEffect(() => {
|
|
59
61
|
setMaterial(contentObservation || "");
|
|
@@ -15,8 +15,8 @@ export const ProductNameHeader = ({
|
|
|
15
15
|
dataProduct,
|
|
16
16
|
isObservationVisible,
|
|
17
17
|
toggleObservation,
|
|
18
|
-
handleClickOutside,
|
|
19
|
-
|
|
18
|
+
// handleClickOutside,
|
|
19
|
+
hideObservation
|
|
20
20
|
}) => {
|
|
21
21
|
const typeFlag =
|
|
22
22
|
productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
@@ -36,8 +36,8 @@ export const ProductNameHeader = ({
|
|
|
36
36
|
dataProduct={dataProduct}
|
|
37
37
|
isObservationVisible ={isObservationVisible}
|
|
38
38
|
toggleObservation = {toggleObservation}
|
|
39
|
-
handleClickOutside = {handleClickOutside}
|
|
40
|
-
|
|
39
|
+
// handleClickOutside = {handleClickOutside}
|
|
40
|
+
hideObservation={hideObservation}
|
|
41
41
|
/>
|
|
42
42
|
<ScreenHeader headerType={"date-header"} text={date} />
|
|
43
43
|
</Container>
|
|
@@ -20,8 +20,8 @@ export const FullProductNameHeader = ({
|
|
|
20
20
|
productObservation,
|
|
21
21
|
isObservationVisible,
|
|
22
22
|
toggleObservation,
|
|
23
|
-
handleClickOutside,
|
|
24
|
-
|
|
23
|
+
// handleClickOutside,
|
|
24
|
+
hideObservation
|
|
25
25
|
}) => {
|
|
26
26
|
const [retailers, setRetailers] = useState([]);
|
|
27
27
|
|
|
@@ -62,8 +62,8 @@ export const FullProductNameHeader = ({
|
|
|
62
62
|
dataProduct={headerData}
|
|
63
63
|
isObservationVisible ={isObservationVisible}
|
|
64
64
|
toggleObservation = {toggleObservation}
|
|
65
|
-
handleClickOutside ={handleClickOutside}
|
|
66
|
-
|
|
65
|
+
// handleClickOutside ={handleClickOutside}
|
|
66
|
+
hideObservation={hideObservation}
|
|
67
67
|
|
|
68
68
|
/>
|
|
69
69
|
<div className="features-bar-container">
|
|
@@ -236,22 +236,22 @@ export const RetailerProductEdition = ({
|
|
|
236
236
|
const toggleObservation = () => {
|
|
237
237
|
setObservationVisible(!isObservationVisible);
|
|
238
238
|
};
|
|
239
|
-
const handleClickOutside = (event) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}, [isObservationVisible]);
|
|
239
|
+
// const handleClickOutside = (event) => {
|
|
240
|
+
// if (
|
|
241
|
+
// isObservationVisible &&
|
|
242
|
+
// !event.target.closest(".Observation") &&
|
|
243
|
+
// !event.target.closest(".Container")
|
|
244
|
+
// ) {
|
|
245
|
+
// hideObservation();
|
|
246
|
+
// }
|
|
247
|
+
// };
|
|
248
|
+
|
|
249
|
+
// useEffect(() => {
|
|
250
|
+
// document.addEventListener("click", handleClickOutside);
|
|
251
|
+
// return () => {
|
|
252
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
253
|
+
// };
|
|
254
|
+
// }, [isObservationVisible]);
|
|
255
255
|
|
|
256
256
|
const hideObservation = () => {
|
|
257
257
|
setObservationVisible(false);
|
|
@@ -1390,8 +1390,8 @@ export const RetailerProductEdition = ({
|
|
|
1390
1390
|
}}
|
|
1391
1391
|
isObservationVisible={isObservationVisible}
|
|
1392
1392
|
toggleObservation={toggleObservation}
|
|
1393
|
-
handleClickOutside={handleClickOutside}
|
|
1394
|
-
|
|
1393
|
+
// handleClickOutside={handleClickOutside}
|
|
1394
|
+
hideObservation={hideObservation}
|
|
1395
1395
|
/>
|
|
1396
1396
|
<FullTabsMenu
|
|
1397
1397
|
tabsSections={tabsSections}
|