contentoh-components-library 21.3.91 → 21.3.92
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/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/CheckBox/index.js +4 -1
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
- package/dist/components/atoms/ImageCarousel/index.js +123 -0
- package/dist/components/atoms/ImageCarousel/styles.js +18 -0
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
- package/dist/components/atoms/PercentTag/index.js +23 -0
- package/dist/components/atoms/PercentTag/styles.js +22 -0
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
- package/dist/components/atoms/RatingStars/index.js +53 -0
- package/dist/components/atoms/RatingStars/styles.js +18 -0
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
- package/dist/components/atoms/RetailerCatalog/index.js +69 -0
- package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
- package/dist/components/atoms/RetailerOption/index.js +62 -0
- package/dist/components/atoms/RetailerOption/styles.js +20 -0
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
- package/dist/components/atoms/RetailersList/index.js +44 -0
- package/dist/components/atoms/RetailersList/styles.js +18 -0
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +72 -0
- package/dist/components/atoms/UserCatalog/index.js +89 -0
- package/dist/components/atoms/UserCatalog/styles.js +18 -0
- package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
- package/dist/components/atoms/UserOption/index.js +80 -0
- package/dist/components/atoms/UserOption/styles.js +20 -0
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
- package/dist/components/atoms/UserSelector/index.js +91 -0
- package/dist/components/atoms/UserSelector/styles.js +32 -0
- package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
- package/dist/components/molecules/GridItem/index.js +122 -0
- package/dist/components/molecules/GridItem/styles.js +20 -0
- package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
- package/dist/components/molecules/HeaderItem/index.js +42 -0
- package/dist/components/molecules/HeaderItem/styles.js +30 -0
- package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
- package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
- package/dist/components/molecules/RowItem/index.js +59 -0
- package/dist/components/molecules/RowItem/styles.js +30 -0
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +5093 -0
- package/dist/components/organisms/GridProducts/index.js +81 -0
- package/dist/components/organisms/GridProducts/styles.js +18 -0
- package/dist/components/organisms/GridProducts/utils.js +139 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -28
- package/dist/components/pages/RetailerProductEdition/index.js +23 -0
- package/dist/index.js +149 -58
- package/package.json +2 -1
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/CheckBox/index.js +2 -1
- package/src/components/atoms/CheckBox/styles.js +2 -0
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -0
- package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -0
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +66 -0
- package/src/components/atoms/UserCatalog/index.js +77 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +49 -0
- package/src/components/atoms/UserOption/styles.js +54 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +70 -0
- package/src/components/atoms/UserSelector/styles.js +55 -0
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +82 -0
- package/src/components/molecules/GridItem/styles.js +85 -0
- package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +25 -0
- package/src/components/molecules/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +38 -0
- package/src/components/organisms/GridProducts/GridProducts.stories.js +5474 -0
- package/src/components/organisms/GridProducts/index.js +59 -0
- package/src/components/organisms/GridProducts/styles.js +15 -0
- package/src/components/organisms/GridProducts/utils.js +103 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +39 -21
- package/src/components/pages/RetailerProductEdition/index.js +12 -0
- package/src/index.js +8 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RetailerOption = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
|
|
14
|
+
var _Avatar = require("../Avatar");
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
var RetailerOption = function RetailerOption(_ref) {
|
|
21
|
+
var retailer = _ref.retailer,
|
|
22
|
+
_ref$services = _ref.services,
|
|
23
|
+
services = _ref$services === void 0 ? {} : _ref$services;
|
|
24
|
+
|
|
25
|
+
var _useState = (0, _react.useState)([]),
|
|
26
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
27
|
+
service = _useState2[0],
|
|
28
|
+
setService = _useState2[1];
|
|
29
|
+
|
|
30
|
+
(0, _react.useEffect)(function () {
|
|
31
|
+
if (services[retailer.id]) {
|
|
32
|
+
setService(Object.keys(services[retailer.id]));
|
|
33
|
+
}
|
|
34
|
+
}, [services]);
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
36
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
37
|
+
className: "avatar-and-retailer",
|
|
38
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
39
|
+
image: "https://content-management-images.s3.amazonaws.com/retailers/".concat(retailer.id, ".png"),
|
|
40
|
+
altText: retailer === null || retailer === void 0 ? void 0 : retailer.name,
|
|
41
|
+
imageType: "medium-image"
|
|
42
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
43
|
+
className: "retailer-name",
|
|
44
|
+
children: retailer === null || retailer === void 0 ? void 0 : retailer.name
|
|
45
|
+
})]
|
|
46
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
47
|
+
className: "services-icons",
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
49
|
+
className: "material-icons small ".concat(service.includes("datasheet") && "is-active"),
|
|
50
|
+
children: "\uF8EE"
|
|
51
|
+
}, "datasheet"), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
52
|
+
className: "material-icons small ".concat(service.includes("description") && "is-active"),
|
|
53
|
+
children: "\uE873"
|
|
54
|
+
}, "description"), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
55
|
+
className: "material-icons small ".concat(service.includes("images") && "is-active"),
|
|
56
|
+
children: "\uE3F4"
|
|
57
|
+
}, "images")]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.RetailerOption = RetailerOption;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n padding: 7px;\n border: 1px solid #f0f0f0;\n align-items: center;\n justify-content: space-between;\n border-radius: 5px;\n\n .avatar-and-retailer {\n display: flex;\n align-items: center;\n .retailer-name {\n font-family: ", ";\n font-size: 12px;\n color: #262626;\n }\n\n > * + * {\n margin-left: 10px;\n }\n }\n\n .services-icons {\n display: flex;\n\n span {\n color: #f0f0f0;\n font-size: 14px;\n &.is-active {\n color: #8a6caa;\n }\n }\n\n > * + * {\n margin-left: 9px;\n }\n }\n"])), _variables.FontFamily.Lato);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.RetailersListDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/RetailersList",
|
|
18
|
+
component: _.RetailersList
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.RetailersList, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var RetailersListDefault = Template.bind({});
|
|
27
|
+
exports.RetailersListDefault = RetailersListDefault;
|
|
28
|
+
RetailersListDefault.args = {
|
|
29
|
+
retailers: [{
|
|
30
|
+
id: 58,
|
|
31
|
+
name: "The Home Depot Golden"
|
|
32
|
+
}, {
|
|
33
|
+
id: 59,
|
|
34
|
+
name: "The Home Depot Platinum"
|
|
35
|
+
}, {
|
|
36
|
+
id: 60,
|
|
37
|
+
name: "The Home Depot Resizing"
|
|
38
|
+
}, {
|
|
39
|
+
id: 61,
|
|
40
|
+
name: "Home Depot TAB"
|
|
41
|
+
}, {
|
|
42
|
+
id: 68,
|
|
43
|
+
name: "The Home Depot Dropship"
|
|
44
|
+
}]
|
|
45
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RetailersList = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _RetailerOption = require("../RetailerOption");
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var RetailersList = function RetailersList(_ref) {
|
|
23
|
+
var retailers = _ref.retailers,
|
|
24
|
+
article = _ref.article;
|
|
25
|
+
|
|
26
|
+
var _useState = (0, _react.useState)({}),
|
|
27
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
|
+
services = _useState2[0],
|
|
29
|
+
setServices = _useState2[1];
|
|
30
|
+
|
|
31
|
+
(0, _react.useEffect)(function () {
|
|
32
|
+
if (article) setServices(article.statusByRetailer);
|
|
33
|
+
}, [article]);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
35
|
+
children: retailers.map(function (retailer, i) {
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetailerOption.RetailerOption, {
|
|
37
|
+
retailer: retailer,
|
|
38
|
+
services: services
|
|
39
|
+
}, i);
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.RetailersList = RetailersList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 370px;\n max-height: 200px;\n overflow: auto;\n position: absolute;\n z-index: 500;\n right: 0%;\n top: 100%;\n border: 1px solid #f0f0f0;\n padding: 10px;\n padding-right: 5px;\n background-color: white;\n\n > * + * {\n margin-top: 5px;\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.UserCatalogDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/UserCatalog",
|
|
18
|
+
component: _.UserCatalog
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.UserCatalog, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var UserCatalogDefault = Template.bind({});
|
|
27
|
+
exports.UserCatalogDefault = UserCatalogDefault;
|
|
28
|
+
UserCatalogDefault.args = {
|
|
29
|
+
datasheet: 54,
|
|
30
|
+
description: 54,
|
|
31
|
+
images: 55,
|
|
32
|
+
auditor: 37,
|
|
33
|
+
auditors: [{
|
|
34
|
+
name: "José",
|
|
35
|
+
last_name: "Castañeda",
|
|
36
|
+
id_user: 37
|
|
37
|
+
}, {
|
|
38
|
+
name: "Eduardo ",
|
|
39
|
+
last_name: " Reyes",
|
|
40
|
+
id_user: 195
|
|
41
|
+
}],
|
|
42
|
+
textSpecialists: [{
|
|
43
|
+
name: "Especialista",
|
|
44
|
+
last_name: "Textos",
|
|
45
|
+
id_user: 36
|
|
46
|
+
}, {
|
|
47
|
+
name: "ESPECIALISTA TXTS PRUEBA",
|
|
48
|
+
last_name: "",
|
|
49
|
+
id_user: 54
|
|
50
|
+
}, {
|
|
51
|
+
name: "Gerson",
|
|
52
|
+
last_name: "Martínez",
|
|
53
|
+
id_user: 57
|
|
54
|
+
}, {
|
|
55
|
+
name: "Angel",
|
|
56
|
+
last_name: "Perea",
|
|
57
|
+
id_user: 232
|
|
58
|
+
}],
|
|
59
|
+
imagesSpecialists: [{
|
|
60
|
+
name: "Especialista",
|
|
61
|
+
last_name: "Imágenes",
|
|
62
|
+
id_user: 35
|
|
63
|
+
}, {
|
|
64
|
+
name: "ESPECIALISTA ED PRUEBA",
|
|
65
|
+
last_name: "",
|
|
66
|
+
id_user: 55
|
|
67
|
+
}, {
|
|
68
|
+
name: "Uriel",
|
|
69
|
+
last_name: "Herrera",
|
|
70
|
+
id_user: 196
|
|
71
|
+
}]
|
|
72
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.UserCatalog = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _Avatar = require("../Avatar");
|
|
15
|
+
|
|
16
|
+
var _data = require("../../../global-files/data");
|
|
17
|
+
|
|
18
|
+
var _UserOption = require("../UserOption");
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _customHooks = require("../../../global-files/customHooks");
|
|
23
|
+
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
|
|
26
|
+
var UserCatalog = function UserCatalog(_ref) {
|
|
27
|
+
var datasheet = _ref.datasheet,
|
|
28
|
+
description = _ref.description,
|
|
29
|
+
images = _ref.images,
|
|
30
|
+
auditor = _ref.auditor,
|
|
31
|
+
_ref$auditors = _ref.auditors,
|
|
32
|
+
auditors = _ref$auditors === void 0 ? [] : _ref$auditors,
|
|
33
|
+
_ref$textSpecialists = _ref.textSpecialists,
|
|
34
|
+
textSpecialists = _ref$textSpecialists === void 0 ? [] : _ref$textSpecialists,
|
|
35
|
+
_ref$imagesSpecialist = _ref.imagesSpecialists,
|
|
36
|
+
imagesSpecialists = _ref$imagesSpecialist === void 0 ? [] : _ref$imagesSpecialist,
|
|
37
|
+
_ref$id = _ref.id,
|
|
38
|
+
id = _ref$id === void 0 ? "list-modal" : _ref$id;
|
|
39
|
+
|
|
40
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)(id),
|
|
41
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
42
|
+
showList = _useCloseModal2[0],
|
|
43
|
+
setShowList = _useCloseModal2[1];
|
|
44
|
+
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
46
|
+
onClick: function onClick() {
|
|
47
|
+
return setShowList(true);
|
|
48
|
+
},
|
|
49
|
+
id: id,
|
|
50
|
+
children: [datasheet && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
51
|
+
image: (0, _data.getProfilePicture)(datasheet, 26, 26),
|
|
52
|
+
altText: "datasheet specialist",
|
|
53
|
+
imageType: "medium-image"
|
|
54
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
55
|
+
image: (0, _data.getProfilePicture)(description, 26, 26),
|
|
56
|
+
altText: "description specialist",
|
|
57
|
+
imageType: "medium-image"
|
|
58
|
+
}), images && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
59
|
+
image: (0, _data.getProfilePicture)(images, 26, 26),
|
|
60
|
+
altText: "images specialist",
|
|
61
|
+
imageType: "medium-image"
|
|
62
|
+
}), auditor && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
63
|
+
image: (0, _data.getProfilePicture)(auditor, 26, 26),
|
|
64
|
+
altText: "auditor",
|
|
65
|
+
imageType: "medium-image"
|
|
66
|
+
}), showList && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
67
|
+
className: "users-assigned-list",
|
|
68
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
|
|
69
|
+
userId: datasheet,
|
|
70
|
+
usersArray: textSpecialists,
|
|
71
|
+
id: id + "-" + datasheet
|
|
72
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
|
|
73
|
+
userId: description,
|
|
74
|
+
usersArray: textSpecialists,
|
|
75
|
+
id: id + "-" + description
|
|
76
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
|
|
77
|
+
userId: images,
|
|
78
|
+
usersArray: imagesSpecialists,
|
|
79
|
+
id: id + "-" + images
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
|
|
81
|
+
userId: auditor,
|
|
82
|
+
usersArray: auditors,
|
|
83
|
+
id: id + "-" + auditor
|
|
84
|
+
})]
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.UserCatalog = UserCatalog;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n .users-assigned-list {\n background-color: white;\n padding: 10px;\n box-shadow: 0px 2px 4px #00000040;\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 400;\n }\n\n > * + * {\n margin-left: -10px;\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.UserOptionDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/UserOption",
|
|
18
|
+
component: _.UserOption
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.UserOption, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var UserOptionDefault = Template.bind({});
|
|
27
|
+
exports.UserOptionDefault = UserOptionDefault;
|
|
28
|
+
UserOptionDefault.args = {
|
|
29
|
+
userId: 37,
|
|
30
|
+
index: "datasheet",
|
|
31
|
+
usersArray: [{
|
|
32
|
+
name: "José",
|
|
33
|
+
last_name: "Castañeda",
|
|
34
|
+
id_user: 37
|
|
35
|
+
}, {
|
|
36
|
+
name: "Eduardo ",
|
|
37
|
+
last_name: " Reyes",
|
|
38
|
+
id_user: 195
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.UserOption = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _Avatar = require("../Avatar");
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
var _data = require("../../../global-files/data");
|
|
19
|
+
|
|
20
|
+
var _utils = require("../../organisms/OrderDetail/utils/Table/utils");
|
|
21
|
+
|
|
22
|
+
var _UserSelector = require("../UserSelector");
|
|
23
|
+
|
|
24
|
+
var _customHooks = require("../../../global-files/customHooks");
|
|
25
|
+
|
|
26
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
|
|
28
|
+
var UserOption = function UserOption(_ref) {
|
|
29
|
+
var userId = _ref.userId,
|
|
30
|
+
index = _ref.index,
|
|
31
|
+
usersArray = _ref.usersArray,
|
|
32
|
+
id = _ref.id;
|
|
33
|
+
|
|
34
|
+
var _useState = (0, _react.useState)({}),
|
|
35
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
|
+
userAssigned = _useState2[0],
|
|
37
|
+
setUserAssigned = _useState2[1];
|
|
38
|
+
|
|
39
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)(id),
|
|
40
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
41
|
+
showSelector = _useCloseModal2[0],
|
|
42
|
+
setShowSelector = _useCloseModal2[1];
|
|
43
|
+
|
|
44
|
+
var icons = _utils.servicesCodeIcon;
|
|
45
|
+
(0, _react.useEffect)(function () {
|
|
46
|
+
if (usersArray) {
|
|
47
|
+
usersArray.forEach(function (user) {
|
|
48
|
+
if (user.id_user === userId) {
|
|
49
|
+
setUserAssigned(user);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [userId, usersArray]);
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
55
|
+
onClick: function onClick() {
|
|
56
|
+
return setShowSelector(true);
|
|
57
|
+
},
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
59
|
+
className: "image-and-name",
|
|
60
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
61
|
+
image: (0, _data.getProfilePicture)(userAssigned === null || userAssigned === void 0 ? void 0 : userAssigned.id_user, 26, 26),
|
|
62
|
+
altText: "datasheet specialist",
|
|
63
|
+
imageType: "medium-image"
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
65
|
+
children: [userAssigned === null || userAssigned === void 0 ? void 0 : userAssigned.name, " ", userAssigned === null || userAssigned === void 0 ? void 0 : userAssigned.last_name]
|
|
66
|
+
})]
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
68
|
+
className: "icon-container",
|
|
69
|
+
children: icons[index]
|
|
70
|
+
}), showSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserSelector.UserSelector, {
|
|
71
|
+
id: id,
|
|
72
|
+
searchLabel: "Buscar Usuario",
|
|
73
|
+
index: index,
|
|
74
|
+
usersArray: usersArray,
|
|
75
|
+
position: "absolute"
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.UserOption = UserOption;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid #f0f0f0;\n border-radius: 5px;\n color: #262626;\n font-size: 12px;\n font-family: ", ";\n display: flex;\n align-items: center;\n padding: 5px 10px;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n background-color: white;\n width: 217px;\n\n .image-and-name {\n display: flex;\n align-items: center;\n\n div + p {\n margin-left: 10px;\n }\n }\n\n .icon-container {\n position: relative;\n span {\n color: #808080;\n cursor: pointer;\n\n & + span {\n display: none;\n position: absolute;\n right: 120%;\n top: 50%;\n transform: translateY(-50%);\n white-space: nowrap;\n }\n\n &:hover {\n & + span {\n display: block;\n }\n }\n }\n }\n\n & + * {\n margin-top: 5px;\n }\n"])), _variables.FontFamily.Lato);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.UserSelectorDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/UserSelector",
|
|
18
|
+
component: _.UserSelector
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.UserSelector, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var UserSelectorDefault = Template.bind({});
|
|
27
|
+
exports.UserSelectorDefault = UserSelectorDefault;
|
|
28
|
+
UserSelectorDefault.args = {
|
|
29
|
+
searchLabel: "Buscar auditor",
|
|
30
|
+
index: "auditor",
|
|
31
|
+
usersArray: [{
|
|
32
|
+
name: "José",
|
|
33
|
+
last_name: "Castañeda",
|
|
34
|
+
id_user: 37
|
|
35
|
+
}, {
|
|
36
|
+
name: "Eduardo ",
|
|
37
|
+
last_name: " Reyes",
|
|
38
|
+
id_user: 195
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.UserSelector = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
15
|
+
|
|
16
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
17
|
+
|
|
18
|
+
var _Avatar = require("../Avatar");
|
|
19
|
+
|
|
20
|
+
var _data = require("../../../global-files/data");
|
|
21
|
+
|
|
22
|
+
var _react = require("react");
|
|
23
|
+
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
|
|
26
|
+
var UserSelector = function UserSelector(_ref) {
|
|
27
|
+
var searchLabel = _ref.searchLabel,
|
|
28
|
+
index = _ref.index,
|
|
29
|
+
usersArray = _ref.usersArray,
|
|
30
|
+
onClick = _ref.onClick,
|
|
31
|
+
position = _ref.position;
|
|
32
|
+
|
|
33
|
+
var _useState = (0, _react.useState)([]),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
text = _useState2[0],
|
|
36
|
+
setText = _useState2[1];
|
|
37
|
+
|
|
38
|
+
var _useState3 = (0, _react.useState)([]),
|
|
39
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
40
|
+
userFiltered = _useState4[0],
|
|
41
|
+
setUsersFiltered = _useState4[1];
|
|
42
|
+
|
|
43
|
+
(0, _react.useEffect)(function () {
|
|
44
|
+
if (usersArray) setUsersFiltered(usersArray);
|
|
45
|
+
}, [usersArray]);
|
|
46
|
+
|
|
47
|
+
var onChangeText = function onChangeText(e) {
|
|
48
|
+
setText(e.target.value);
|
|
49
|
+
if (usersArray) setUsersFiltered(usersArray.filter(function (user) {
|
|
50
|
+
return (user.name + " " + user.last_name).toLowerCase().includes(e.target.value.toLowerCase());
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
55
|
+
position: position,
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
57
|
+
className: "search-cotainer",
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
59
|
+
icon: _freeSolidSvgIcons.faSearch
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
61
|
+
type: "text",
|
|
62
|
+
className: "search",
|
|
63
|
+
placeholder: searchLabel,
|
|
64
|
+
value: text,
|
|
65
|
+
onChange: onChangeText,
|
|
66
|
+
autoFocus: true
|
|
67
|
+
})]
|
|
68
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
69
|
+
className: "selector-container",
|
|
70
|
+
children: userFiltered.length ? userFiltered.map(function (user) {
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
72
|
+
className: "user-item",
|
|
73
|
+
onClick: onClick,
|
|
74
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
|
|
75
|
+
image: (0, _data.getProfilePicture)(user.id_user, 26, 26),
|
|
76
|
+
altText: "profile image",
|
|
77
|
+
imageType: "medium-image"
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
79
|
+
children: [user.name, " ", user.last_name]
|
|
80
|
+
})]
|
|
81
|
+
}, user.id_user);
|
|
82
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
84
|
+
children: "Sin usuarios para asignar"
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.UserSelector = UserSelector;
|