contentoh-components-library 21.4.95 → 21.4.97

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.
@@ -44,40 +44,34 @@ var ObservationFlag = function ObservationFlag(_ref) {
44
44
 
45
45
  var observation = _ref.observation,
46
46
  contentObservation = _ref.contentObservation,
47
- dataProduct = _ref.dataProduct;
48
- 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);
47
+ dataProduct = _ref.dataProduct,
48
+ isObservationVisible = _ref.isObservationVisible,
49
+ toggleObservation = _ref.toggleObservation;
50
+ 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);
49
51
 
50
- var _useState = (0, _react.useState)(false),
52
+ var _useState = (0, _react.useState)(contentObservation || ""),
51
53
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
52
- isObservationVisible = _useState2[0],
53
- setObservationVisible = _useState2[1];
54
+ material = _useState2[0],
55
+ setMaterial = _useState2[1];
54
56
 
55
- var _useState3 = (0, _react.useState)(contentObservation || ""),
57
+ var _useState3 = (0, _react.useState)(observation),
56
58
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
57
- material = _useState4[0],
58
- setMaterial = _useState4[1];
59
+ currentObservation = _useState4[0],
60
+ setCurrentObservation = _useState4[1];
59
61
 
60
- var _useState5 = (0, _react.useState)(observation),
62
+ var _useState5 = (0, _react.useState)(false),
61
63
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
62
- currentObservation = _useState6[0],
63
- setCurrentObservation = _useState6[1];
64
+ showModal = _useState6[0],
65
+ setShowModal = _useState6[1];
64
66
 
65
- var _useState7 = (0, _react.useState)(false),
67
+ var _useState7 = (0, _react.useState)({}),
66
68
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
67
- showModal = _useState8[0],
68
- setShowModal = _useState8[1];
69
+ modalData = _useState8[0],
70
+ setModalData = _useState8[1];
69
71
 
70
- var _useState9 = (0, _react.useState)({}),
71
- _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
72
- modalData = _useState10[0],
73
- setModalData = _useState10[1];
74
-
75
- var textareaRef = (0, _react.useRef)(null);
76
-
77
- var toggleObservation = function toggleObservation() {
78
- console.log("VENTANA");
79
- setObservationVisible(!isObservationVisible);
80
- };
72
+ var textareaRef = (0, _react.useRef)(null); // const toggleObservation = () => {
73
+ // setObservationVisible(!isObservationVisible);
74
+ // };
81
75
 
