contentoh-components-library 21.4.42 → 21.4.45

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.
@@ -22,6 +22,7 @@ var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
24
  var BoxAttribute = function BoxAttribute(props) {
25
+ // console.log({ props });
25
26
  var id = props.id,
26
27
  key = props.key,
27
28
  className = props.className,
@@ -42,7 +43,13 @@ var BoxAttribute = function BoxAttribute(props) {
42
43
  });
43
44
  };
44
45
 
45
- console.log(atributos);
46
+ var formattedData = Object.keys(atributos).reduce(function (result, id) {
47
+ result["box".concat(id)] = atributos[id];
48
+ return result;
49
+ }, {}); //escucha los cambios
50
+
51
+ console.log(formattedData);
52
+ console.log("atributos id", atributos[props.id]);
46
53
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
47
54
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
48
55
  id: id,
@@ -76,8 +83,9 @@ var BoxAttribute = function BoxAttribute(props) {
76
83
  onChange: handleInputChange,
77
84
  className: "caja-borde",
78
85
  variant: "outlined",
79
- size: "small"
80
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
86
+ size: "small",
87
+ type: "number"
88
+ }, props.id) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
81
89
  hiddenLabel: true,
82
90
  name: props.id,
83
91
  value: atributos[props.id],
@@ -85,8 +93,9 @@ var BoxAttribute = function BoxAttribute(props) {
85
93
  className: "caja-borde",
86
94
  variant: "outlined",
87
95
  size: "small",
96
+ type: "number",
88
97
  disabled: true
89
- })]
98
+ }, props.id)]
90
99
  }, key)
91
100
  });
92
101
  };
