contentoh-components-library 21.4.49 → 21.4.50

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.
@@ -28,10 +28,10 @@ var BoxAttribute = function BoxAttribute(props) {
28
28
  className = props.className,
29
29
  text = props.text,
30
30
  borderType = props.borderType,
31
- titletool = props.titletool,
32
- texttool = props.texttool,
33
31
  atributos = props.atributos,
34
- setAtributos = props.setAtributos;
32
+ setAtributos = props.setAtributos,
33
+ required = props.required,
34
+ description = props.description;
35
35
 
36
36
  var handleInputChange = function handleInputChange(event) {
37
37
  var _event$target = event.target,
@@ -45,7 +45,8 @@ var BoxAttribute = function BoxAttribute(props) {
45
45
  var formattedData = Object.keys(atributos).reduce(function (result, id) {
46
46
  result["box".concat(id)] = atributos[id];
47
47
  return result;
48
- }, {}); //escucha los cambios
48
+ }, {});
49
+ console.log("description", description); //escucha los cambios
49
50
  // console.log(formattedData);
50
51
  // console.log("atributos id", atributos[props.id]);
51
52
 
@@ -55,14 +56,11 @@ var BoxAttribute = function BoxAttribute(props) {
55
56
  className: className,
56
57
  borderType: borderType,
57
58
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
58
- componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
59
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
60
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
61
- children: titletool
62
- })
63
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
64
- children: texttool
65
- })]
59
+ componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
60
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
61
+ className: "tooltip-content",
62
+ children: description
63
+ })
66
64
  }),
67
65
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
68
66
  className: "",
@@ -73,8 +71,11 @@ var BoxAttribute = function BoxAttribute(props) {
73
71
  })
74
72
  }),
75
73
  classNameTooltip: "container-tooltip"
76
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
77
- children: text
74
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
75
+ children: [text, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
76
+ className: required ? 'required-text' : '',
77
+ children: required ? '*' : ''
78
+ })]
78
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
79
80
  hiddenLabel: true,
80
81
  name: props.id,
@@ -83,7 +84,8 @@ var BoxAttribute = function BoxAttribute(props) {
83
84
  className: "caja-borde",
84
85
  variant: "outlined",
85
86
  size: "small",
86
- type: "number"
87
+ type: "number",
88
+ required: required
87
89
  }, props.id)]
88
90
  }, key)
89
91
  });
@@ -15,9 +15,11 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n gap:4px;\n #atr-alto {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .caja-borde {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n border-radius: ", ";\n }\n span {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n font-weight: 600;\n }\n .icon {\n width: 8px;\n height: 8px;\n }\n"])), _variables.FontFamily.RobotoMedium, function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n gap:4px;\n #atr-alto {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .caja-borde {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n border-radius: ", ";\n }\n span {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n font-weight: 600;\n }\n .icon {\n width: 8px;\n height: 8px;\n }\n .required-text {\n color: red;\n }\n\n .container-tooltip{\n background-color: ", ";\n width: fit-content;\n height: 27px;\n padding: 4px;\n border-radius: 15px;\n font-family: ", ";\n font-weight: 600;\n font-size: 14px;\n line-height: 19px;\n color: ", ";\n }\n \n"])), _variables.FontFamily.RobotoMedium, function (_ref) {
19
19
  var borderType = _ref.borderType;
20
20
  return (borderType === null || borderType === void 0 ? void 0 : borderType.toLowerCase()) === "rectangle" ? "5px" : (borderType === null || borderType === void 0 ? void 0 : borderType.toLowerCase()) === "circle" ? "50%" : "none";
21
- }, _variables.FontFamily.RobotoMedium);
21
+ }, _variables.FontFamily.RobotoMedium, _variables.GlobalColors.s3, _variables.FontFamily.AvenirNext, function (backgroundColor) {
22
+ return backgroundColor === "s2" || backgroundColor === "s1" ? _variables.GlobalColors.s4 : _variables.GlobalColors.white;
23
+ });
22
24
 
23
25
  exports.Container = Container;
