contentoh-components-library 21.3.97 → 21.3.99

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 (32) hide show
  1. package/dist/components/atoms/RetailerCatalog/index.js +4 -4
  2. package/dist/components/atoms/RetailersList/index.js +3 -1
  3. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +1 -0
  4. package/dist/components/atoms/UserCatalog/index.js +23 -9
  5. package/dist/components/atoms/UserOption/index.js +49 -2
  6. package/dist/components/atoms/UserOption/styles.js +1 -1
  7. package/dist/components/atoms/UserSelector/index.js +13 -4
  8. package/dist/components/molecules/GridItem/index.js +4 -3
  9. package/dist/components/molecules/GridItem/styles.js +1 -1
  10. package/dist/components/molecules/HeaderItem/styles.js +1 -1
  11. package/dist/components/molecules/RowItem/index.js +1 -1
  12. package/dist/components/organisms/GridProducts/GridProducts.stories.js +7 -3
  13. package/dist/components/organisms/GridProducts/index.js +1 -6
  14. package/dist/components/organisms/GridProducts/utils.js +6 -2
  15. package/dist/index.js +72 -59
  16. package/package.json +1 -1
  17. package/src/components/atoms/RetailerCatalog/index.js +3 -4
  18. package/src/components/atoms/RetailersList/index.js +2 -2
  19. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +1 -0
  20. package/src/components/atoms/UserCatalog/index.js +21 -2
  21. package/src/components/atoms/UserOption/index.js +40 -1
  22. package/src/components/atoms/UserOption/styles.js +8 -1
  23. package/src/components/atoms/UserSelector/index.js +22 -4
  24. package/src/components/molecules/GridItem/index.js +2 -1
  25. package/src/components/molecules/GridItem/styles.js +1 -1
  26. package/src/components/molecules/HeaderItem/styles.js +2 -0
  27. package/src/components/molecules/RowItem/index.js +1 -1
  28. package/src/components/organisms/GridProducts/GridProducts.stories.js +14 -3
  29. package/src/components/organisms/GridProducts/index.js +1 -4
  30. package/src/components/organisms/GridProducts/utils.js +5 -1
  31. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  32. package/src/index.js +1 -0
@@ -5,13 +5,18 @@ import { Avatar } from "../Avatar";
5
5
  import { getProfilePicture } from "../../../global-files/data";
6
6
  import { useState } from "react";
7
7
  import { useEffect } from "react";
8
+ import { useCloseModal } from "../../../global-files/customHooks";
8
9
 
