contentoh-components-library 21.4.4 → 21.4.6

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.
Files changed (98) hide show
  1. package/dist/components/atoms/Avatar/index.js +3 -2
  2. package/dist/components/atoms/CheckBox/index.js +4 -1
  3. package/dist/components/atoms/CheckBox/styles.js +1 -1
  4. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
  5. package/dist/components/atoms/ImageCarousel/index.js +120 -0
  6. package/dist/components/atoms/ImageCarousel/styles.js +18 -0
  7. package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
  8. package/dist/components/atoms/PercentTag/index.js +23 -0
  9. package/dist/components/atoms/PercentTag/styles.js +22 -0
  10. package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
  11. package/dist/components/atoms/RatingStars/index.js +53 -0
  12. package/dist/components/atoms/RatingStars/styles.js +18 -0
  13. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
  14. package/dist/components/atoms/RetailerCatalog/index.js +69 -0
  15. package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
  16. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
  17. package/dist/components/atoms/RetailerOption/index.js +62 -0
  18. package/dist/components/atoms/RetailerOption/styles.js +20 -0
  19. package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
  20. package/dist/components/atoms/RetailersList/index.js +46 -0
  21. package/dist/components/atoms/RetailersList/styles.js +18 -0
  22. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +73 -0
  23. package/dist/components/atoms/UserCatalog/index.js +101 -0
  24. package/dist/components/atoms/UserCatalog/styles.js +18 -0
  25. package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
  26. package/dist/components/atoms/UserOption/index.js +130 -0
  27. package/dist/components/atoms/UserOption/styles.js +20 -0
  28. package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
  29. package/dist/components/atoms/UserSelector/index.js +98 -0
  30. package/dist/components/atoms/UserSelector/styles.js +32 -0
  31. package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
  32. package/dist/components/molecules/GridItem/index.js +143 -0
  33. package/dist/components/molecules/GridItem/styles.js +20 -0
  34. package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
  35. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
  36. package/dist/components/molecules/HeaderItem/index.js +42 -0
  37. package/dist/components/molecules/HeaderItem/styles.js +30 -0
  38. package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
  39. package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
  40. package/dist/components/molecules/RowItem/index.js +58 -0
  41. package/dist/components/molecules/RowItem/styles.js +30 -0
  42. package/dist/components/organisms/GridProducts/GridProducts.stories.js +5097 -0
  43. package/dist/components/organisms/GridProducts/index.js +63 -0
  44. package/dist/components/organisms/GridProducts/styles.js +18 -0
  45. package/dist/components/organisms/GridProducts/utils.js +149 -0
  46. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -28
  47. package/dist/components/pages/RetailerProductEdition/index.js +23 -0
  48. package/dist/index.js +201 -58
  49. package/package.json +2 -1
  50. package/src/components/atoms/Avatar/index.js +8 -2
  51. package/src/components/atoms/CheckBox/index.js +2 -1
  52. package/src/components/atoms/CheckBox/styles.js +2 -0
  53. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
  54. package/src/components/atoms/ImageCarousel/index.js +103 -0
  55. package/src/components/atoms/ImageCarousel/styles.js +79 -0
  56. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
  57. package/src/components/atoms/PercentTag/index.js +9 -0
  58. package/src/components/atoms/PercentTag/styles.js +69 -0
  59. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
  60. package/src/components/atoms/RatingStars/index.js +31 -0
  61. package/src/components/atoms/RatingStars/styles.js +28 -0
  62. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
  63. package/src/components/atoms/RetailerCatalog/index.js +49 -0
  64. package/src/components/atoms/RetailerCatalog/styles.js +30 -0
  65. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
  66. package/src/components/atoms/RetailerOption/index.js +53 -0
  67. package/src/components/atoms/RetailerOption/styles.js +41 -0
  68. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
  69. package/src/components/atoms/RetailersList/index.js +20 -0
  70. package/src/components/atoms/RetailersList/styles.js +19 -0
  71. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
  72. package/src/components/atoms/UserCatalog/index.js +94 -0
  73. package/src/components/atoms/UserCatalog/styles.js +24 -0
  74. package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
  75. package/src/components/atoms/UserOption/index.js +95 -0
  76. package/src/components/atoms/UserOption/styles.js +61 -0
  77. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
  78. package/src/components/atoms/UserSelector/index.js +86 -0
  79. package/src/components/atoms/UserSelector/styles.js +55 -0
  80. package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
  81. package/src/components/molecules/GridItem/index.js +97 -0
  82. package/src/components/molecules/GridItem/styles.js +104 -0
  83. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
  84. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
  85. package/src/components/molecules/HeaderItem/index.js +26 -0
  86. package/src/components/molecules/HeaderItem/styles.js +27 -0
  87. package/src/components/molecules/RowItem/ColumnItem.js +9 -0
  88. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
  89. package/src/components/molecules/RowItem/index.js +45 -0
  90. package/src/components/molecules/RowItem/styles.js +40 -0
  91. package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
  92. package/src/components/organisms/GridProducts/index.js +50 -0
  93. package/src/components/organisms/GridProducts/styles.js +15 -0
  94. package/src/components/organisms/GridProducts/utils.js +111 -0
  95. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  96. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +39 -21
  97. package/src/components/pages/RetailerProductEdition/index.js +12 -0
  98. package/src/index.js +12 -0