@@ -17,8 +17,11 @@ var BoxButtons = function BoxButtons(_ref) {
17
17
  onDelete = _ref.onDelete,
18
18
  isTheFirstBox = _ref.isTheFirstBox,
19
19
  onToggleEdit = _ref.onToggleEdit,
20
- isEditEnabled = _ref.isEditEnabled;
20
+ isEditEnabled = _ref.isEditEnabled,
21
+ index = _ref.index;
22
+ console.log("index", index);
21
23
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
24
+ index: index,
22
25
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
23
26
  variant: "outlined",
24
27
  className: "button-circle",
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.Box = void 0;
11
11
 
12
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
13
+
12
14
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
13
15
 
14
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
@@ -25,7 +27,9 @@ var _BoxButtons = require("../../molecules/BoxButtons");
25
27
 
26
28
  var _jsxRuntime = require("react/jsx-runtime");
27
29
 
28
- var Box = function Box() {
30
+ var Box = function Box(_ref) {
31
+ var onChange = _ref.onChange;
32
+
29
33
  var _useState = (0, _react.useState)(true),
30
34
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
31
35
  isDeleteDisabled = _useState2[0],
@@ -37,7 +41,8 @@ var Box = function Box() {
37
41
  setIsEditEnabled = _useState4[1];
38
42
 
39
43
  var _useState5 = (0, _react.useState)([{
40
- showAdd: true
44
+ showAdd: true,
45
+ value: {}
41
46
  }]),
42
47
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
43
48
  boxOnboardingList = _useState6[0],
@@ -64,6 +69,11 @@ var Box = function Box() {
64
69
  setIsEditEnabled(!isEditEnabled);
65
70
  };
66
71
 
72
+ (0, _react.useEffect)(function () {
73
+ onChange && onChange(boxOnboardingList);
74
+ }, [boxOnboardingList]); // console.log(atributos)
75
+
76
+ console.log("onboardinglist", boxOnboardingList);
67
77
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
68
78
  fontFamily: _variables.FontFamily.Raleway,
69
79
  color: _variables.GlobalColors.original_magenta,
@@ -77,8 +87,22 @@ var Box = function Box() {
77
87
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
78
88
  className: "container-buttons",
79
89
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxOnboarding.BoxOnboarding, {
90
+ index: index,
80
91
  showAdd: boxOnboarding.showAdd,
81
- isEditEnabled: isEditEnabled
92
+ isEditEnabled: isEditEnabled,
93
+ onChange: function onChange(e) {
94
+ setBoxOnboardingList(function (prev) {
95
+ return prev.map(function (box, i) {
96
+ if (i != index) {
97
+ return box;
98
+ }
99
+
100
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, box), {}, {
101
+ value: e
102
+ });
103
+ });
104
+ });
105
+ }
82
106
  }, index), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxButtons.BoxButtons, {
83
107
  showAdd: boxOnboarding.showAdd,
84
108
  onAdd: handleAddBoxOnboarding,
@@ -21,7 +21,9 @@ var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  var BoxOnboarding = function BoxOnboarding(_ref) {
23
23
  var panelColor = _ref.panelColor,
24
- isEditEnabled = _ref.isEditEnabled;
24
+ isEditEnabled = _ref.isEditEnabled,
25
+ index = _ref.index,
26
+ onChange = _ref.onChange;
25
27
 
26
28
  var _useState = (0, _react.useState)(true),
27
29
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -38,22 +40,25 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
38
40
  atributos = _useState4[0],
39
41
  setAtributos = _useState4[1];
40
42
 
43
+ (0, _react.useEffect)(function () {
44
+ onChange && onChange(atributos);
45
+ }, [atributos]);
41
46
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
42
47
  panelColor: panelColor,
43
48
  fontFamily: _variables.FontFamily.Raleway,
44
49
  color: _variables.GlobalColors.original_magenta,
45
50
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
46
51
  id: "contenedor-caja",
47
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
52
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
48
53
  fontFamily: _variables.FontFamily.Raleway,
49
- children: "Caja 1, chica"
54
+ children: ["Caja ", index + 1, ", chica"]
50
55
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
51
56
  id: "largo",
52
57
  borderType: "rectangle",
53
58
  className: "caja",
54
59
  text: "Largo",
55
60
  isEditEnabled: isEditEnabled,
56
- atributos: atributos,
61
+ atributos: atributos.largo,
57
62
  setAtributos: setAtributos
58
63
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
59
64
  id: "alto",
@@ -61,7 +66,7 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
61
66
  className: "caja",
62
67
  text: "Alto",
63
68
  isEditEnabled: isEditEnabled,
64
- atributos: atributos,
69
+ atributos: atributos.alto,
65
70
  setAtributos: setAtributos
66
71
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
67
72
  id: "ancho",
@@ -69,7 +74,7 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
69
74
  className: "caja",
70
75
  text: "Ancho",
71
76
  isEditEnabled: isEditEnabled,
72
- atributos: atributos,
77
+ atributos: atributos.ancho,
73
78
  setAtributos: setAtributos
74
79
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
75
80
  id: "peso",
@@ -77,7 +82,7 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
77
82
  className: "caja",
78
83
  text: "Peso",
79
84
  isEditEnabled: isEditEnabled,
80
- atributos: atributos,
85
+ atributos: atributos.peso,
81
86
  setAtributos: setAtributos
82
87
  })]
83
88
  })
@@ -19,6 +19,8 @@ var _BoxOnboarding = require("../BoxOnboarding");
19
19
 
20
20
  var _Box = require("../Box");
21
21
 
22
+ var _react = require("react");
23
+
22
24
  var _jsxRuntime = require("react/jsx-runtime");
23
25
 
24
26
  var InputGroup = function InputGroup(_ref) {
@@ -42,7 +44,9 @@ var InputGroup = function InputGroup(_ref) {
42
44
  compare = _ref.compare,
43
45
  _ref$groupData = _ref.groupData,
44
46
  groupData = _ref$groupData === void 0 ? [] : _ref$groupData,
45
- isShowbox = _ref.isShowbox;
47
+ isShowbox = _ref.isShowbox,
48
+ index = _ref.index,
49
+ setUpdatedBoxData = _ref.setUpdatedBoxData;
46
50
  console.log('groupData: ', (0, _typeof2.default)(groupData));
47
51
  console.log('groupData: ', groupData);
48
52
 
@@ -132,7 +136,9 @@ var InputGroup = function InputGroup(_ref) {
132
136
  })]
133
137
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
134
138
  className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
135
- children: isShowbox && isOnboarding && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {})
139
+ children: isShowbox && isOnboarding && index == 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {
140
+ onChange: setUpdatedBoxData
141
+ })
136
142
  })]
137
143
  });
138
144
  };
@@ -99,6 +99,8 @@ var _Modal = require("../../organisms/Modal");
99
99
 
