contentoh-components-library 21.6.18 → 21.6.19
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/molecules/TagAndInput/index.js +14 -1
- package/dist/components/organisms/InputGroup/index.js +23 -17
- package/dist/components/pages/ProductEditionv2/index.js +3 -0
- package/dist/components/pages/ProviderProductEdition/index.js +3 -2
- package/package.json +1 -1
- package/src/components/molecules/TagAndInput/index.js +15 -0
- package/src/components/organisms/InputGroup/index.js +6 -0
- package/src/components/pages/ProductEditionv2/index.js +1 -0
- package/src/components/pages/ProviderProductEdition/index.js +1 -0
|
@@ -23,6 +23,8 @@ var _styles = require("./styles");
|
|
|
23
23
|
|
|
24
24
|
var _index = require("../../atoms/ScreenHeader/index");
|
|
25
25
|
|
|
26
|
+
var _InheritanceTag = require("../../atoms/InheritanceTag");
|
|
27
|
+
|
|
26
28
|
var _index2 = require("../../atoms/GeneralInput/index");
|
|
27
29
|
|
|
28
30
|
var _react = require("react");
|
|
@@ -74,7 +76,11 @@ var TagAndInput = function TagAndInput(_ref) {
|
|
|
74
76
|
onChange = _ref.onChange,
|
|
75
77
|
dataInputs = _ref.dataInputs,
|
|
76
78
|
inputGroup = _ref.inputGroup,
|
|
77
|
-
boxOnboardingData = _ref.boxOnboardingData
|
|
79
|
+
boxOnboardingData = _ref.boxOnboardingData,
|
|
80
|
+
isVariant = _ref.isVariant,
|
|
81
|
+
isOverridden = _ref.isOverridden,
|
|
82
|
+
parentUpc = _ref.parentUpc,
|
|
83
|
+
onRestoreInheritance = _ref.onRestoreInheritance;
|
|
78
84
|
|
|
79
85
|
var _useState = (0, _react.useState)(boxOnboardingData || []),
|
|
80
86
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -421,6 +427,13 @@ var TagAndInput = function TagAndInput(_ref) {
|
|
|
421
427
|
text: label,
|
|
422
428
|
headerType: "input-name-header",
|
|
423
429
|
color: color
|
|
430
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InheritanceTag.InheritanceTag, {
|
|
431
|
+
isVariant: isVariant,
|
|
432
|
+
isOverridden: isOverridden,
|
|
433
|
+
parentUpc: parentUpc,
|
|
434
|
+
onRestore: onRestoreInheritance ? function () {
|
|
435
|
+
return onRestoreInheritance(inputId);
|
|
436
|
+
} : undefined
|
|
424
437
|
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
|
|
425
438
|
componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
426
439
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -58,7 +58,9 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
58
58
|
groupData = _ref$groupData === void 0 ? [] : _ref$groupData,
|
|
59
59
|
setUpdatedBoxData = _ref.setUpdatedBoxData,
|
|
60
60
|
activeRetailer = _ref.activeRetailer,
|
|
61
|
-
updateApprovedInputs = _ref.updateApprovedInputs
|
|
61
|
+
updateApprovedInputs = _ref.updateApprovedInputs,
|
|
62
|
+
variant = _ref.variant,
|
|
63
|
+
onRestoreInheritance = _ref.onRestoreInheritance;
|
|
62
64
|
|
|
63
65
|
var InputReviewSection = function InputReviewSection(_ref2) {
|
|
64
66
|
var inputId = _ref2.inputId,
|
|
@@ -183,7 +185,7 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
183
185
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
184
186
|
className: "inputs-container",
|
|
185
187
|
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) {
|
|
186
|
-
var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _auditInputs$input, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _auditInputGroup$inpu, _auditInputGroup$inpu2;
|
|
188
|
+
var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _auditInputs$input, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _dataInputs$input24, _variant$parent, _auditInputGroup$inpu, _auditInputGroup$inpu2;
|
|
187
189
|
|
|
188
190
|
return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
189
191
|
className: ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.id) === 6700 || ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id) === 6701 ? "inputs-validation-onboarding" : "inputs-validation",
|
|
@@ -213,6 +215,10 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
213
215
|
optionList: (_dataInputs$input22 = dataInputs[input]) === null || _dataInputs$input22 === void 0 ? void 0 : _dataInputs$input22.option_list,
|
|
214
216
|
description: (_dataInputs$input23 = dataInputs[input]) === null || _dataInputs$input23 === void 0 ? void 0 : _dataInputs$input23.description,
|
|
215
217
|
showTooltip: true,
|
|
218
|
+
isVariant: variant === null || variant === void 0 ? void 0 : variant.isVariant,
|
|
219
|
+
isOverridden: (_dataInputs$input24 = dataInputs[input]) === null || _dataInputs$input24 === void 0 ? void 0 : _dataInputs$input24.isOverridden,
|
|
220
|
+
parentUpc: variant === null || variant === void 0 ? void 0 : (_variant$parent = variant.parent) === null || _variant$parent === void 0 ? void 0 : _variant$parent.upc,
|
|
221
|
+
onRestoreInheritance: onRestoreInheritance,
|
|
216
222
|
auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
|
|
217
223
|
}, index + "-" + ((_dataInputs$input10 = dataInputs[input]) === null || _dataInputs$input10 === void 0 ? void 0 : _dataInputs$input10.value) + "-" + ((_dataInputs$input11 = dataInputs[input]) === null || _dataInputs$input11 === void 0 ? void 0 : _dataInputs$input11.id) + "-" + compare)]
|
|
218
224
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -255,35 +261,35 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
255
261
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
256
262
|
className: "inputs-container",
|
|
257
263
|
children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs2 = inputGroup.inputs) === null || _inputGroup$inputs2 === void 0 ? void 0 : _inputGroup$inputs2.map(function (input, index) {
|
|
258
|
-
var _dataInputs$
|
|
264
|
+
var _dataInputs$input25, _dataInputs$input26, _dataInputs$input27, _dataInputs$input28, _dataInputs$input29, _dataInputs$input30, _dataInputs$input31, _dataInputs$input32, _dataInputs$input33, _auditInputs$input2, _dataInputs$input34, _dataInputs$input35, _dataInputs$input36, _dataInputs$input37, _dataInputs$input38, _dataInputs$input39, _dataInputs$input40, _dataInputs$input41, _dataInputs$input42, _dataInputs$input43, _dataInputs$input44, _auditInputGroup$inpu3, _auditInputGroup$inpu4;
|
|
259
265
|
|
|
260
266
|
return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
261
267
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
262
268
|
//disabled={input === 40001}
|
|
263
|
-
disabled: (_dataInputs$
|
|
264
|
-
inputId: (_dataInputs$
|
|
269
|
+
disabled: (_dataInputs$input27 = dataInputs[input]) === null || _dataInputs$input27 === void 0 ? void 0 : _dataInputs$input27.isApproved,
|
|
270
|
+
inputId: (_dataInputs$input28 = dataInputs[input]) === null || _dataInputs$input28 === void 0 ? void 0 : _dataInputs$input28.id,
|
|
265
271
|
version: version,
|
|
266
|
-
inputType: inputTypeValue((_dataInputs$
|
|
267
|
-
label: ((_dataInputs$
|
|
268
|
-
value: (_dataInputs$
|
|
272
|
+
inputType: inputTypeValue((_dataInputs$input29 = dataInputs[input]) === null || _dataInputs$input29 === void 0 ? void 0 : _dataInputs$input29.type),
|
|
273
|
+
label: ((_dataInputs$input30 = dataInputs[input]) === null || _dataInputs$input30 === void 0 ? void 0 : _dataInputs$input30.name) + ((_dataInputs$input31 = dataInputs[input]) !== null && _dataInputs$input31 !== void 0 && _dataInputs$input31.required ? "*" : ""),
|
|
274
|
+
value: (_dataInputs$input32 = dataInputs[input]) !== null && _dataInputs$input32 !== void 0 && _dataInputs$input32.box ? Object.values((_dataInputs$input33 = dataInputs[input]) === null || _dataInputs$input33 === void 0 ? void 0 : _dataInputs$input33.box)[0] : compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$input34 = dataInputs[input]) === null || _dataInputs$input34 === void 0 ? void 0 : _dataInputs$input34.value,
|
|
269
275
|
inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
|
|
270
276
|
articleId: articleId,
|
|
271
|
-
isRequired: (_dataInputs$
|
|
272
|
-
aiGenerated: (_dataInputs$
|
|
277
|
+
isRequired: (_dataInputs$input35 = dataInputs[input]) === null || _dataInputs$input35 === void 0 ? void 0 : _dataInputs$input35.required,
|
|
278
|
+
aiGenerated: (_dataInputs$input36 = dataInputs[input]) === null || _dataInputs$input36 === void 0 ? void 0 : _dataInputs$input36.ai_generated,
|
|
273
279
|
updatedDatasheets: updatedDatasheets,
|
|
274
280
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
275
|
-
maxChar: (_dataInputs$
|
|
276
|
-
optionList: (_dataInputs$
|
|
277
|
-
description: (_dataInputs$
|
|
281
|
+
maxChar: (_dataInputs$input37 = dataInputs[input]) !== null && _dataInputs$input37 !== void 0 && _dataInputs$input37.max_chars ? (_dataInputs$input38 = dataInputs[input]) === null || _dataInputs$input38 === void 0 ? void 0 : _dataInputs$input38.max_chars : 999,
|
|
282
|
+
optionList: (_dataInputs$input39 = dataInputs[input]) === null || _dataInputs$input39 === void 0 ? void 0 : _dataInputs$input39.option_list,
|
|
283
|
+
description: (_dataInputs$input40 = dataInputs[input]) === null || _dataInputs$input40 === void 0 ? void 0 : _dataInputs$input40.description,
|
|
278
284
|
showTooltip: true,
|
|
279
285
|
inputGroup: inputGroup,
|
|
280
286
|
dataInputs: dataInputs,
|
|
281
287
|
onChange: setUpdatedBoxData,
|
|
282
288
|
auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
|
|
283
|
-
}, index + "-" + ((_dataInputs$
|
|
284
|
-
inputId: (_dataInputs$
|
|
285
|
-
isApproved: (_dataInputs$
|
|
286
|
-
comment: (_dataInputs$
|
|
289
|
+
}, index + "-" + ((_dataInputs$input25 = dataInputs[input]) === null || _dataInputs$input25 === void 0 ? void 0 : _dataInputs$input25.value) + "-" + ((_dataInputs$input26 = dataInputs[input]) === null || _dataInputs$input26 === void 0 ? void 0 : _dataInputs$input26.id) + "-" + compare), ((_dataInputs$input41 = dataInputs[input]) === null || _dataInputs$input41 === void 0 ? void 0 : _dataInputs$input41.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
|
|
290
|
+
inputId: (_dataInputs$input42 = dataInputs[input]) === null || _dataInputs$input42 === void 0 ? void 0 : _dataInputs$input42.id,
|
|
291
|
+
isApproved: (_dataInputs$input43 = dataInputs[input]) === null || _dataInputs$input43 === void 0 ? void 0 : _dataInputs$input43.isApproved,
|
|
292
|
+
comment: (_dataInputs$input44 = dataInputs[input]) === null || _dataInputs$input44 === void 0 ? void 0 : _dataInputs$input44.comment,
|
|
287
293
|
handleImgClick: handleImgClick,
|
|
288
294
|
changeImageBtn: changeImageBtn,
|
|
289
295
|
showDivState: showDivStates,
|
|
@@ -2261,12 +2261,15 @@ var ProductEditionv2 = function ProductEditionv2(_ref) {
|
|
|
2261
2261
|
})]
|
|
2262
2262
|
}), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2263
2263
|
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) {
|
|
2264
|
+
var _services$6;
|
|
2265
|
+
|
|
2264
2266
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroupv.InputGroupv2, {
|
|
2265
2267
|
articleId: product.id_article,
|
|
2266
2268
|
version: version,
|
|
2267
2269
|
activeSection: activeTab,
|
|
2268
2270
|
inputGroup: dataGroup,
|
|
2269
2271
|
dataInputs: datasheets[1],
|
|
2272
|
+
variant: (_services$6 = services[0]) === null || _services$6 === void 0 ? void 0 : _services$6.variant,
|
|
2270
2273
|
updatedDatasheets: updatedDatasheets,
|
|
2271
2274
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
2272
2275
|
isShowbox: true,
|
|
@@ -1567,7 +1567,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1567
1567
|
headerType: "input-name-header"
|
|
1568
1568
|
})), state.active_tab === "Ficha técnica" && (((_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
1569
1569
|
children: ((_state$datasheets_inp = state.datasheets_inputs) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp[0]) === null || _state$datasheets_inp2 === void 0 ? void 0 : (_state$datasheets_inp3 = _state$datasheets_inp2.data) === null || _state$datasheets_inp3 === void 0 ? void 0 : _state$datasheets_inp3.length) > 0 ? state.datasheets_inputs[0].data.map(function (dataGroup, index) {
|
|
1570
|
-
var _state$datasheets_inp4, _state$services$datas;
|
|
1570
|
+
var _state$datasheets_inp4, _state$services, _state$services$datas, _state$services$datas2;
|
|
1571
1571
|
|
|
1572
1572
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1573
1573
|
index: index,
|
|
@@ -1576,8 +1576,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1576
1576
|
activeSection: state.active_tab,
|
|
1577
1577
|
inputGroup: dataGroup,
|
|
1578
1578
|
dataInputs: (_state$datasheets_inp4 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp4 !== void 0 ? _state$datasheets_inp4 : [],
|
|
1579
|
+
variant: (_state$services = state.services) === null || _state$services === void 0 ? void 0 : (_state$services$datas = _state$services.datasheets) === null || _state$services$datas === void 0 ? void 0 : _state$services$datas.variant,
|
|
1579
1580
|
activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
|
|
1580
|
-
groupData: (_state$services$
|
|
1581
|
+
groupData: (_state$services$datas2 = state.services.datasheets[state.active_retailer.id_retailer]) === null || _state$services$datas2 === void 0 ? void 0 : _state$services$datas2.data,
|
|
1581
1582
|
updatedDatasheets: state.updated_datasheets_inputs,
|
|
1582
1583
|
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
1583
1584
|
isShowbox: true,
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Container } from "./styles";
|
|
2
2
|
import { ScreenHeader } from "../../atoms/ScreenHeader/index";
|
|
3
|
+
import { InheritanceTag } from "../../atoms/InheritanceTag";
|
|
3
4
|
import { GeneralInput } from "../../atoms/GeneralInput/index";
|
|
4
5
|
import { useState, useEffect } from "react";
|
|
5
6
|
import acceptIcon from "../../../assets/images/generalButton/acceptIcon.svg";
|
|
@@ -44,6 +45,10 @@ export const TagAndInput = ({
|
|
|
44
45
|
dataInputs,
|
|
45
46
|
inputGroup,
|
|
46
47
|
boxOnboardingData,
|
|
48
|
+
isVariant,
|
|
49
|
+
isOverridden,
|
|
50
|
+
parentUpc,
|
|
51
|
+
onRestoreInheritance,
|
|
47
52
|
}) => {
|
|
48
53
|
const [boxOnboardingList, setBoxOnboardingList] = useState(
|
|
49
54
|
boxOnboardingData || []
|
|
@@ -323,6 +328,16 @@ export const TagAndInput = ({
|
|
|
323
328
|
headerType={"input-name-header"}
|
|
324
329
|
color={color}
|
|
325
330
|
/>
|
|
331
|
+
<InheritanceTag
|
|
332
|
+
isVariant={isVariant}
|
|
333
|
+
isOverridden={isOverridden}
|
|
334
|
+
parentUpc={parentUpc}
|
|
335
|
+
onRestore={
|
|
336
|
+
onRestoreInheritance
|
|
337
|
+
? () => onRestoreInheritance(inputId)
|
|
338
|
+
: undefined
|
|
339
|
+
}
|
|
340
|
+
/>
|
|
326
341
|
{description && (
|
|
327
342
|
<Tooltip
|
|
328
343
|
componentTooltip={
|
|
@@ -27,6 +27,8 @@ export const InputGroup = ({
|
|
|
27
27
|
setUpdatedBoxData,
|
|
28
28
|
activeRetailer,
|
|
29
29
|
updateApprovedInputs,
|
|
30
|
+
variant,
|
|
31
|
+
onRestoreInheritance,
|
|
30
32
|
}) => {
|
|
31
33
|
const InputReviewSection = ({
|
|
32
34
|
inputId,
|
|
@@ -230,6 +232,10 @@ export const InputGroup = ({
|
|
|
230
232
|
optionList={dataInputs[input]?.option_list}
|
|
231
233
|
description={dataInputs[input]?.description}
|
|
232
234
|
showTooltip={true}
|
|
235
|
+
isVariant={variant?.isVariant}
|
|
236
|
+
isOverridden={dataInputs[input]?.isOverridden}
|
|
237
|
+
parentUpc={variant?.parent?.upc}
|
|
238
|
+
onRestoreInheritance={onRestoreInheritance}
|
|
233
239
|
auditClass={
|
|
234
240
|
compare &&
|
|
235
241
|
!isEquals(
|
|
@@ -1504,6 +1504,7 @@ export const ProductEditionv2 = ({
|
|
|
1504
1504
|
activeSection={activeTab}
|
|
1505
1505
|
inputGroup={dataGroup}
|
|
1506
1506
|
dataInputs={datasheets[1]}
|
|
1507
|
+
variant={services[0]?.variant}
|
|
1507
1508
|
updatedDatasheets={updatedDatasheets}
|
|
1508
1509
|
setUpdatedDatasheets={setUpdatedDatasheets}
|
|
1509
1510
|
isShowbox={true}
|
|
@@ -1433,6 +1433,7 @@ const ProviderProductEditionView = ({
|
|
|
1433
1433
|
activeSection={state.active_tab}
|
|
1434
1434
|
inputGroup={dataGroup}
|
|
1435
1435
|
dataInputs={state.datasheets_inputs[1] ?? []}
|
|
1436
|
+
variant={state.services?.datasheets?.variant}
|
|
1436
1437
|
activeRetailer={
|
|
1437
1438
|
state.services.datasheets[
|
|
1438
1439
|
state.active_retailer.id_retailer
|