82
76
  (0, _react.useEffect)(function () {
83
77
  var handleClickOutside = function handleClickOutside(event) {
@@ -17,7 +17,7 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
17
17
 
18
18
  exports.Container = Container;
19
19
 
20
- var Observation = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n /* height: 100%;\n width: 100%; */\n"])));
20
+ var Observation = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n /* height: 100%;\n width: 100%; */\n z-index: 10000;\n"])));
21
21
 
22
22
  exports.Observation = Observation;
23
23
 
@@ -26,7 +26,9 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
26
26
  date = _ref.date,
27
27
  percentRequired = _ref.percentRequired,
28
28
  productObservation = _ref.productObservation,
29
- dataProduct = _ref.dataProduct;
29
+ dataProduct = _ref.dataProduct,
30
+ isObservationVisible = _ref.isObservationVisible,
31
+ toggleObservation = _ref.toggleObservation;
30
32
  var typeFlag = productObservation !== null && productObservation !== "" ? "high" : "low";
31
33
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
32
34
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
@@ -41,7 +43,9 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
41
43
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.ObservationFlag, {
42
44
  observation: typeFlag,
43
45
  contentObservation: productObservation,
44
- dataProduct: dataProduct
46
+ dataProduct: dataProduct,
47
+ isObservationVisible: isObservationVisible,
48
+ toggleObservation: toggleObservation
45
49
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
46
50
  headerType: "date-header",
47
51
  text: date
@@ -35,7 +35,9 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
35
35
  rejectAll = _ref.rejectAll,
36
36
  servicesData = _ref.servicesData,
37
37
  showApproveRejectAll = _ref.showApproveRejectAll,
38
- productObservation = _ref.productObservation;
38
+ productObservation = _ref.productObservation,
39
+ isObservationVisible = _ref.isObservationVisible,
40
+ toggleObservation = _ref.toggleObservation;
39
41
 
40
42
  var _useState = (0, _react.useState)([]),
41
43
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -71,7 +73,9 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
71
73
  priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
72
74
  productObservation: productObservation,
73
75
  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)),
74
- dataProduct: headerData
76
+ dataProduct: headerData,
77
+ isObservationVisible: isObservationVisible,
78
+ toggleObservation: toggleObservation
75
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
76
80
  className: "features-bar-container",
77
81
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FeaturesBar.FeaturesBar, {
@@ -507,6 +507,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
507
507
  imag = _useState92[0],
508
508
  setImag = _useState92[1];
509
509
 
510
+ var _useState93 = (0, _react.useState)(false),
511
+ _useState94 = (0, _slicedToArray2.default)(_useState93, 2),
512
+ isObservationVisible = _useState94[0],
513
+ setObservationVisible = _useState94[1];
514
+
515
+ var toggleObservation = function toggleObservation() {
516
+ setObservationVisible(!isObservationVisible);
517
+ };
518
+
510
519
  (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
511
520
  var _ref3, id_article;
512
521
 
@@ -2022,7 +2031,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2022
2031
  rejectAll: function rejectAll() {
2023
2032
  setShowRejectModal(true);
2024
2033
  setValRejAll(true);
2025
- }
2034
+ },
2035
+ isObservationVisible: isObservationVisible,
2036
+ toggleObservation: toggleObservation
2026
2037
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
2027
2038
  tabsSections: tabsSections,
2028
2039
  status: retailerStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.95",
3
+ "version": "21.4.97",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -13,6 +13,7 @@ export const ObservationFlag = ({
13
13
  observation,
14
14
  contentObservation,
15
15
  dataProduct,
16
+ isObservationVisible, toggleObservation,
16
17
  }) => {
17
18
  const PriorityFlags = {
18
19
  ["none"]: without,
@@ -21,7 +22,7 @@ export const ObservationFlag = ({
21
22
  ["high"]: high,
22
23
  };
23
24
 
24
- const [isObservationVisible, setObservationVisible] = useState(false);
25
+ // const [isObservationVisible, setObservationVisible] = useState(false);
25
26
  const [material, setMaterial] = useState(contentObservation || "");
26
27
  const [currentObservation, setCurrentObservation] = useState(observation);
27
28
 
@@ -29,10 +30,9 @@ export const ObservationFlag = ({
29
30
  const [modalData, setModalData] = useState({});
30
31
 
31
32
  const textareaRef = useRef(null);
32
- const toggleObservation = () => {
33
- console.log("VENTANA");
34
- setObservationVisible(!isObservationVisible);
35
- };
33
+ // const toggleObservation = () => {
34
+ // setObservationVisible(!isObservationVisible);
35
+ // };
36
36
  useEffect(() => {
37
37
  const handleClickOutside = (event) => {
38
38
  if (
@@ -9,6 +9,7 @@ export const Observation = styled.div`
9
9
  position: relative;
10
10
  /* height: 100%;
11
11
  width: 100%; */
12
+ z-index: 10000;
12
13
  `;
13
14
 
14
15
  export const Content = styled.div`
@@ -13,6 +13,8 @@ export const ProductNameHeader = ({
13
13
  percentRequired,
14
14
  productObservation,
15
15
  dataProduct,
16
+ isObservationVisible,
17
+ toggleObservation
16
18
  }) => {
17
19
  const typeFlag =
18
20
  productObservation !== null && productObservation !== "" ? "high" : "low";
@@ -30,6 +32,8 @@ export const ProductNameHeader = ({
30
32
  observation={typeFlag}
31
33
  contentObservation={productObservation}
32
34
  dataProduct={dataProduct}
35
+ isObservationVisible ={isObservationVisible}
36
+ toggleObservation = {toggleObservation}
33
37
  />
34
38
  <ScreenHeader headerType={"date-header"} text={date} />
35
39
  </Container>
@@ -18,6 +18,8 @@ export const FullProductNameHeader = ({
18
18
  servicesData,
19
19
  showApproveRejectAll,
20
20
  productObservation,
21
+ isObservationVisible,
22
+ toggleObservation
21
23
  }) => {
22
24
  const [retailers, setRetailers] = useState([]);
23
25
 
@@ -56,6 +58,8 @@ export const FullProductNameHeader = ({
56
58
  productObservation={productObservation}
57
59
  date={getTime(headerData?.article?.timestamp || headerData?.timestamp)}
58
60
  dataProduct={headerData}
61
+ isObservationVisible ={isObservationVisible}
62
+ toggleObservation = {toggleObservation}
59
63
  />
60
64
  <div className="features-bar-container">
61
65
  <FeaturesBar
@@ -231,6 +231,13 @@ export const RetailerProductEdition = ({
231
231
  const [fich, setFich] = useState([]);
232
232
  const [imag, setImag] = useState([]);
233
233
 
234
+ const [isObservationVisible, setObservationVisible] = useState(false);
235
+
236
+ const toggleObservation = () => {
237
+ setObservationVisible(!isObservationVisible);
238
+ };
239
+
240
+
234
241
  useEffect(async () => {
235
242
  const { id_article } = product?.article || {};
236
243
  if (id_article)
@@ -1362,6 +1369,8 @@ export const RetailerProductEdition = ({
1362
1369
  setShowRejectModal(true);
1363
1370
  setValRejAll(true);
1364
1371
  }}
1372
+ isObservationVisible={isObservationVisible}
1373
+ toggleObservation={toggleObservation}
1365
1374
  />
1366
1375
  <FullTabsMenu
1367
1376
  tabsSections={tabsSections}