100
100
  var _ButtonV = require("../../atoms/ButtonV2");
101
101
 
102
+ var _Box = require("../../organisms/Box");
103
+
102
104
  var _jsxRuntime = require("react/jsx-runtime");
103
105
 
104
106
  var reducerImages = function reducerImages(state, action) {
@@ -270,6 +272,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
270
272
  showModal = _useState14[0],
271
273
  setShowModal = _useState14[1];
272
274
 
275
+ var _useState15 = (0, _react.useState)(),
276
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
277
+ boxData = _useState16[0],
278
+ setBoxData = _useState16[1];
279
+
273
280
  var _useDropzone = (0, _reactDropzone.useDropzone)({
274
281
  accept: "image/*",
275
282
  noKeyboard: true,
@@ -332,146 +339,146 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
332
339
  getRootProps = _useDropzone.getRootProps,
333
340
  getInputProps = _useDropzone.getInputProps;
334
341
 
335
- var _useState15 = (0, _react.useState)([]),
336
- _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
337
- updatedDatasheets = _useState16[0],
338
- setUpdatedDatasheets = _useState16[1];
339
-
340
342
  var _useState17 = (0, _react.useState)([]),
341
343
  _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
342
- updatedDescriptions = _useState18[0],
343
- setUpdatedDescriptions = _useState18[1];
344
+ updatedDatasheets = _useState18[0],
345
+ setUpdatedDatasheets = _useState18[1];
344
346
 
345
- var _useState19 = (0, _react.useState)(false),
347
+ var _useState19 = (0, _react.useState)([]),
346
348
  _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
347
- imagesUploaded = _useState20[0],
348
- setImagesUploaded = _useState20[1];
349
+ updatedDescriptions = _useState20[0],
350
+ setUpdatedDescriptions = _useState20[1];
349
351
 
350
- var _useState21 = (0, _react.useState)(),
352
+ var _useState21 = (0, _react.useState)(false),
351
353
  _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
352
- dataImages = _useState22[0],
353
- setDataImages = _useState22[1];
354
+ imagesUploaded = _useState22[0],
355
+ setImagesUploaded = _useState22[1];
354
356
 
355
- var _useState23 = (0, _react.useState)(product !== null && product !== void 0 && product.retailers ? new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
357
+ var _useState23 = (0, _react.useState)(),
358
+ _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
359
+ dataImages = _useState24[0],
360
+ setDataImages = _useState24[1];
361
+
362
+ var _useState25 = (0, _react.useState)(product !== null && product !== void 0 && product.retailers ? new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
356
363
  percentage: 0
357
364
  }) : new Array(product === null || product === void 0 ? void 0 : (_product$retailersAva = product.retailersAvailable) === null || _product$retailersAva === void 0 ? void 0 : _product$retailersAva.length).fill({
358
365
  percentage: 0
359
366
  })),
360
- _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
361
- percentages = _useState24[0],
362
- setPercentages = _useState24[1];
363
-
364
- var _useState25 = (0, _react.useState)(0),
365
367
  _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
366
- activePercentage = _useState26[0],
367
- setActivePercentage = _useState26[1];
368
+ percentages = _useState26[0],
369
+ setPercentages = _useState26[1];
368
370
 
369
- var _useState27 = (0, _react.useState)({}),
371
+ var _useState27 = (0, _react.useState)(0),
370
372
  _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
371
- activeRetailer = _useState28[0],
372
- setActiveRetailer = _useState28[1];
373
+ activePercentage = _useState28[0],
374
+ setActivePercentage = _useState28[1];
373
375
 
374
- var _useState29 = (0, _react.useState)([]),
376
+ var _useState29 = (0, _react.useState)({}),
375
377
  _useState30 = (0, _slicedToArray2.default)(_useState29, 2),
376
- services = _useState30[0],
377
- setServices = _useState30[1];
378
+ activeRetailer = _useState30[0],
379
+ setActiveRetailer = _useState30[1];
378
380
 
379
381
  var _useState31 = (0, _react.useState)([]),
380
382
  _useState32 = (0, _slicedToArray2.default)(_useState31, 2),
381
- servicesData = _useState32[0],
382
- setServicesData = _useState32[1];
383
+ services = _useState32[0],
384
+ setServices = _useState32[1];
383
385
 
384
- var _useState33 = (0, _react.useState)(""),
386
+ var _useState33 = (0, _react.useState)([]),
385
387
  _useState34 = (0, _slicedToArray2.default)(_useState33, 2),
386
- message = _useState34[0],
387
- setMessage = _useState34[1];
388
+ servicesData = _useState34[0],
389
+ setServicesData = _useState34[1];
388
390
 
389
- var _useState35 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
391
+ var _useState35 = (0, _react.useState)(""),
390
392
  _useState36 = (0, _slicedToArray2.default)(_useState35, 2),
391
- product = _useState36[0],
392
- setProduct = _useState36[1];
393
+ message = _useState36[0],
394
+ setMessage = _useState36[1];
393
395
 
394
- var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productEdit")) ? JSON.parse(sessionStorage.getItem("productEdit")) : productToEdit),
396
+ var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
395
397
  _useState38 = (0, _slicedToArray2.default)(_useState37, 2),
396
- productEdit = _useState38[0],
397
- setProductEdit = _useState38[1];
398
+ product = _useState38[0],
399
+ setProduct = _useState38[1];
398
400
 
399
- var _useState39 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
401
+ var _useState39 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productEdit")) ? JSON.parse(sessionStorage.getItem("productEdit")) : productToEdit),
400
402
  _useState40 = (0, _slicedToArray2.default)(_useState39, 2),
401
- version = _useState40[0],
402
- setVersion = _useState40[1];
403
+ productEdit = _useState40[0],
404
+ setProductEdit = _useState40[1];
403
405
 
404
- var _useState41 = (0, _react.useState)({}),
405
- _useState42 = (0, _slicedToArray2.default)(_useState41, 1),
406
- comments = _useState42[0];
406
+ var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
407
+ _useState42 = (0, _slicedToArray2.default)(_useState41, 2),
408
+ version = _useState42[0],
409
+ setVersion = _useState42[1];
407
410
 
408
- var _useState43 = (0, _react.useState)(""),
409
- _useState44 = (0, _slicedToArray2.default)(_useState43, 2),
410
- comment = _useState44[0],
411
- setComment = _useState44[1];
411
+ var _useState43 = (0, _react.useState)({}),
412
+ _useState44 = (0, _slicedToArray2.default)(_useState43, 1),
413
+ comments = _useState44[0];
412
414
 
413
- var _useState45 = (0, _react.useState)(false),
415
+ var _useState45 = (0, _react.useState)(""),
414
416
  _useState46 = (0, _slicedToArray2.default)(_useState45, 2),
415
- crossComment = _useState46[0],
416
- setCrossComment = _useState46[1];
417
+ comment = _useState46[0],
418
+ setComment = _useState46[1];
417
419
 
418
- var _useState47 = (0, _react.useState)([]),
420
+ var _useState47 = (0, _react.useState)(false),
419
421
  _useState48 = (0, _slicedToArray2.default)(_useState47, 2),
420
- userGroups = _useState48[0],
421
- setUserGroups = _useState48[1];
422
+ crossComment = _useState48[0],
423
+ setCrossComment = _useState48[1];
422
424
 
423
- var _useState49 = (0, _react.useState)({}),
425
+ var _useState49 = (0, _react.useState)([]),
424
426
  _useState50 = (0, _slicedToArray2.default)(_useState49, 2),
425
- assig = _useState50[0],
426
- setAssig = _useState50[1];
427
+ userGroups = _useState50[0],
428
+ setUserGroups = _useState50[1];
427
429
 
428
- var _useState51 = (0, _react.useState)([]),
430
+ var _useState51 = (0, _react.useState)({}),
429
431
  _useState52 = (0, _slicedToArray2.default)(_useState51, 2),
430
- selectedImages = _useState52[0],
431
- setSelectedImages = _useState52[1];
432
+ assig = _useState52[0],
433
+ setAssig = _useState52[1];
432
434
 
433
435
  var _useState53 = (0, _react.useState)([]),
434
436
  _useState54 = (0, _slicedToArray2.default)(_useState53, 2),
435
- componentsArray = _useState54[0],
436
- setComponentsArray = _useState54[1];
437
+ selectedImages = _useState54[0],
438
+ setSelectedImages = _useState54[1];
437
439
 
438
- var _useState55 = (0, _react.useState)(false),
440
+ var _useState55 = (0, _react.useState)([]),
439
441
  _useState56 = (0, _slicedToArray2.default)(_useState55, 2),
440
- checkAll = _useState56[0],
441
- setCheckAll = _useState56[1];
442
+ componentsArray = _useState56[0],
443
+ setComponentsArray = _useState56[1];
442
444
 
443
- var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
444
-
445
- var _useState57 = (0, _react.useState)(true),
445
+ var _useState57 = (0, _react.useState)(false),
446
446
  _useState58 = (0, _slicedToArray2.default)(_useState57, 2),
447
- loading = _useState58[0],
448
- setLoading = _useState58[1];
447
+ checkAll = _useState58[0],
448
+ setCheckAll = _useState58[1];
449
449
 
450
- var _useState59 = (0, _react.useState)(false),
450
+ var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
451
+
452
+ var _useState59 = (0, _react.useState)(true),
451
453
  _useState60 = (0, _slicedToArray2.default)(_useState59, 2),
452
- validatedAll = _useState60[0],
453
- setValidatedAll = _useState60[1];
454
+ loading = _useState60[0],
455
+ setLoading = _useState60[1];
454
456
 
455
457
  var _useState61 = (0, _react.useState)(false),
456
458
  _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
457
- showRejectModal = _useState62[0],
458
- setShowRejectModal = _useState62[1];
459
+ validatedAll = _useState62[0],
460
+ setValidatedAll = _useState62[1];
459
461
 
460
- var _useState63 = (0, _react.useState)({
462
+ var _useState63 = (0, _react.useState)(false),
463
+ _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
464
+ showRejectModal = _useState64[0],
465
+ setShowRejectModal = _useState64[1];
466
+
467
+ var _useState65 = (0, _react.useState)({
461
468
  "Ficha técnica": null,
462
469
  Descripción: null,
463
470
  Imágenes: null
464
471
  }),
465
- _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
466
- origin = _useState64[0],
467
- setOrigin = _useState64[1];
468
-
469
- var _useState65 = (0, _react.useState)(false),
470
472
  _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
471
- inCart = _useState66[0],
472
- setInCart = _useState66[1];
473
+ origin = _useState66[0],
474
+ setOrigin = _useState66[1];
475
+
476
+ var _useState67 = (0, _react.useState)(false),
477
+ _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
478
+ inCart = _useState68[0],
479
+ setInCart = _useState68[1];
473
480
 
474
- var _useState67 = (0, _react.useState)({
481
+ var _useState69 = (0, _react.useState)({
475
482
  message: "¿Estás seguro de continuar?",
476
483
  detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
477
484
  button1: {
@@ -486,34 +493,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
486
493
  },
487
494
  img: _defaultProfileImage.default
488
495
  }),
489
- _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
490
- dataGenericModal = _useState68[0],
491
- setDataGenericModal = _useState68[1];
492
-
493
- var _useState69 = (0, _react.useState)(null),
494
496
  _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
495
- socketType = _useState70[0],
496
- setSocketType = _useState70[1];
497
+ dataGenericModal = _useState70[0],
498
+ setDataGenericModal = _useState70[1];
497
499
 
498
- var _useState71 = (0, _react.useState)(loading),
500
+ var _useState71 = (0, _react.useState)(null),
499
501
  _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
500
- saving = _useState72[0],
501
- setSaving = _useState72[1];
502
+ socketType = _useState72[0],
503
+ setSocketType = _useState72[1];
502
504
 
503
- var _useState73 = (0, _react.useState)(product.statusByRetailer),
505
+ var _useState73 = (0, _react.useState)(loading),
504
506
  _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
505
- retailerStatus = _useState74[0],
506
- setRetailerStatus = _useState74[1];
507
+ saving = _useState74[0],
508
+ setSaving = _useState74[1];
509
+
510
+ var _useState75 = (0, _react.useState)(product.statusByRetailer),
511
+ _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
512
+ retailerStatus = _useState76[0],
513
+ setRetailerStatus = _useState76[1];
507
514
 
508
515
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
509
516
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
510
517
  showVersionSelector = _useCloseModal2[0],
511
518
  setShowVersionSelector = _useCloseModal2[1];
512
519
 
513
- var _useState75 = (0, _react.useState)(),
514
- _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
515
- globalModal = _useState76[0],
516
- setGlobalModal = _useState76[1];
520
+ var _useState77 = (0, _react.useState)(),
521
+ _useState78 = (0, _slicedToArray2.default)(_useState77, 2),
522
+ globalModal = _useState78[0],
523
+ setGlobalModal = _useState78[1];
517
524
 
518
525
  var updateAuditStatus = /*#__PURE__*/function () {
519
526
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
@@ -1220,45 +1227,50 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1220
1227
  setLoading(true);
1221
1228
  dataObject = {
1222
1229
  articleId: product === null || product === void 0 ? void 0 : product.id_article,
1223
- articleData: updatedDatasheets
1230
+ articleData: updatedDatasheets,
1231
+ boxData: boxData
1224
1232
  };
1233
+ console.log("boxData guardado", boxData);
1225
1234
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
1226
- _context12.prev = 3;
1227
- _context12.next = 6;
1235
+ _context12.prev = 4;
1236
+ _context12.next = 7;
1228
1237
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
1229
1238
  headers: {
1230
1239
  Authorization: token
1231
1240
  }
1232
1241
  });
1233
1242
 
1234
- case 6:
1243
+ case 7:
1235
1244
  res = _context12.sent;
1236
1245
 
1237
1246
  if (!(res.data.statusCode === 200)) {
1238
- _context12.next = 12;
1247
+ _context12.next = 13;
1239
1248
  break;
1240
1249
  }
1241
1250
 
1242
1251
  setUpdatedDatasheets([]);
1243
1252
  setMessage("Fichas técnicas guardadas");
1244
- _context12.next = 12;
1253
+ _context12.next = 13;
1245
1254
  return loadData();
1246
1255
 
1247
- case 12:
1248
- _context12.next = 17;
1256
+ case 13:
1257
+ _context12.next = 18;
1249
1258
  break;
1250
1259
 
1251
- case 14:
1252
- _context12.prev = 14;
1253
- _context12.t0 = _context12["catch"](3);
1260
+ case 15:
1261
+ _context12.prev = 15;
1262
+ _context12.t0 = _context12["catch"](4);
1254
1263
  console.log(_context12.t0);
1255
1264
 
1256
- case 17:
1265
+ case 18:
1266
+ console.log(dataObject);
1267
+
1268
+ case 19:
1257
1269
  case "end":
1258
1270
  return _context12.stop();
1259
1271
  }
1260
1272
  }
1261
- }, _callee12, null, [[3, 14]]);
1273
+ }, _callee12, null, [[4, 15]]);
1262
1274
  }));