9
10
  export const UserSelector = ({
10
11
  searchLabel,
11
- index,
12
12
  usersArray,
13
- onClick,
14
13
  position,
14
+ id,
15
+ onAssign,
16
+ product,
17
+ assignationTarget,
18
+ target,
19
+ concept,
15
20
  }) => {
16
21
  const [text, setText] = useState([]);
17
22
  const [userFiltered, setUsersFiltered] = useState([]);
@@ -33,7 +38,7 @@ export const UserSelector = ({
33
38
  };
34
39
 
35
40
  return (
36
- <Container position={position}>
41
+ <Container position={position} id={id}>
37
42
  <div className="search-cotainer">
38
43
  <Icon icon={faSearch} />
39
44
  <input
@@ -48,7 +53,20 @@ export const UserSelector = ({
48
53
  <div className="selector-container">
49
54
  {userFiltered.length ? (
50
55
  userFiltered.map((user) => (
51
- <div key={user.id_user} className="user-item" onClick={onClick}>
56
+ <div
57
+ key={user.id_user}
58
+ className="user-item"
59
+ onClick={(e) =>
60
+ onAssign &&
61
+ onAssign(
62
+ product,
63
+ user.id_user,
64
+ assignationTarget,
65
+ target,
66
+ concept
67
+ )
68
+ }
69
+ >
52
70
  <Avatar
53
71
  image={getProfilePicture(user.id_user, 26, 26)}
54
72
  altText={"profile image"}
@@ -16,11 +16,12 @@ export const GridItem = ({
16
16
  chkOnChange,
17
17
  onGridClick,
18
18
  chkChecked,
19
+ index,
19
20
  }) => {
20
21
  const { images = [], info = [], status = [], catalogs = {} } = gridElement;
21
22
 
22
23
  return (
23
- <Container onClick={() => onGridClick && onGridClick(product)}>
24
+ <Container onClick={(e) => onGridClick && onGridClick(e, product, index)}>
24
25
  <div className="chk-container" onClick={(e) => e.stopPropagation()}>
25
26
  <CheckBox
26
27
  id={id}
@@ -10,7 +10,7 @@ export const Container = styled.div`
10
10
  position: absolute;
11
11
  top: 5px;
12
12
  left: 5px;
13
- z-index: 10;
13
+ z-index: 5;
14
14
  height: 16px;
15
15
  }
16
16
 
@@ -4,6 +4,8 @@ import { FontFamily } from "../../../global-files/variables";
4
4
  export const Container = styled.div`
5
5
  background-color: #f0f0f0;
6
6
  display: flex;
7
+ width: 100%;
8
+ min-width: fit-content;
7
9
 
8
10
  .chk-global-container {
9
11
  display: flex;
@@ -14,7 +14,7 @@ export const RowItem = ({
14
14
  <div
15
15
  className="row-container"
16
16
  key={article?.id_article + "-" + article?.id_order}
17
- onClick={(e) => onGridClick && onGridClick(product)}
17
+ onClick={(e) => onGridClick && onGridClick(e, product, i)}
18
18
  >
19
19
  <div
20
20
  className="chk-container"
@@ -5409,6 +5409,16 @@ const setSelected = (arr) => {
5409
5409
  selected = arr;
5410
5410
  };
5411
5411
 
5412
+ const onAssign = (
5413
+ productData,
5414
+ assigneeID,
5415
+ assignationTarget,
5416
+ concept,
5417
+ target
5418
+ ) => {
5419
+ console.log(productData, assigneeID, assignationTarget, concept, target);
5420
+ };
5421
+
5412
5422
  GridProductsDefault.args = {
5413
5423
  gridView: false,
5414
5424
  selected,
@@ -5418,7 +5428,8 @@ GridProductsDefault.args = {
5418
5428
  textSpecialists,
5419
5429
  imagesSpecialists,
5420
5430
  auditors,
5421
- images
5431
+ images,
5432
+ onAssign
5422
5433
  ),
5423
5434
  images,
5424
5435
  auditors,
@@ -5460,8 +5471,8 @@ GridProductsDefault.args = {
5460
5471
  );
5461
5472
  return productSelected?.length > 0;
5462
5473
  },
5463
- onGridClick: (e) => {
5464
- console.log(e);
5474
+ onGridClick: (e, product, i) => {
5475
+ if (!e.target.closest("[id^=users]")) console.log(product, i);
5465
5476
  },
5466
5477
  chkCheckedAll: () => {
5467
5478
  return selected.length === products.length;
@@ -1,11 +1,7 @@
1
1
  import { Container } from "./styles";
2
2
  import { GridItem } from "../../molecules/GridItem";
3
3
  import { HeaderItem } from "../../molecules/HeaderItem";
4
- import { getProductsToTable } from "./utils";
5
- import { useEffect } from "react";
6
- import { useState } from "react";
7
4
  import { RowItem } from "../../molecules/RowItem";
8
- import { CheckBox } from "../../atoms/CheckBox";
9
5
 
10
6
  export const GridProducts = ({
11
7
  products = [],
@@ -25,6 +21,7 @@ export const GridProducts = ({
25
21
  <GridItem
26
22
  key={i}
27
23
  id={id}
24
+ index={i}
28
25
  product={product}
29
26
  gridElement={gridElement}
30
27
  chkOnChange={chkOnChange}
@@ -6,7 +6,8 @@ export const getProductsToTable = (
6
6
  textSpecialists,
7
7
  imagesSpecialists,
8
8
  auditors,
9
- images
9
+ images,
10
+ onAssign
10
11
  ) => {
11
12
  const productsTableArray = [];
12
13
 
@@ -45,6 +46,7 @@ export const getProductsToTable = (
45
46
  imagesSpecialists={imagesSpecialists}
46
47
  auditors={auditors}
47
48
  id={"users-" + id}
49
+ product={product}
48
50
  />
49
51
  ),
50
52
  flex: 1,
@@ -87,6 +89,8 @@ export const getProductsToTable = (
87
89
  imagesSpecialists={imagesSpecialists}
88
90
  auditors={auditors}
89
91
  id={"users-" + id}
92
+ onAssign={onAssign}
93
+ product={product}
90
94
  />
91
95
  ),
92
96
  },
@@ -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
  ),
package/src/index.js CHANGED
@@ -39,6 +39,7 @@ export * from "./components/atoms/UserSelector/index";
39
39
  export * from "./components/atoms/ImageCarousel/index";
40
40
  export * from "./components/atoms/RetailersList/index";
41
41
  export * from "./components/atoms/RetailerOption/index";
42
+ export * from "./components/atoms/RetailerCatalog/index";
42
43
 
43
44
  //molecules
44
45
  export * from "./components/molecules/AvatarAndValidation/index";