@@ -16,10 +16,7 @@ var BoxButtons = function BoxButtons(_ref) {
16
16
  onAdd = _ref.onAdd,
17
17
  onDelete = _ref.onDelete,
18
18
  isTheFirstBox = _ref.isTheFirstBox,
19
- onToggleEdit = _ref.onToggleEdit,
20
- isEditEnabled = _ref.isEditEnabled,
21
19
  index = _ref.index;
22
- console.log("index", index);
23
20
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
24
21
  index: index,
25
22
  children: [!isTheFirstBox && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
@@ -51,8 +51,8 @@ var Box = function Box(_ref) {
51
51
  setBoxOnboardingList = _useState6[1];
52
52
 
53
53
  (0, _react.useEffect)(function () {
54
- // console.log("dataInputs:", dataInputs);
55
- // console.log("inputGroup:", inputGroup);
54
+ console.log("dataInputs:", dataInputs);
55
+ console.log("inputGroup:", inputGroup);
56
56
  var temp = {};
57
57
  var maxBoxId = 0;
58
58
  inputGroup.inputs.forEach(function (attrId) {
@@ -58,13 +58,15 @@ var BoxOnboarding = /*#__PURE__*/(0, _react.memo)(function (_ref) {
58
58
  fontFamily: _variables.FontFamily.Raleway,
59
59
  children: ["Caja ", index + 1]
60
60
  }), inputs.map(function (attrId) {
61
- var _dataInputs$attrId;
61
+ var _dataInputs$attrId, _dataInputs$attrId2, _dataInputs$attrId3;
62
62
 
63
63
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
64
64
  id: attrId,
65
65
  borderType: "rectangle",
66
66
  className: "caja",
67
67
  text: (_dataInputs$attrId = dataInputs[attrId]) === null || _dataInputs$attrId === void 0 ? void 0 : _dataInputs$attrId.name,
68
+ required: (_dataInputs$attrId2 = dataInputs[attrId]) === null || _dataInputs$attrId2 === void 0 ? void 0 : _dataInputs$attrId2.required,
69
+ description: (_dataInputs$attrId3 = dataInputs[attrId]) === null || _dataInputs$attrId3 === void 0 ? void 0 : _dataInputs$attrId3.description,
68
70
  atributos: atributos,
69
71
  setAtributos: setAtributos
70
72
  }, attrId);
@@ -73,7 +73,6 @@ var InputGroup = function InputGroup(_ref) {
73
73
 
74
74
  var isEquals = function isEquals(dataInputsVal, auditInputsVal) {
75
75
  var result = dataInputsVal === auditInputsVal;
76
- console.log("Input Val", dataInputsVal);
77
76
  return result;
78
77
  };
79
78
 
@@ -82,7 +81,7 @@ var InputGroup = function InputGroup(_ref) {
82
81
  className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
83
82
  children: [(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
84
83
  headerType: "retailer-name-header",
85
- text: "".concat(inputGroup.groupId, " - ").concat(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup)
84
+ text: "".concat(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup)
86
85
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
87
86
  className: "inputs-container",
88
87
  children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs = inputGroup.inputs) === null || _inputGroup$inputs === void 0 ? void 0 : _inputGroup$inputs.map(function (input, index) {
@@ -1090,7 +1090,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1090
1090
 
1091
1091
  if ((_services$0$activeRet = services[0][activeRetailer.id]) !== null && _services$0$activeRet !== void 0 && _services$0$activeRet.data) services[0][activeRetailer.id].data = Object.values(services[0][activeRetailer.id].data);
1092
1092
  setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
1093
- console.log("loadInputs: ", services[0]);
1094
1093
  var datagroups = services[0][activeRetailer.id];
1095
1094
  var inputs = (_services$2 = services[0]) === null || _services$2 === void 0 ? void 0 : _services$2.inputs;
1096
1095
 
@@ -2228,7 +2227,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2228
2227
  isShowbox: true,
2229
2228
  groupData: services[0][activeRetailer.id].data,
2230
2229
  setUpdatedBoxData: function setUpdatedBoxData(e) {
2231
- console.log("UNO", e);
2232
2230
  setBoxData(e);
2233
2231
  },
2234
2232
  index: index //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.49",
3
+ "version": "21.4.50",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -11,10 +11,10 @@ export const BoxAttribute = (props) => {
11
11
  className,
12
12
  text,
13
13
  borderType,
14
- titletool,
15
- texttool,
16
14
  atributos,
17
15
  setAtributos,
16
+ required,
17
+ description,
18
18
  } = props;
19
19
  const handleInputChange = (event) => {
20
20
  const { name, value } = event.target;
@@ -28,6 +28,7 @@ export const BoxAttribute = (props) => {
28
28
  result[`box${id}`] = atributos[id];
29
29
  return result;
30
30
  }, {});
31
+ console.log("description",description)
31
32
  //escucha los cambios
32
33
  // console.log(formattedData);
33
34
  // console.log("atributos id", atributos[props.id]);
@@ -42,10 +43,7 @@ export const BoxAttribute = (props) => {
42
43
  <Tooltip
43
44
  componentTooltip={
44
45
  <>
45
- <p>
46
- <b>{titletool}</b>
47
- </p>
48
- <p>{texttool}</p>
46
+ <p className="tooltip-content">{description}</p>
49
47
  </>
50
48
  }
51
49
  children={
@@ -55,7 +53,7 @@ export const BoxAttribute = (props) => {
55
53
  }
56
54
  classNameTooltip={"container-tooltip"}
57
55
  />
58
- <span>{text}</span>
56
+ <span>{text}<span className={required ? 'required-text' : ''}>{required ? '*' : ''}</span></span>
59
57
  <TextField
60
58
  hiddenLabel
61
59
  key={props.id}
@@ -66,6 +64,7 @@ export const BoxAttribute = (props) => {
66
64
  variant="outlined"
67
65
  size="small"
68
66
  type="number"
67
+ required={required}
69
68
  />
70
69
  </Container>
71
70
  </>
@@ -32,4 +32,24 @@ export const Container = styled.div`
32
32
  width: 8px;
33
33
  height: 8px;
34
34
  }
35
+ .required-text {
36
+ color: red;
37
+ }
38
+
39
+ .container-tooltip{
40
+ background-color: ${GlobalColors.s3};
41
+ width: fit-content;
42
+ height: 27px;
43
+ padding: 4px;
44
+ border-radius: 15px;
45
+ font-family: ${FontFamily.AvenirNext};
46
+ font-weight: 600;
47
+ font-size: 14px;
48
+ line-height: 19px;
49
+ color: ${(backgroundColor) =>
50
+ backgroundColor === "s2" || backgroundColor === "s1"
51
+ ? GlobalColors.s4
52
+ : GlobalColors.white};
53
+ }
54
+
35
55
  `;
@@ -1,8 +1,7 @@
1
1
  import { Container, ContainerIcon } from "./styles";
2
2
  import { Button } from "@mui/material";
3
3
 
4
- export const BoxButtons = ({ showAdd, onAdd, onDelete, isTheFirstBox, onToggleEdit, isEditEnabled, index }) => {
5
- console.log("index",index)
4
+ export const BoxButtons = ({ showAdd, onAdd, onDelete, isTheFirstBox, index }) => {
6
5
  return (
7
6
  <Container index={index}>
8
7
  {/* <Button variant="outlined" className="button-circle" onClick={onToggleEdit}>
@@ -15,8 +15,8 @@ export const Box = ({ onChange, dataInputs, inputGroup }) => {
15
15
  ]);
16
16
 
17
17
  useEffect(() => {
18
- // console.log("dataInputs:", dataInputs);
19
- // console.log("inputGroup:", inputGroup);
18
+ console.log("dataInputs:", dataInputs);
19
+ console.log("inputGroup:", inputGroup);
20
20
  const temp = {};
21
21
  let maxBoxId = 0;
22
22
  inputGroup.inputs.forEach((attrId) => {
@@ -44,6 +44,8 @@ export const BoxOnboarding = memo(
44
44
  borderType="rectangle"
45
45
  className="caja"
46
46
  text={dataInputs[attrId]?.name}
47
+ required={dataInputs[attrId]?.required}
48
+ description={dataInputs[attrId]?.description}
47
49
  atributos={atributos}
48
50
  setAtributos={setAtributos}
49
51
  />
@@ -48,7 +48,6 @@ export const InputGroup = ({
48
48
 
49
49
  const isEquals = (dataInputsVal, auditInputsVal) => {
50
50
  const result = dataInputsVal === auditInputsVal;
51
- console.log("Input Val",dataInputsVal)
52
51
  return result;
53
52
  };
54
53
  return inputGroup.groupId !== "16" ? (
@@ -63,7 +62,7 @@ export const InputGroup = ({
63
62
  {inputGroup?.dataGroup && (
64
63
  <ScreenHeader
65
64
  headerType={"retailer-name-header"}
66
- text={`${inputGroup.groupId} - ${inputGroup?.dataGroup}`}
65
+ text={`${inputGroup?.dataGroup}`}
67
66
  />
68
67
  )}
69
68
  <div className="inputs-container">
@@ -598,7 +598,6 @@ export const ProviderProductEdition = ({
598
598
  );
599
599
  setActivePercentage(Math.round(activeRetailer?.percentage, 0));
600
600
 
601
- console.log("loadInputs: ", services[0]);
602
601
  const datagroups = services[0][activeRetailer.id];
603
602
  const inputs = services[0]?.inputs;
604
603
  const descriptions = services[1]?.filter(
@@ -1487,7 +1486,6 @@ export const ProviderProductEdition = ({
1487
1486
  isShowbox={true}
1488
1487
  groupData={services[0][activeRetailer.id].data}
1489
1488
  setUpdatedBoxData={(e) => {
1490
- console.log("UNO",e);
1491
1489
  setBoxData(e);
1492
1490
  }}
1493
1491
  index={index}