1263
1275
 
1264
1276
  return function saveDatasheets() {
@@ -2188,19 +2200,25 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2188
2200
  setSelectedImages: setSelectedImages,
2189
2201
  checkAll: checkAll,
2190
2202
  setCheckAll: setCheckAll
2191
- }), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
2192
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
2193
- articleId: product.id_article,
2194
- version: version,
2195
- activeSection: activeTab,
2196
- inputGroup: dataGroup,
2197
- dataInputs: datasheets[1],
2198
- updatedDatasheets: updatedDatasheets,
2199
- setUpdatedDatasheets: setUpdatedDatasheets,
2200
- isShowbox: true,
2201
- groupData: services[0][activeRetailer.id].data //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
2202
-
2203
- }, index + "-" + activeRetailer.name);
2203
+ }), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2204
+ children: (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
2205
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
2206
+ articleId: product.id_article,
2207
+ version: version,
2208
+ activeSection: activeTab,
2209
+ inputGroup: dataGroup,
2210
+ dataInputs: datasheets[1],
2211
+ updatedDatasheets: updatedDatasheets,
2212
+ setUpdatedDatasheets: setUpdatedDatasheets,
2213
+ isShowbox: true,
2214
+ groupData: services[0][activeRetailer.id].data,
2215
+ setUpdatedBoxData: function setUpdatedBoxData(e) {
2216
+ setBoxData(e);
2217
+ },
2218
+ index: index //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
2219
+
2220
+ }, index + "-" + activeRetailer.name);
2221
+ })
2204
2222
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
2205
2223
  text: "No cuentas con este servicio",
2206
2224
  headerType: "input-name-header"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.42",
3
+ "version": "21.4.45",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",