@@ -0,0 +1,50 @@
1
+ import { Container } from "./styles";
2
+ import { GridItem } from "../../molecules/GridItem";
3
+ import { HeaderItem } from "../../molecules/HeaderItem";
4
+ import { RowItem } from "../../molecules/RowItem";
5
+
6
+ export const GridProducts = ({
7
+ products = [],
8
+ columnsArray = [],
9
+ gridView = true,
10
+ chkOnChange,
11
+ selected = [],
12
+ chkChecked,
13
+ checkAll,
14
+ chkCheckedAll,
15
+ onGridClick,
16
+ }) => {
17
+ return (
18
+ <Container>
19
+ {!gridView ? (
20
+ products?.map(({ gridElement, product, id }, i) => (
21
+ <GridItem
22
+ key={i}
23
+ id={id}
24
+ index={i}
25
+ product={product}
26
+ gridElement={gridElement}
27
+ chkOnChange={chkOnChange}
28
+ onGridClick={onGridClick}
29
+ selected={selected}
30
+ chkChecked={chkChecked}
31
+ />
32
+ ))
33
+ ) : (
34
+ <div className="table-view">
35
+ <HeaderItem
36
+ columnsArray={columnsArray}
37
+ checkAll={checkAll}
38
+ chkCheckedAll={chkCheckedAll}
39
+ />
40
+ <RowItem
41
+ productsArray={products}
42
+ chkOnChange={chkOnChange}
43
+ onGridClick={onGridClick}
44
+ chkChecked={chkChecked}
45
+ />
46
+ </div>
47
+ )}
48
+ </Container>
49
+ );
50
+ };
@@ -0,0 +1,15 @@
1
+ import styled from "styled-components";
2
+
3
+ export const Container = styled.div`
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ gap: 10px;
7
+ height: 100%;
8
+ overflow: auto;
9
+ padding: 20px;
10
+
11
+ .table-view {
12
+ height: 100%;
13
+ width: 100%;
14
+ }
15
+ `;
@@ -0,0 +1,111 @@
1
+ import { RetailerCatalog } from "../../atoms/RetailerCatalog";
2
+ import { UserCatalog } from "../../atoms/UserCatalog";
3
+
4
+ export const getProductsToTable = (
5
+ products = [],
6
+ textSpecialists,
7
+ imagesSpecialists,
8
+ auditors,
9
+ images,
10
+ onAssign
11
+ ) => {
12
+ const productsTableArray = [];
13
+
14
+ products.forEach((product) => {
15
+ const { article, orderId, upc, status, version } = product;
16
+ const id = article?.id_article + "-" + orderId;
17
+ const imgArray = images[article?.id_article + "-" + version];
18
+ const element = {
19
+ id,
20
+ cols: [
21
+ { name: article?.country || "-", flex: 1, minWidth: 100 },
22
+ { name: orderId || "-", flex: 1, minWidth: 100 },
23
+ { name: upc || "-", flex: 1, minWidth: 100 },
24
+ { name: article?.name || "-", flex: 1, minWidth: 200 },
25
+ { name: "S/M" || "-", flex: 1, minWidth: 100 },
26
+ { name: status || "-", flex: 1, minWidth: 100 },
27
+ {
28
+ name: (
29
+ <RetailerCatalog
30
+ id={"retailers-" + id}
31
+ article={product}
32
+ retailers={product.retailers}
33
+ />
34
+ ),
35
+ flex: 1,
36
+ minWidth: 100,
37
+ },
38
+ { name: product.prio, flex: 1, minWidth: 100 },
39
+ {
40
+ name: (
41
+ <UserCatalog
42
+ datasheet={article.id_datasheet_especialist}
43
+ description={article.id_description_especialist}
44
+ images={article.id_images_especialist}
45
+ auditor={article.id_auditor}
46
+ textSpecialists={textSpecialists}
47
+ imagesSpecialists={imagesSpecialists}
48
+ auditors={auditors}
49
+ id={"users-" + id}
50
+ product={product}
51
+ onAssign={onAssign}
52
+ />
53
+ ),
54
+ flex: 1,
55
+ minWidth: 100,
56
+ },
57
+ { name: "Cont.", flex: 1, minWidth: 100 },
58
+ ],
59
+ gridElement: {
60
+ images: imgArray,
61
+ info: [
62
+ { title: "name", value: article?.name || "-" },
63
+ { title: "order", value: orderId || "-" },
64
+ { title: "category", value: article?.category || "-" },
65
+ { title: "company", value: article?.company_name || "-" },
66
+ { title: "price", value: article?.price || "-" },
67
+ ],
68
+ status: [
69
+ { title: "datasheet", value: product?.datasheet_status, percent: 80 },
70
+ {
71
+ title: "description",
72
+ value: product?.description_status,
73
+ percent: 80,
74
+ },
75
+ { title: "images", value: product?.images_status, percent: 80 },
76
+ ],
77
+ catalogs: {
78
+ leftSide: (
79
+ <RetailerCatalog
80
+ id={"retailers-" + id}
81
+ limit={2}
82
+ article={product}
83
+ retailers={product.retailers}
84
+ />
85
+ ),
86
+ rightSide: (
87
+ <UserCatalog
88
+ datasheet={article.id_datasheet_especialist}
89
+ description={article.id_description_especialist}
90
+ images={article.id_images_especialist}
91
+ auditor={article.id_auditor}
92
+ textSpecialists={textSpecialists}
93
+ imagesSpecialists={imagesSpecialists}
94
+ auditors={auditors}
95
+ id={"users-" + id}
96
+ product={product}
97
+ onAssign={onAssign}
98
+ />
99
+ ),
100
+ },
101
+ },
102
+ showBottom: true,
103
+ product,
104
+ article,
105
+ };
106
+
107
+ productsTableArray.push(element);
108
+ });
109
+
110
+ return productsTableArray;
111
+ };
@@ -1,41 +1,31 @@
1
1
  export const servicesCodeIcon = {
2
2
  datasheet: (
3
3
  <div key="datasheet" className="tooltip">
4
- <span className="material-icons small">
5
- &#xf8ee;
6
- </span>
4
+ <span className="material-icons small">&#xf8ee;</span>
7
5
  <span className="tooltiptext">Ficha Técnica</span>
8
6
  </div>
9
7
  ),
10
8
  description: (
11
9
  <div key="description" className="tooltip">
12
- <span className="material-icons small">
13
- &#xe873;
14
- </span>
10
+ <span className="material-icons small">&#xe873;</span>
15
11
  <span className="tooltiptext">Descripción</span>
16
12
  </div>
17
13
  ),
18
14
  image: (
19
15
  <div key="image" className="tooltip">
20
- <span className="material-icons small">
21
- &#xe3f4;
22
- </span>
16
+ <span className="material-icons small">&#xe3f4;</span>
23
17
  <span className="tooltiptext">Imagen</span>
24
18
  </div>
25
19
  ),
26
20
  translate: (
27
21
  <div key="translate" className="tooltip">
28
- <span className="material-icons small">
29
- &#xe8e2;
30
- </span>
22
+ <span className="material-icons small">&#xe8e2;</span>
31
23
  <span className="tooltiptext">Traducción</span>
32
24
  </div>
33
25
  ),
34
26
  build: (
35
- <div key="build" className="tooltip">
36
- <span className="material-icons small">
37
- &#xe1bd;
38
- </span>
27
+ <div key="build" className="tooltip">
28
+ <span className="material-icons small">&#xe1bd;</span>
39
29
  <span className="tooltiptext">Construcción</span>
40
30
  </div>
41
31
  ),
@@ -52,32 +52,50 @@ RetailerProductEditionDefault.args = {
52
52
  images: "RA/AC",
53
53
  },
54
54
  },
