contentoh-components-library 21.3.5 → 21.3.7
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/.env.development +3 -0
- package/dist/assets/images/customSelect/starIcon.svg +14 -0
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +124 -0
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +72 -0
- package/dist/components/atoms/ButtonFileChooser/index.js +118 -0
- package/dist/components/atoms/ButtonFileChooser/styles.js +20 -0
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +66 -0
- package/dist/components/atoms/ButtonV2/index.js +110 -0
- package/dist/components/atoms/ButtonV2/styles.js +53 -0
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +50 -0
- package/dist/components/atoms/CustomIcon/index.js +40 -0
- package/dist/components/atoms/CustomIcon/styles.js +33 -0
- package/dist/components/atoms/IconFile/IconFile.stories.js +48 -0
- package/dist/components/atoms/IconFile/index.js +249 -0
- package/dist/components/atoms/IconFile/styles.js +23 -0
- package/dist/components/atoms/Image/Image.stories.js +73 -0
- package/dist/components/atoms/Image/index.js +76 -0
- package/dist/components/atoms/Image/styles.js +43 -0
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +63 -0
- package/dist/components/atoms/ImageLink/index.js +77 -0
- package/dist/components/atoms/ImageLink/styles.js +40 -0
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +70 -0
- package/dist/components/atoms/ImagePreview/index.js +222 -0
- package/dist/components/atoms/ImagePreview/styles.js +44 -0
- package/dist/components/atoms/InputText/InputText.stories.js +60 -0
- package/dist/components/atoms/InputText/index.js +66 -0
- package/dist/components/atoms/InputText/styles.js +32 -0
- package/dist/components/atoms/NotFound/NotFound.stories.js +36 -0
- package/dist/components/atoms/NotFound/index.js +75 -0
- package/dist/components/atoms/NotFound/styles.js +20 -0
- package/dist/components/atoms/ProgressBar/index.js +36 -6
- package/dist/components/atoms/ProgressBar/styles.js +11 -3
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +45 -0
- package/dist/components/atoms/SelectItemV2/index.js +57 -0
- package/dist/components/atoms/SelectItemV2/styles.js +30 -0
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +66 -0
- package/dist/components/atoms/Tooltip/index.js +72 -0
- package/dist/components/atoms/Tooltip/styles.js +20 -0
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +66 -0
- package/dist/components/molecules/ButtonDownloadFile/index.js +179 -0
- package/dist/components/molecules/ButtonDownloadFile/styles.js +23 -0
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +98 -0
- package/dist/components/molecules/Dropdown/index.js +150 -0
- package/dist/components/molecules/Dropdown/styles.js +26 -0
- package/dist/components/molecules/HeaderTop/index.js +10 -5
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +82 -0
- package/dist/components/molecules/ImageTooltip/index.js +85 -0
- package/dist/components/molecules/ImageTooltip/styles.js +33 -0
- package/dist/components/molecules/ProductNameHeader/index.js +5 -3
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +119 -0
- package/dist/components/molecules/SelectV2/index.js +306 -0
- package/dist/components/molecules/SelectV2/styles.js +42 -0
- package/dist/components/molecules/SelectV2/test.js +95 -0
- package/dist/components/molecules/SelectV2/test.stories.js +27 -0
- package/dist/components/organisms/Chat/Chat.stories.js +215 -0
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +83 -0
- package/dist/components/organisms/Chat/ChatLists/index.js +160 -0
- package/dist/components/organisms/Chat/ChatLists/styles.js +29 -0
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +176 -0
- package/dist/components/organisms/Chat/ContainerItems/index.js +569 -0
- package/dist/components/organisms/Chat/ContainerItems/styles.js +20 -0
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +142 -0
- package/dist/components/organisms/Chat/ContentChat/index.js +1422 -0
- package/dist/components/organisms/Chat/ContentChat/styles.js +20 -0
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +43 -0
- package/dist/components/organisms/Chat/Footer/index.js +984 -0
- package/dist/components/organisms/Chat/Footer/styles.js +32 -0
- package/dist/components/organisms/Chat/Header/Header.stories.js +96 -0
- package/dist/components/organisms/Chat/Header/index.js +84 -0
- package/dist/components/organisms/Chat/Header/styles.js +20 -0
- package/dist/components/organisms/Chat/index.js +327 -0
- package/dist/components/organisms/Chat/styles.js +29 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
- package/dist/components/organisms/Modal/Modal.stories.js +66 -0
- package/dist/components/organisms/Modal/index.js +95 -0
- package/dist/components/organisms/Modal/styles.js +20 -0
- package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +33 -0
- package/dist/components/organisms/RangeCalendar/index.js +148 -0
- package/dist/components/organisms/RangeCalendar/styles.js +27 -0
- package/dist/components/pages/ProviderProductEdition/index.js +8 -8
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -86
- package/dist/components/pages/RetailerProductEdition/index.js +13 -12
- package/dist/global-files/fonts.css +6 -0
- package/dist/global-files/handle_http.js +383 -0
- package/dist/global-files/utils.js +484 -0
- package/dist/global-files/variables.js +2 -0
- package/dist/index.js +267 -46
- package/package.json +12 -1
- package/src/assets/images/customSelect/starIcon.svg +14 -0
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +124 -0
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
- package/src/components/atoms/ButtonFileChooser/index.js +69 -0
- package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
- package/src/components/atoms/ButtonV2/index.js +85 -0
- package/src/components/atoms/ButtonV2/styles.js +217 -0
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
- package/src/components/atoms/CustomIcon/index.js +41 -0
- package/src/components/atoms/CustomIcon/styles.js +85 -0
- package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
- package/src/components/atoms/IconFile/index.js +119 -0
- package/src/components/atoms/IconFile/styles.js +67 -0
- package/src/components/atoms/Image/Image.stories.js +51 -0
- package/src/components/atoms/Image/index.js +55 -0
- package/src/components/atoms/Image/styles.js +34 -0
- package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
- package/src/components/atoms/ImageLink/index.js +57 -0
- package/src/components/atoms/ImageLink/styles.js +30 -0
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
- package/src/components/atoms/ImagePreview/index.js +191 -0
- package/src/components/atoms/ImagePreview/styles.js +77 -0
- package/src/components/atoms/InputText/InputText.stories.js +39 -0
- package/src/components/atoms/InputText/index.js +61 -0
- package/src/components/atoms/InputText/styles.js +89 -0
- package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
- package/src/components/atoms/NotFound/index.js +52 -0
- package/src/components/atoms/NotFound/styles.js +55 -0
- package/src/components/atoms/ProgressBar/index.js +40 -5
- package/src/components/atoms/ProgressBar/styles.js +24 -0
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
- package/src/components/atoms/SelectItemV2/index.js +61 -0
- package/src/components/atoms/SelectItemV2/styles.js +90 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
- package/src/components/atoms/Tooltip/index.js +59 -0
- package/src/components/atoms/Tooltip/styles.js +42 -0
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
- package/src/components/molecules/ButtonDownloadFile/index.js +111 -0
- package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
- package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
- package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
- package/src/components/molecules/Dropdown/index.js +150 -0
- package/src/components/molecules/Dropdown/styles.js +75 -0
- package/src/components/molecules/HeaderTop/index.js +11 -6
- package/src/components/molecules/HeaderTop/styles.js +4 -0
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
- package/src/components/molecules/ImageTooltip/index.js +63 -0
- package/src/components/molecules/ImageTooltip/styles.js +18 -0
- package/src/components/molecules/ProductNameHeader/index.js +6 -1
- package/src/components/molecules/SelectV2/SelectV2.stories.js +114 -0
- package/src/components/molecules/SelectV2/index.js +350 -0
- package/src/components/molecules/SelectV2/styles.js +105 -0
- package/src/components/molecules/SelectV2/test.js +61 -0
- package/src/components/molecules/SelectV2/test.stories.js +10 -0
- package/src/components/organisms/Chat/Chat.stories.js +199 -0
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +141 -0
- package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
- package/src/components/organisms/Chat/ContainerItems/index.js +549 -0
- package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +900 -0
- package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
- package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
- package/src/components/organisms/Chat/Footer/index.js +669 -0
- package/src/components/organisms/Chat/Footer/styles.js +286 -0
- package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
- package/src/components/organisms/Chat/Header/index.js +94 -0
- package/src/components/organisms/Chat/Header/styles.js +49 -0
- package/src/components/organisms/Chat/index.js +294 -0
- package/src/components/organisms/Chat/styles.js +42 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -0
- package/src/components/organisms/Modal/Modal.stories.js +55 -0
- package/src/components/organisms/Modal/index.js +97 -0
- package/src/components/organisms/Modal/styles.js +103 -0
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
- package/src/components/organisms/RangeCalendar/index.js +121 -0
- package/src/components/organisms/RangeCalendar/styles.js +883 -0
- package/src/components/pages/ProviderProductEdition/index.js +9 -6
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +62 -85
- package/src/components/pages/RetailerProductEdition/index.js +12 -10
- package/src/global-files/fonts.css +6 -0
- package/src/global-files/handle_http.js +231 -0
- package/src/global-files/utils.js +309 -0
- package/src/global-files/variables.js +2 -0
- package/src/index.js +17 -0
|
@@ -0,0 +1,32 @@
|
|
|
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.ContainerSecondary = exports.ContainerMain = exports.ContainerItemCarrousel = 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, _templateObject2, _templateObject3, _templateObject4;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n //height: 100%; // modo dev\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: flex-start;\n background: white;\n padding: 15px 14px 14px 14px;\n //border: 1px solid red;\n\n .container-chatDisabled {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n background-color: #f7f7f7;\n border-radius: 17px;\n padding: 10px 15px;\n\n .label-chatDisabled {\n flex-grow: 2;\n font-family: ", ", sans-serif;\n font-size: 12px;\n text-align: center;\n color: #a2a2a2;\n }\n }\n\n .tooltipErrorUpdate {\n > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 5px;\n\n .label-title {\n font-family: ", ", sans-serif;\n font-size: 13px;\n text-align: center;\n color: #262626;\n }\n\n .label-detail {\n font-family: ", ", sans-serif;\n font-size: 11px;\n text-align: center;\n color: #262626;\n }\n }\n }\n\n .container-ErrorUpdate {\n width: 20px;\n height: 20px;\n display: grid;\n place-items: center;\n overflow: hidden;\n padding: 0px;\n }\n"])), _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoMedium, _variables.FontFamily.RobotoRegular);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
21
|
+
|
|
22
|
+
var ContainerMain = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: flex-end;\n gap: 7px;\n flex-wrap: nowrap;\n background-color: #f7f7f7;\n border-radius: 17px;\n padding: 10px 7px 10px 15px;\n\n .input-itemMessage {\n flex-grow: 2;\n min-width: 80px;\n padding: 0px;\n }\n\n .btn-chooserFiles,\n .btn-sendMessage {\n width: 20px;\n height: 20px;\n display: grid;\n place-items: center;\n overflow: hidden;\n padding: 0px;\n }\n\n .btn-chooserFiles {\n .button {\n .icon:hover {\n color: #a2a2a2 !important;\n }\n }\n }\n"])));
|
|
23
|
+
|
|
24
|
+
exports.ContainerMain = ContainerMain;
|
|
25
|
+
|
|
26
|
+
var ContainerSecondary = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 5px;\n flex-wrap: nowrap;\n background-color: white;\n border-radius: 0px;\n padding: 0px;\n\n // container del preview files\n + .tooltip-previewFiles {\n width: 100%;\n padding: 15px 14px 0px 14px;\n background-color: transparent;\n z-index: 9;\n /*\n &[data-popper-placement*=\"bottom\"] > .MuiTooltip-tooltip {\n margin-top: 5px;\n }\n &[data-popper-placement*=\"top\"] > .MuiTooltip-tooltip {\n margin-bottom: 5px;\n }\n */\n\n > .MuiTooltip-tooltip {\n --background: #f7f7f7;\n width: 100%;\n background-color: var(--background);\n padding: 5px;\n border-radius: 15px;\n font-family: ", ", sans-serif;\n font-size: 12px;\n text-align: left;\n color: #262626;\n max-width: unset;\n margin: 0px !important;\n\n .MuiTooltip-arrow {\n color: var(--background);\n }\n\n // container del carrusel de files\n .container-carrouselFiles {\n width: 100%;\n //border: 1px solid blue;\n\n // carrusel de files\n .carrousel-files {\n --sizePagination: 0px;\n width: 100%;\n padding-top: var(--sizePagination);\n border-radius: inherit;\n\n .swiper-pagination-progressbar {\n height: var(--sizePagination);\n border-radius: inherit;\n\n span {\n background-color: #e33aa9;\n }\n }\n\n .item-carrousel {\n width: 154px;\n height: 154px;\n background-color: white;\n display: grid;\n place-items: center;\n border-radius: 10px;\n }\n }\n\n // tooltip fileName\n + .tooltip-previewFileName {\n background-color: transparent;\n //transform: none !important;\n //inset: 0px auto auto auto !important;\n\n > .MuiTooltip-tooltip {\n --background: white;\n background-color: var(--background);\n padding: 5px;\n border-radius: 15px;\n font-family: ", ", sans-serif;\n font-size: 12px;\n text-align: left;\n color: #262626;\n max-width: 154px;\n }\n\n &[data-popper-placement*=\"bottom\"] .MuiTooltip-tooltip {\n margin-top: 15px;\n }\n &[data-popper-placement*=\"top\"] .MuiTooltip-tooltip {\n margin-bottom: 15px;\n }\n }\n }\n }\n }\n\n .btn-chooserFiles {\n width: 34px;\n height: 34px;\n display: grid;\n place-items: center;\n .button {\n background-color: #f7f7f7 !important;\n border: none !important;\n &:hover {\n background-color: #e7e7e7 !important;\n }\n }\n }\n\n .slide-btnSendFiles {\n flex-grow: 2;\n\n .btn-sendFiles {\n width: 100%;\n .button {\n padding: 10px 15px;\n }\n }\n }\n"])), _variables.FontFamily.RobotoMedium, _variables.FontFamily.RobotoMedium);
|
|
27
|
+
|
|
28
|
+
exports.ContainerSecondary = ContainerSecondary;
|
|
29
|
+
|
|
30
|
+
var ContainerItemCarrousel = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n border-radius: inherit;\n background-color: inherit;\n\n .container-img {\n border-radius: inherit;\n width: 100%;\n height: 100%;\n background-color: inherit;\n transition: all 0.25s;\n z-index: 10;\n }\n\n .container-delete {\n position: absolute;\n border-radius: inherit;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n background-color: inherit;\n z-index: 11;\n opacity: 0;\n transition: all 0.3s;\n background-color: rgba(0, 0, 0, 0.35);\n overflow: hidden;\n\n .btn-delete .button {\n border: none;\n padding: 4px 8px;\n color: #262626 !important;\n .icon {\n font-size: 8px;\n }\n }\n }\n\n &:hover {\n .container-delete {\n opacity: 1;\n }\n }\n"])));
|
|
31
|
+
|
|
32
|
+
exports.ContainerItemCarrousel = ContainerItemCarrousel;
|
|
@@ -0,0 +1,96 @@
|
|
|
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.headerChatSimple = exports.headerChatMultiple = exports.headerChatEmpty = exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/organisms/Chat/Header",
|
|
18
|
+
component: _index.Header
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Header, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
}; // companies de prueba multiple
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var multipleCompanies = {
|
|
28
|
+
100: {
|
|
29
|
+
name: "Fábrica",
|
|
30
|
+
statusChat: "enabled"
|
|
31
|
+
},
|
|
32
|
+
200: {
|
|
33
|
+
name: "Proveedor",
|
|
34
|
+
statusChat: "current"
|
|
35
|
+
},
|
|
36
|
+
300: {
|
|
37
|
+
name: "Cadena",
|
|
38
|
+
statusChat: "disabled"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var twoCompanies = {
|
|
42
|
+
100: {
|
|
43
|
+
name: "Fábrica",
|
|
44
|
+
statusChat: "enabled"
|
|
45
|
+
},
|
|
46
|
+
200: {
|
|
47
|
+
name: "Proveedor",
|
|
48
|
+
statusChat: "current"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var headerChatMultiple = Template.bind({});
|
|
52
|
+
exports.headerChatMultiple = headerChatMultiple;
|
|
53
|
+
headerChatMultiple.args = {
|
|
54
|
+
showChatsList: false,
|
|
55
|
+
multipleCompanies: true,
|
|
56
|
+
chatCompany: {
|
|
57
|
+
id: 101,
|
|
58
|
+
name: "The Home Depot",
|
|
59
|
+
src: ""
|
|
60
|
+
},
|
|
61
|
+
onClickBtnChooseChat: function onClickBtnChooseChat() {
|
|
62
|
+
console.log("showAllChats:", true);
|
|
63
|
+
},
|
|
64
|
+
onClickBtnClose: function onClickBtnClose() {
|
|
65
|
+
console.log("click en boton X");
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var headerChatSimple = Template.bind({});
|
|
69
|
+
exports.headerChatSimple = headerChatSimple;
|
|
70
|
+
headerChatSimple.args = {
|
|
71
|
+
showChatsList: false,
|
|
72
|
+
multipleCompanies: false,
|
|
73
|
+
chatCompany: {
|
|
74
|
+
id: 101,
|
|
75
|
+
name: "The Home Depot",
|
|
76
|
+
src: ""
|
|
77
|
+
},
|
|
78
|
+
onClickBtnChooseChat: function onClickBtnChooseChat() {
|
|
79
|
+
console.log("showAllChats:", true);
|
|
80
|
+
},
|
|
81
|
+
onClickBtnClose: function onClickBtnClose() {
|
|
82
|
+
console.log("click en boton X");
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var headerChatEmpty = Template.bind({});
|
|
86
|
+
exports.headerChatEmpty = headerChatEmpty;
|
|
87
|
+
headerChatEmpty.args = {
|
|
88
|
+
showChatsList: false,
|
|
89
|
+
multipleCompanies: true,
|
|
90
|
+
onClickBtnChooseChat: function onClickBtnChooseChat() {
|
|
91
|
+
console.log("showAllChats:", true);
|
|
92
|
+
},
|
|
93
|
+
onClickBtnClose: function onClickBtnClose() {
|
|
94
|
+
console.log("click en boton X");
|
|
95
|
+
}
|
|
96
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Header = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
|
|
12
|
+
var _CustomIcon = require("../../../atoms/CustomIcon");
|
|
13
|
+
|
|
14
|
+
var _ButtonV = require("../../../atoms/ButtonV2");
|
|
15
|
+
|
|
16
|
+
var _Image = require("../../../atoms/Image");
|
|
17
|
+
|
|
18
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var Header = function Header(props) {
|
|
23
|
+
var showBtnClose = props.showBtnClose,
|
|
24
|
+
showChatsList = props.showChatsList,
|
|
25
|
+
chatCompany = props.chatCompany,
|
|
26
|
+
multipleCompanies = props.multipleCompanies,
|
|
27
|
+
onClickBtnChooseChat = props.onClickBtnChooseChat,
|
|
28
|
+
onClickBtnClose = props.onClickBtnClose; //console.log(chatCompany);
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
32
|
+
children: [showChatsList ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
33
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomIcon.CustomIcon, {
|
|
34
|
+
className: "icon-chooseChat",
|
|
35
|
+
type: "pink",
|
|
36
|
+
borderType: "circle",
|
|
37
|
+
size: 10,
|
|
38
|
+
icon: _freeSolidSvgIcons.faComments
|
|
39
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
40
|
+
className: "title",
|
|
41
|
+
children: " Todos los chats "
|
|
42
|
+
})]
|
|
43
|
+
}) : chatCompany && chatCompany.id && chatCompany.name && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.Image, {
|
|
45
|
+
className: "logoCompany",
|
|
46
|
+
width: "24px",
|
|
47
|
+
sizeLoading: 20,
|
|
48
|
+
colorLoading: undefined,
|
|
49
|
+
src: chatCompany.src,
|
|
50
|
+
componentDefault: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomIcon.CustomIcon, {
|
|
51
|
+
className: "icon-logoCompany",
|
|
52
|
+
type: "white",
|
|
53
|
+
borderType: "circle",
|
|
54
|
+
size: 12,
|
|
55
|
+
icon: _freeSolidSvgIcons.faImage
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
58
|
+
className: "title",
|
|
59
|
+
children: [" ", chatCompany.name, " "]
|
|
60
|
+
}), multipleCompanies && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
61
|
+
className: "btn-chooseChat",
|
|
62
|
+
type: "pink",
|
|
63
|
+
size: 10,
|
|
64
|
+
borderType: "circle",
|
|
65
|
+
icon: _freeSolidSvgIcons.faComments,
|
|
66
|
+
onClick: function onClick(event) {
|
|
67
|
+
return onClickBtnChooseChat && onClickBtnChooseChat();
|
|
68
|
+
}
|
|
69
|
+
})]
|
|
70
|
+
}), showBtnClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
71
|
+
className: "btn-X",
|
|
72
|
+
type: "white",
|
|
73
|
+
size: 11,
|
|
74
|
+
borderType: "circle",
|
|
75
|
+
icon: _freeSolidSvgIcons.faClose,
|
|
76
|
+
onClick: function onClick(event) {
|
|
77
|
+
return onClickBtnClose && onClickBtnClose();
|
|
78
|
+
}
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
exports.Header = Header;
|
|
@@ -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 width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: flex-end;\n gap: 10px;\n background: #f9f9f9;\n padding: 12px 15px;\n //overflow: auto;\n //border: 1px solid red;\n\n .logoCompany {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n overflow: hidden;\n\n .icon-logoCompany {\n padding: 5px;\n }\n }\n\n .title {\n flex-grow: 2;\n min-width: min-content;\n text-align: left;\n font-family: ", ", sans-serif;\n font-size: 15px;\n color: #262626;\n }\n\n .btn-chooseChat,\n .icon-chooseChat {\n width: 24px;\n height: 24px;\n padding: 0px;\n }\n\n .btn-X {\n width: 24px;\n height: 24px;\n padding: 0px;\n }\n"])), _variables.FontFamily.RobotoMedium);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,327 @@
|
|
|
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.Chat = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _styles = require("./styles");
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
23
|
+
|
|
24
|
+
var _ContentChat = require("./ContentChat");
|
|
25
|
+
|
|
26
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
27
|
+
|
|
28
|
+
var _material = require("@mui/material");
|
|
29
|
+
|
|
30
|
+
var _utils = require("../../../global-files/utils");
|
|
31
|
+
|
|
32
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
+
|
|
34
|
+
var Chat = function Chat(props) {
|
|
35
|
+
var chatType = props.chatType,
|
|
36
|
+
chatContainerType = props.chatContainerType,
|
|
37
|
+
chatData = props.chatData,
|
|
38
|
+
classNameContainerFixed = props.classNameContainerFixed;
|
|
39
|
+
|
|
40
|
+
var _useState = (0, _react.useState)(false),
|
|
41
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
+
showPopUpChat = _useState2[0],
|
|
43
|
+
setShowPopUpChat = _useState2[1];
|
|
44
|
+
|
|
45
|
+
var _useState3 = (0, _react.useState)(),
|
|
46
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
47
|
+
data = _useState4[0],
|
|
48
|
+
setData = _useState4[1];
|
|
49
|
+
|
|
50
|
+
(0, _react.useEffect)(function () {
|
|
51
|
+
switch (chatType) {
|
|
52
|
+
case "merchant_product":
|
|
53
|
+
validateChatMerchantProduct();
|
|
54
|
+
break;
|
|
55
|
+
|
|
56
|
+
case "order_product":
|
|
57
|
+
validateChatOrderProduct();
|
|
58
|
+
break;
|
|
59
|
+
|
|
60
|
+
case "ticket":
|
|
61
|
+
validateChatTicket();
|
|
62
|
+
break;
|
|
63
|
+
|
|
64
|
+
default:
|
|
65
|
+
setData({
|
|
66
|
+
code: 404,
|
|
67
|
+
message: "El tipo de chat especificado \"".concat(chatType, "\" no es valido"),
|
|
68
|
+
errorDetail: ""
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}, [chatType]); // validar props que se requieren para el tipo de chat "order_product"
|
|
72
|
+
|
|
73
|
+
var validateChatOrderProduct = function validateChatOrderProduct() {
|
|
74
|
+
var userToken = chatData.userToken,
|
|
75
|
+
id = chatData.id,
|
|
76
|
+
orderId = chatData.orderId,
|
|
77
|
+
retailerId = chatData.retailerId; // validar token del user
|
|
78
|
+
|
|
79
|
+
if ((0, _utils.isStringEmpty)(userToken)) {
|
|
80
|
+
setDataError("El token del usuario no es valido");
|
|
81
|
+
return;
|
|
82
|
+
} // validar ID del producto
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
if (!(0, _utils.isValidNaturalNumber)(id)) {
|
|
86
|
+
setDataError("El ID del producto no es valido");
|
|
87
|
+
return;
|
|
88
|
+
} // validar el ID de la OT en donde se encuentra el producto
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if (!(0, _utils.isValidNaturalNumber)(orderId)) {
|
|
92
|
+
setDataError("El ID de la orden del producto no es valido");
|
|
93
|
+
return;
|
|
94
|
+
} // validar el ID de la cadena asociada al producto en la OT
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if (!(0, _utils.isValidNaturalNumber)(retailerId)) {
|
|
98
|
+
setDataError("La cadena relacionada al producto no es valida");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
setData({
|
|
103
|
+
userToken: userToken,
|
|
104
|
+
id: id,
|
|
105
|
+
orderId: orderId,
|
|
106
|
+
retailerId: retailerId
|
|
107
|
+
});
|
|
108
|
+
}; // validar props que se requieren para el tipo de chat "merchants_product"
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
var validateChatMerchantProduct = function validateChatMerchantProduct() {
|
|
112
|
+
var userToken = chatData.userToken,
|
|
113
|
+
id = chatData.id,
|
|
114
|
+
version = chatData.version; // validar token del user
|
|
115
|
+
|
|
116
|
+
if ((0, _utils.isStringEmpty)(userToken)) {
|
|
117
|
+
setDataError("El token del usuario no es valido");
|
|
118
|
+
return;
|
|
119
|
+
} // validar ID del producto
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
if (!(0, _utils.isValidNaturalNumber)(id)) {
|
|
123
|
+
setDataError("El ID del producto no es valido");
|
|
124
|
+
return;
|
|
125
|
+
} // validar la version del producto
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if (!(0, _utils.isValidNaturalNumber)(version)) {
|
|
129
|
+
setDataError("La version del producto no es valida");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
setData({
|
|
134
|
+
userToken: userToken,
|
|
135
|
+
id: id,
|
|
136
|
+
version: version
|
|
137
|
+
});
|
|
138
|
+
}; // validar props que se requieren para el tipo de chat "ticket"
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
var validateChatTicket = function validateChatTicket() {
|
|
142
|
+
var currentUser = chatData.currentUser,
|
|
143
|
+
id = chatData.id,
|
|
144
|
+
statusTicket = chatData.statusTicket,
|
|
145
|
+
ticketOwnerUserId = chatData.ticketOwnerUserId; // validar si ID del usuario conectado
|
|
146
|
+
|
|
147
|
+
if (!(0, _utils.isValidNaturalNumber)(currentUser === null || currentUser === void 0 ? void 0 : currentUser.id)) {
|
|
148
|
+
setDataError("Tu ID de usuario no fue especificado");
|
|
149
|
+
return;
|
|
150
|
+
} // validar si ID de la compañia del usuario conectado
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
if (!(0, _utils.isValidNaturalNumber)(currentUser === null || currentUser === void 0 ? void 0 : currentUser.companyId)) {
|
|
154
|
+
setDataError("El ID de tu compañia no fue especificado");
|
|
155
|
+
return;
|
|
156
|
+
} // validar si el usuario conectado es de tecnologia o no
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
if ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.isUserTech) === undefined || typeof currentUser.isUserTech !== "boolean") {
|
|
160
|
+
setDataError("Tu tipo de usuario no fue especificado");
|
|
161
|
+
return;
|
|
162
|
+
} // validar ID del ticket
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
if (!(0, _utils.isValidNaturalNumber)(id)) {
|
|
166
|
+
setDataError("El ID del ticket no es valido");
|
|
167
|
+
return;
|
|
168
|
+
} // validar ID del usuario que creó el ticket
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
if (!(0, _utils.isValidNaturalNumber)(ticketOwnerUserId)) {
|
|
172
|
+
setDataError("El ID del usuario al que le pertenece el ticket no es valido");
|
|
173
|
+
return;
|
|
174
|
+
} // validar el status del chat
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
if ((0, _utils.isStringEmpty)(statusTicket)) {
|
|
178
|
+
setDataError("El estatus del ticket no es valido");
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var statusChat = "open";
|
|
183
|
+
if (statusTicket === "COMPLETED") statusChat = "closed"; // convertir user TECH a NORMAL si es el propietario del ticket
|
|
184
|
+
|
|
185
|
+
var isUserTech = currentUser.isUserTech;
|
|
186
|
+
|
|
187
|
+
if (isUserTech && currentUser.id == ticketOwnerUserId) {
|
|
188
|
+
isUserTech = false;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
setData({
|
|
192
|
+
currentUser: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, currentUser), {}, {
|
|
193
|
+
isUserTech: isUserTech
|
|
194
|
+
}),
|
|
195
|
+
id: id,
|
|
196
|
+
statusChat: statusChat
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var setDataError = function setDataError(errorDetail) {
|
|
201
|
+
setData({
|
|
202
|
+
code: 404,
|
|
203
|
+
message: "No se especificaron algunos datos requeridos para el tipo de chat \"".concat(chatType, "\""),
|
|
204
|
+
errorDetail: errorDetail
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
/*
|
|
208
|
+
const createItem = async (valueType, valueInput) => {
|
|
209
|
+
clearTimeout(processUpdateID);
|
|
210
|
+
let currentItems = items.slice();
|
|
211
|
+
let paramsBody = {};
|
|
212
|
+
let paramsHeaders = {};
|
|
213
|
+
switch (chatType.toLowerCase()) {
|
|
214
|
+
case "order_product": //------------------------------------------
|
|
215
|
+
paramsBody = {
|
|
216
|
+
articleId: articleId,
|
|
217
|
+
valueType: valueType,
|
|
218
|
+
value: valueInput,
|
|
219
|
+
isOrderProduct: "1",
|
|
220
|
+
orderId: orderId,
|
|
221
|
+
retailerId: retailerId,
|
|
222
|
+
};
|
|
223
|
+
paramsHeaders = { Authorization: userToken };
|
|
224
|
+
break;
|
|
225
|
+
default:
|
|
226
|
+
// merchants_products--------------------------------------
|
|
227
|
+
paramsBody = {
|
|
228
|
+
articleId: articleId,
|
|
229
|
+
articleVersion: articleVersion,
|
|
230
|
+
valueType: valueType,
|
|
231
|
+
value: valueInput,
|
|
232
|
+
isOrderProduct: "0",
|
|
233
|
+
};
|
|
234
|
+
paramsHeaders = { Authorization: userToken };
|
|
235
|
+
}
|
|
236
|
+
const response = await fetchPOST(
|
|
237
|
+
process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
|
|
238
|
+
paramsBody,
|
|
239
|
+
paramsHeaders
|
|
240
|
+
);
|
|
241
|
+
if (!response.body) {
|
|
242
|
+
let itemType =
|
|
243
|
+
valueType === "txt"
|
|
244
|
+
? "el mensaje"
|
|
245
|
+
: valueType === "img"
|
|
246
|
+
? "la imagen"
|
|
247
|
+
: "el archivo";
|
|
248
|
+
showModalAlert(
|
|
249
|
+
`No fue posible agregar ${itemType} en el chat`,
|
|
250
|
+
response.errorDetail,
|
|
251
|
+
"error"
|
|
252
|
+
);
|
|
253
|
+
setItems(currentItems);
|
|
254
|
+
} else {
|
|
255
|
+
if (currentItems?.length == 0) {
|
|
256
|
+
// console.log("NUEVO ITEM <> NUEVO INITIAL");
|
|
257
|
+
await getInitial();
|
|
258
|
+
} else {
|
|
259
|
+
// console.log("NUEVO ITEM <> NUEVO UPDATE");
|
|
260
|
+
await getUpdate();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
*/
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
268
|
+
children: (chatContainerType === null || chatContainerType === void 0 ? void 0 : chatContainerType.toLowerCase()) === "fixed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
269
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerFixed, {
|
|
270
|
+
className: classNameContainerFixed,
|
|
271
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContentChat.ContentChat, {
|
|
272
|
+
chatType: chatType === null || chatType === void 0 ? void 0 : chatType.toLowerCase(),
|
|
273
|
+
chatContainerType: "fixed",
|
|
274
|
+
dataChat: data,
|
|
275
|
+
showBtnClose: false
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
279
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerBtnPopUpChat, {
|
|
280
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
281
|
+
className: "container-btn-popUpChat",
|
|
282
|
+
type: "whiteS2",
|
|
283
|
+
size: 14,
|
|
284
|
+
borderType: "circle",
|
|
285
|
+
icon: _freeSolidSvgIcons.faComments,
|
|
286
|
+
onClick: /*#__PURE__*/function () {
|
|
287
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) {
|
|
288
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
289
|
+
while (1) {
|
|
290
|
+
switch (_context.prev = _context.next) {
|
|
291
|
+
case 0:
|
|
292
|
+
setShowPopUpChat(!showPopUpChat);
|
|
293
|
+
|
|
294
|
+
case 1:
|
|
295
|
+
case "end":
|
|
296
|
+
return _context.stop();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}, _callee);
|
|
300
|
+
}));
|
|
301
|
+
|
|
302
|
+
return function (_x) {
|
|
303
|
+
return _ref.apply(this, arguments);
|
|
304
|
+
};
|
|
305
|
+
}()
|
|
306
|
+
})
|
|
307
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Slide, {
|
|
308
|
+
direction: "left",
|
|
309
|
+
in: showPopUpChat,
|
|
310
|
+
timeout: 400,
|
|
311
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerPopUp, {
|
|
312
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContentChat.ContentChat, {
|
|
313
|
+
chatType: chatType === null || chatType === void 0 ? void 0 : chatType.toLowerCase(),
|
|
314
|
+
chatContainerType: "popUp",
|
|
315
|
+
dataChat: data,
|
|
316
|
+
showBtnClose: true,
|
|
317
|
+
onClickBtnClose: function onClickBtnClose() {
|
|
318
|
+
setShowPopUpChat(false);
|
|
319
|
+
}
|
|
320
|
+
})
|
|
321
|
+
})
|
|
322
|
+
})]
|
|
323
|
+
})
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
exports.Chat = Chat;
|
|
@@ -0,0 +1,29 @@
|
|
|
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.ContainerPopUp = exports.ContainerFixed = exports.ContainerBtnPopUpChat = 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, _templateObject2, _templateObject3;
|
|
17
|
+
|
|
18
|
+
// Container para chat fixed
|
|
19
|
+
var ContainerFixed = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: auto;\n max-width: 550px;\n min-width: 325px;\n height: 100%;\n flex-grow: 2;\n background-color: white;\n border: 1px solid #f0f0f0;\n z-index: 1000;\n padding: 0px;\n"])));
|
|
20
|
+
|
|
21
|
+
exports.ContainerFixed = ContainerFixed;
|
|
22
|
+
|
|
23
|
+
var ContainerBtnPopUpChat = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 50%;\n height: 34px;\n width: 34px;\n\n .container-btn-popUpChat {\n height: inherit;\n width: inherit;\n overflow: hidden;\n }\n"])));
|
|
24
|
+
|
|
25
|
+
exports.ContainerBtnPopUpChat = ContainerBtnPopUpChat;
|
|
26
|
+
|
|
27
|
+
var ContainerPopUp = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n top: 20px;\n right: 23px;\n bottom: 20px;\n box-shadow: 0px 2px 10px 0px #00000073;\n z-index: 1000;\n width: calc(100% - 50px);\n max-width: 550px;\n min-width: 325px;\n border-radius: 10px;\n background: white;\n padding: 0px;\n"])));
|
|
28
|
+
|
|
29
|
+
exports.ContainerPopUp = ContainerPopUp;
|
|
@@ -59,6 +59,7 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
59
59
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductNameHeader.ProductNameHeader, {
|
|
60
60
|
productName: (headerData === null || headerData === void 0 ? void 0 : (_headerData$article = headerData.article) === null || _headerData$article === void 0 ? void 0 : _headerData$article.name) || (headerData === null || headerData === void 0 ? void 0 : headerData.name),
|
|
61
61
|
statusType: (headerData === null || headerData === void 0 ? void 0 : headerData.version_status) || (headerData === null || headerData === void 0 ? void 0 : headerData.status) || (headerData === null || headerData === void 0 ? void 0 : headerData.article_status),
|
|
62
|
+
percentRequired: percent,
|
|
62
63
|
percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
|
|
63
64
|
priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
|
|
64
65
|
date: new Date((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp)).toLocaleDateString()
|
|
@@ -0,0 +1,66 @@
|
|
|
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.modalWithButtons = exports.modalDefault = exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var _default = {
|
|
19
|
+
title: "Components/organisms/Modal",
|
|
20
|
+
component: _index.Modal,
|
|
21
|
+
argTypes: {
|
|
22
|
+
icon: {
|
|
23
|
+
options: [undefined, "error", "warning", "success", "info"],
|
|
24
|
+
control: {
|
|
25
|
+
type: "select"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|
|
31
|
+
|
|
32
|
+
var Template = function Template(args) {
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Modal, (0, _objectSpread2.default)({}, args));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var modalDefault = Template.bind({});
|
|
37
|
+
exports.modalDefault = modalDefault;
|
|
38
|
+
modalDefault.args = {
|
|
39
|
+
show: false,
|
|
40
|
+
title: "Titulo del modal",
|
|
41
|
+
icon: undefined,
|
|
42
|
+
message: "descripcion amplia sobre el componente \n\tmodal white para saber como se ven varias lineas\n\tde codigo"
|
|
43
|
+
};
|
|
44
|
+
var modalWithButtons = Template.bind({});
|
|
45
|
+
exports.modalWithButtons = modalWithButtons;
|
|
46
|
+
modalWithButtons.args = {
|
|
47
|
+
show: false,
|
|
48
|
+
title: "Titulo del modal",
|
|
49
|
+
icon: undefined,
|
|
50
|
+
message: "descripcion amplia sobre el componente \n\tmodal white para saber como se ven varias lineas\n\tde codigo",
|
|
51
|
+
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
52
|
+
type: "white",
|
|
53
|
+
label: "Cancelar",
|
|
54
|
+
size: 12,
|
|
55
|
+
onClick: function onClick(event) {
|
|
56
|
+
alert("cancelar");
|
|
57
|
+
}
|
|
58
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
59
|
+
type: "pink",
|
|
60
|
+
label: "Aceptar",
|
|
61
|
+
size: 12,
|
|
62
|
+
onClick: function onClick(event) {
|
|
63
|
+
alert("aceptar");
|
|
64
|
+
}
|
|
65
|
+
}, "btn-Aceptar")]
|
|
66
|
+
};
|