55
+ orderId: 15209,
56
+ status: "ACA",
57
+ datasheet_status: "ACA",
58
+ prio: "none",
59
+ version: 3,
60
+ description_status: "ACA",
61
+ images_status: "ACA",
62
+ statusByRetailer: {
63
+ 70: {
64
+ datasheet: "ACA",
65
+ description: "ACA",
66
+ images: "ACA",
67
+ },
68
+ },
55
69
  article: {
56
- category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
57
- company_name: "Demo",
70
+ id_article: 39390,
71
+ id_category: "4311",
72
+ name: "test demo 1",
73
+ upc: "2312312313",
74
+ timestamp: "2023-05-12T20:07:42.000Z",
75
+ id_user: 133,
76
+ status: "NULL",
77
+ active: 1,
78
+ company_id: 912,
79
+ company_name: "GRUPO BRAHMA",
58
80
  country: "México",
59
- id_category: "2366",
60
- id_datasheet_especialist: null,
61
- id_datasheet_facilitator: null,
62
- id_description_especialist: null,
63
- id_description_facilitator: null,
64
- id_images_especialist: null,
65
- id_images_facilitator: null,
66
- id_order: 15160,
67
- id_article: 39290,
68
- id_auditor: 37,
69
- name: "MOLDURA MARCO MODER 11X4X244 CM",
70
- timestamp: "2023-04-19T21:36:02.000Z",
71
- upc: "100030",
81
+ id_order: 15209,
82
+ id_datasheet_especialist: 232,
83
+ id_datasheet_facilitator: 52,
84
+ id_description_especialist: 232,
85
+ id_description_facilitator: 52,
86
+ id_images_especialist: 196,
87
+ id_images_facilitator: 53,
88
+ id_auditor: 195,
89
+ id_recepcionist: null,
90
+ category: "Ropa Interior Dama|Ropa Interior|Ropa Interior",
91
+ missingAttributes: 0,
92
+ missingDescriptions: 0,
93
+ missingImages: 0,
72
94
  },
73
95
  retailers: [
74
96
  {
75
- id: 58,
76
- name: "The Home Depot Golden",
77
- },
78
- {
79
- id: 68,
80
- name: "The Home Depot Merchants",
97
+ id: 70,
98
+ name: "Bodega Aurrera",
81
99
  },
82
100
  ],
83
101
  },
@@ -226,6 +226,10 @@ export const RetailerProductEdition = ({
226
226
  const [compare, setCompare] = useState(false);
227
227
  const [valRejAll, setValRejAll] = useState(false);
228
228
 
229
+ const [desc, setDesc] = useState([]);
230
+ const [fich, setFich] = useState([]);
231
+ const [imag, setImag] = useState([]);
232
+
229
233
  useEffect(async () => {
230
234
  const { id_article } = product?.article || {};
231
235
  if (id_article)
@@ -567,6 +571,7 @@ export const RetailerProductEdition = ({
567
571
  active: images?.values?.some((value) => value?.image_id === e?.id),
568
572
  }));
569
573
  setSocketType(imageInputs);
574
+ console.log(images);
570
575
  }, [images]);
571
576
 
572
577
  const updateImages = useCallback(async () => {
@@ -1187,6 +1192,7 @@ export const RetailerProductEdition = ({
1187
1192
  };
1188
1193
 
1189
1194
  useEffect(() => {
1195
+ console.log(servicesData, "servicesData");
1190
1196
  let status = getRetailerStatus(servicesData, activeTab);
1191
1197
  setRetailerStatus(status);
1192
1198
  }, [activeTab, servicesData, activeRetailer]);
@@ -1351,6 +1357,12 @@ export const RetailerProductEdition = ({
1351
1357
  isRetailer={isRetailer}
1352
1358
  showSaveButton={auditorAssigned() || userAssigned()}
1353
1359
  version={version}
1360
+ desc={desc}
1361
+ setDesc={setDesc}
1362
+ fich={fich}
1363
+ setFich={setFich}
1364
+ imag={imag}
1365
+ setImag={setImag}
1354
1366
  updatedDescriptions={updatedDescriptions}
1355
1367
  setUpdatedDescriptions={setUpdatedDescriptions}
1356
1368
  updatedDatasheets={updatedDatasheets}
package/src/index.js CHANGED
@@ -33,6 +33,13 @@ export * from "./components/atoms/ImagePreview/index";
33
33
  export * from "./components/atoms/InputText/index";
34
34
  export * from "./components/atoms/NotFound/index";
35
35
  export * from "./components/atoms/Tooltip/index";
36
+ export * from "./components/atoms/UserOption/index";
37
+ export * from "./components/atoms/UserCatalog/index";
38
+ export * from "./components/atoms/UserSelector/index";
39
+ export * from "./components/atoms/ImageCarousel/index";
40
+ export * from "./components/atoms/RetailersList/index";
41
+ export * from "./components/atoms/RetailerOption/index";
42
+ export * from "./components/atoms/RetailerCatalog/index";
36
43
 
37
44
  //molecules
38
45
  export * from "./components/molecules/AvatarAndValidation/index";
@@ -65,6 +72,10 @@ export * from "./components/molecules/SelectV2/index";
65
72
  export * from "./components/molecules/Dropdown/index";
66
73
  export * from "./components/molecules/StripeCardForm/index";
67
74
  export * from "./components/molecules/StripeCardSelector/index";
75
+ export * from "./components/molecules/GridItem/index";
76
+ export * from "./components/molecules/HeaderItem/index";
77
+ export * from "./components/molecules/RowItem/index";
78
+ export * from "./components/molecules/RetailerSelector/index";
68
79
 
69
80
  //organisms
70
81
  export * from "./components/organisms/ChangePassword/index";
@@ -82,6 +93,7 @@ export * from "./components/organisms/OrderDetail/index";
82
93
  export * from "./components/organisms/RangeCalendar";
83
94
  export * from "./components/organisms/TableResizable";
84
95
  export * from "./components/organisms/SideModal/index";
96
+ export * from "./components/organisms/GridProducts/index";
85
97
 
86
98
  //pages
87
99
  export * from "./components/pages/ChangePasswordLogin";