frst-components 0.31.4 → 0.31.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.
- package/dist/index.js +314 -209
- package/dist/src/components/DS/dropdown-Multiselect/index.d.ts +1 -0
- package/dist/src/components/DS/dropdown-Multiselect/index.d.ts.map +1 -1
- package/dist/src/components/DS/dropdown-Multiselect/styles/multiselectStyles.d.ts +2 -1
- package/dist/src/components/DS/dropdown-Multiselect/styles/multiselectStyles.d.ts.map +1 -1
- package/dist/src/components/FI/ThreadComments/index.d.ts +1 -1
- package/dist/src/components/FI/ThreadComments/index.d.ts.map +1 -1
- package/dist/src/components/FI/ThreadComments/threadComments.styles.d.ts +3 -1
- package/dist/src/components/FI/ThreadComments/threadComments.styles.d.ts.map +1 -1
- package/dist/src/components/FI/ThreadComments/utilitiesComponents/commentaryBoxReply/index.d.ts +1 -1
- package/dist/src/components/FI/ThreadComments/utilitiesComponents/commentaryBoxReply/index.d.ts.map +1 -1
- package/dist/src/components/FI/ThreadComments/utilitiesComponents/inputReply/index.d.ts +1 -1
- package/dist/src/components/FI/ThreadComments/utilitiesComponents/inputReply/index.d.ts.map +1 -1
- package/dist/src/components/commentaryBoxV2/CommentaryBoxV2.styles.d.ts +15 -4
- package/dist/src/components/commentaryBoxV2/CommentaryBoxV2.styles.d.ts.map +1 -1
- package/dist/src/components/commentaryBoxV2/index.d.ts +1 -1
- package/dist/src/components/commentaryBoxV2/index.d.ts.map +1 -1
- package/dist/src/components/commentaryBoxV2/utilitiesComponents/inputEdit/index.d.ts +1 -1
- package/dist/src/components/commentaryBoxV2/utilitiesComponents/inputEdit/index.d.ts.map +1 -1
- package/dist/src/components/commentaryBoxV2/utilitiesComponents/inputEdit/inputEdit.styles.d.ts +3 -1
- package/dist/src/components/commentaryBoxV2/utilitiesComponents/inputEdit/inputEdit.styles.d.ts.map +1 -1
- package/dist/src/components/input-comment/index.d.ts +1 -1
- package/dist/src/components/input-comment/index.d.ts.map +1 -1
- package/dist/src/components/input-comment/inputCommentStyles.d.ts +4 -0
- package/dist/src/components/input-comment/inputCommentStyles.d.ts.map +1 -1
- package/dist/src/components/input-comment/mentions.d.ts.map +1 -1
- package/dist/src/components/input-comment/mentionsStyle.d.ts +11 -3
- package/dist/src/components/input-comment/mentionsStyle.d.ts.map +1 -1
- package/dist/src/components/input-comment/useInputHook.d.ts +4 -0
- package/dist/src/components/input-comment/useInputHook.d.ts.map +1 -1
- package/dist/src/components/mini-button/index.d.ts +1 -1
- package/dist/src/components/mini-button/index.d.ts.map +1 -1
- package/dist/src/components/mini-button/miniButtonStyle.d.ts +1 -0
- package/dist/src/components/mini-button/miniButtonStyle.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var Select$4 = require('react-select');
|
|
|
26
26
|
var ReactDOM = require('react-dom');
|
|
27
27
|
var reactToastify = require('react-toastify');
|
|
28
28
|
var CloseIcon$1 = require('@mui/icons-material/Close');
|
|
29
|
+
var EmojiPicker$1 = require('emoji-picker-react');
|
|
29
30
|
var usehooksTs = require('usehooks-ts');
|
|
30
31
|
var ArrowDropUpOutlinedIcon = require('@mui/icons-material/ArrowDropUpOutlined');
|
|
31
32
|
var ArrowDropDownOutlinedIcon = require('@mui/icons-material/ArrowDropDownOutlined');
|
|
@@ -106,6 +107,7 @@ var StepConnector__default = /*#__PURE__*/_interopDefaultLegacy(StepConnector);
|
|
|
106
107
|
var Select__default$1 = /*#__PURE__*/_interopDefaultLegacy(Select$4);
|
|
107
108
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
108
109
|
var CloseIcon__default = /*#__PURE__*/_interopDefaultLegacy(CloseIcon$1);
|
|
110
|
+
var EmojiPicker__default = /*#__PURE__*/_interopDefaultLegacy(EmojiPicker$1);
|
|
109
111
|
var ArrowDropUpOutlinedIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowDropUpOutlinedIcon);
|
|
110
112
|
var ArrowDropDownOutlinedIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowDropDownOutlinedIcon);
|
|
111
113
|
var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
|
|
@@ -3684,30 +3686,29 @@ const MenuCustom$2 = styled__default["default"](Menu__default["default"]) `
|
|
|
3684
3686
|
border-radius: 8px !important;
|
|
3685
3687
|
box-shadow: 0px 15px 20px -20px rgba(34, 34, 34, 0.15), 0px 3px 10px 0px rgba(0, 0, 0, 0.15);
|
|
3686
3688
|
overflow: visible;
|
|
3687
|
-
background: #00000000;
|
|
3688
|
-
${({ isArrowInMenu }) => isArrowInMenu &&
|
|
3689
|
+
background: ${({ isDarkMode }) => isDarkMode ? '#1f1f1f' : '#00000000'};
|
|
3690
|
+
${({ isArrowInMenu, isDarkMode }) => isArrowInMenu &&
|
|
3689
3691
|
`&:before {
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3692
|
+
content: "";
|
|
3693
|
+
position: absolute;
|
|
3694
|
+
top: -15px;
|
|
3695
|
+
right: 8.5px;
|
|
3696
|
+
border-top: 6px solid transparent;
|
|
3697
|
+
border-bottom: 10px solid ${isDarkMode ? '#1f1f1f' : '#EBEBEB'};
|
|
3698
|
+
border-left: 8px solid transparent;
|
|
3699
|
+
border-right: 8px solid transparent;
|
|
3700
|
+
}
|
|
3699
3701
|
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
}`}
|
|
3702
|
+
&:after {
|
|
3703
|
+
content: "";
|
|
3704
|
+
position: absolute;
|
|
3705
|
+
top: -14px;
|
|
3706
|
+
right: 8.5px;
|
|
3707
|
+
border-top: 6px solid transparent;
|
|
3708
|
+
border-bottom: 10px solid ${isDarkMode ? '#1f1f1f' : '#FFF'};
|
|
3709
|
+
border-left: 8px solid transparent;
|
|
3710
|
+
border-right: 8px solid transparent;
|
|
3711
|
+
}`}
|
|
3711
3712
|
}
|
|
3712
3713
|
ul {
|
|
3713
3714
|
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.15), 0px 15px 20px -20px rgba(34, 34, 34, 0.15);
|
|
@@ -3801,7 +3802,7 @@ function MenuMore({ iconButton, options, style, closeAfterClick, isHover = true,
|
|
|
3801
3802
|
const handleClose = () => {
|
|
3802
3803
|
setAnchorEl(null);
|
|
3803
3804
|
};
|
|
3804
|
-
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs("div", { style: { ...style }, children: [jsxRuntime.jsx(ButtonMore$2, { id: "basic-button", disableRipple: isHover ? false : true, "aria-controls": "basic-menu", "aria-haspopup": "true", "aria-expanded": open ? 'true' : undefined, onClick: handleClick, children: iconButton ? iconButton : jsxRuntime.jsx(MoreDotsVertical, { fill: "#444" }) }), listOptions && listOptions?.length > 0 && (jsxRuntime.jsx(MenuCustom$2, { id: "basic-menu", anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, anchorEl: anchorEl, open: open, onClose: handleClose, isArrowInMenu: isArrowInMenu, isPaddingInMenu: isPaddingInMenu, isDarkMode: isDarkMode, children: listOptions.map((itemOption, index) => {
|
|
3805
|
+
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs("div", { style: { ...style }, children: [jsxRuntime.jsx(ButtonMore$2, { id: "basic-button", disableRipple: isHover ? false : true, "aria-controls": "basic-menu", "aria-haspopup": "true", "aria-expanded": open ? 'true' : undefined, onClick: handleClick, children: iconButton ? iconButton : jsxRuntime.jsx(MoreDotsVertical, { fill: isDarkMode ? "#EBEBEB" : "#444" }) }), listOptions && listOptions?.length > 0 && (jsxRuntime.jsx(MenuCustom$2, { id: "basic-menu", anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, anchorEl: anchorEl, open: open, onClose: handleClose, isArrowInMenu: isArrowInMenu, isPaddingInMenu: isPaddingInMenu, isDarkMode: isDarkMode, children: listOptions.map((itemOption, index) => {
|
|
3805
3806
|
return (jsxRuntime.jsx(material.Box, { children: jsxRuntime.jsxs(ButtonMenuNotification, { onClick: () => {
|
|
3806
3807
|
itemOption?.onClick();
|
|
3807
3808
|
closeAfterClick && handleClose();
|
|
@@ -4396,7 +4397,7 @@ const InputWrapper$2 = styled__default["default"].div `
|
|
|
4396
4397
|
width: 100%;
|
|
4397
4398
|
min-height: 48px;
|
|
4398
4399
|
position: 'relative';
|
|
4399
|
-
background-color: ${({ theme, isInputLimit }) => !isInputLimit ? theme.colors.neutralsGrey9 : theme.colors.inputError};
|
|
4400
|
+
background-color: ${({ theme, isInputLimit, darkMode }) => !isInputLimit ? (darkMode ? '#272727' : theme.colors.neutralsGrey9) : (darkMode ? '#272727' : theme.colors.inputError)};
|
|
4400
4401
|
|
|
4401
4402
|
border-radius: 24px;
|
|
4402
4403
|
|
|
@@ -4404,10 +4405,10 @@ const InputWrapper$2 = styled__default["default"].div `
|
|
|
4404
4405
|
|
|
4405
4406
|
|
|
4406
4407
|
|
|
4407
|
-
border: ${({ theme, isPlaceholder, isInputLimit }) => isInputLimit ? `2px solid ${theme.colors.messageError3} !important` : !isPlaceholder ? `1px solid ${theme.colors.neutralsGrey5} !important` : `1px solid ${theme.colors.neutralsGrey5} !important`};
|
|
4408
|
+
border: ${({ theme, isPlaceholder, isInputLimit, darkMode }) => isInputLimit ? `2px solid ${theme.colors.messageError3} !important` : !isPlaceholder ? (darkMode ? `2px solid ${theme.colors.neutralsGrey4}` : `1px solid ${theme.colors.neutralsGrey5} !important`) : `1px solid ${darkMode ? '#272727' : theme.colors.neutralsGrey5} !important`};
|
|
4408
4409
|
|
|
4409
4410
|
&:hover {
|
|
4410
|
-
border: 2px solid ${({ theme, isInputLimit }) => isInputLimit ? theme.colors.messageError3 : theme.colors.neutralsGrey5} !important;
|
|
4411
|
+
border: 2px solid ${({ theme, isInputLimit, darkMode, isPlaceholder }) => isInputLimit ? theme.colors.messageError3 : !isPlaceholder ? (theme.colors.neutralsGrey4) : (darkMode ? '#444444' : theme.colors.neutralsGrey5)} !important;
|
|
4411
4412
|
}
|
|
4412
4413
|
|
|
4413
4414
|
`;
|
|
@@ -4415,7 +4416,7 @@ const InputText$4 = styled__default["default"].div `
|
|
|
4415
4416
|
width: 100%;
|
|
4416
4417
|
height: ${({ height }) => height || '20px'};
|
|
4417
4418
|
outline: 0;
|
|
4418
|
-
color: ${({ theme }) => theme.colors.neutralsGrey1};
|
|
4419
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.shadeWhite : theme.colors.neutralsGrey1};
|
|
4419
4420
|
font-family: 'Work Sans';
|
|
4420
4421
|
font-style: normal;
|
|
4421
4422
|
font-weight: normal;
|
|
@@ -4425,7 +4426,7 @@ const InputText$4 = styled__default["default"].div `
|
|
|
4425
4426
|
overflow: hidden;
|
|
4426
4427
|
background-color: inherit;
|
|
4427
4428
|
word-break: break-word;
|
|
4428
|
-
|
|
4429
|
+
caret-color: ${({ theme, darkMode }) => darkMode && theme.colors.shadeWhite};
|
|
4429
4430
|
|
|
4430
4431
|
padding: 0;
|
|
4431
4432
|
margin: 10px 4px 40px 15px;
|
|
@@ -4469,7 +4470,7 @@ styled__default["default"].div `
|
|
|
4469
4470
|
transition: all 0.2s ease-in-out;
|
|
4470
4471
|
`;
|
|
4471
4472
|
const HelperContainer = styled__default["default"].div `
|
|
4472
|
-
position:relative;
|
|
4473
|
+
position: relative;
|
|
4473
4474
|
padding: 5px;
|
|
4474
4475
|
`;
|
|
4475
4476
|
const HelperText$2 = styled__default["default"].span `
|
|
@@ -4485,12 +4486,19 @@ const HelperText$2 = styled__default["default"].span `
|
|
|
4485
4486
|
|
|
4486
4487
|
letter-spacing: -0.02em;
|
|
4487
4488
|
|
|
4488
|
-
color: ${({ theme, isInputLimit }) => isInputLimit
|
|
4489
|
+
color: ${({ theme, isInputLimit, darkMode }) => isInputLimit ? theme.colors.messageError3 : darkMode ? theme.colors.neutralsGrey3 : theme.colors.neutralsGrey2};
|
|
4489
4490
|
|
|
4490
4491
|
|
|
4491
4492
|
top:-30px;
|
|
4492
4493
|
margin-left: 13px;
|
|
4493
4494
|
`;
|
|
4495
|
+
const EmojiWrapper = styled__default["default"].div `
|
|
4496
|
+
display: flex;
|
|
4497
|
+
flex-direction: column;
|
|
4498
|
+
position: absolute;
|
|
4499
|
+
top: -45px;
|
|
4500
|
+
right: 13px;
|
|
4501
|
+
`;
|
|
4494
4502
|
styled__default["default"].div `
|
|
4495
4503
|
width: 310px;
|
|
4496
4504
|
height: 432px;
|
|
@@ -4526,6 +4534,7 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
|
|
|
4526
4534
|
const [isPlaceholder, setPlaceholder] = React.useState(false);
|
|
4527
4535
|
const [styleLimitExceeded, setStyleLimitExceeded] = React.useState(false);
|
|
4528
4536
|
const [mentionedIds, setMentionedIds] = React.useState([]);
|
|
4537
|
+
const [showPicker, setShowPicker] = React.useState(false);
|
|
4529
4538
|
const createNewRangeAndMoveCursorToTheEnd = (selection, spaceNode) => {
|
|
4530
4539
|
// Create a new range for setting the cursor position
|
|
4531
4540
|
const newRange = document.createRange();
|
|
@@ -4715,6 +4724,14 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
|
|
|
4715
4724
|
};
|
|
4716
4725
|
const handlePlaceholderInputText = (isPlaceHolderFocus = false) => {
|
|
4717
4726
|
setTimeout(() => {
|
|
4727
|
+
// Check if the click was on the emoji button or picker
|
|
4728
|
+
const target = document.activeElement;
|
|
4729
|
+
const isEmojiButton = target?.closest('.MuiIconButton-root');
|
|
4730
|
+
const isEmojiPicker = target?.closest('.EmojiPickerReact');
|
|
4731
|
+
const isEmojiWrapper = target?.closest('.emoji-wrapper');
|
|
4732
|
+
if (isEmojiButton || isEmojiPicker || isEmojiWrapper) {
|
|
4733
|
+
return;
|
|
4734
|
+
}
|
|
4718
4735
|
if (document.activeElement?.id === 'input-comment-component')
|
|
4719
4736
|
return;
|
|
4720
4737
|
// if divInputRef has any element hide the placeholder
|
|
@@ -4751,6 +4768,16 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
|
|
|
4751
4768
|
});
|
|
4752
4769
|
return mentionedUsersIdList;
|
|
4753
4770
|
};
|
|
4771
|
+
const handleEmojiSelected = (emojiData, event) => {
|
|
4772
|
+
if (divInputRef.current) {
|
|
4773
|
+
divInputRef.current.appendChild(document.createTextNode(emojiData.emoji));
|
|
4774
|
+
// Update input state
|
|
4775
|
+
countChars();
|
|
4776
|
+
createFormatAndTextContentToSaveComment();
|
|
4777
|
+
resizeDiv();
|
|
4778
|
+
setShowPicker(false);
|
|
4779
|
+
}
|
|
4780
|
+
};
|
|
4754
4781
|
React.useEffect(() => {
|
|
4755
4782
|
if (divInputRef.current && initialText) {
|
|
4756
4783
|
divInputRef.current.innerHTML = initialText;
|
|
@@ -4895,7 +4922,10 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
|
|
|
4895
4922
|
textLength,
|
|
4896
4923
|
isPlaceholder,
|
|
4897
4924
|
styleLimitExceeded,
|
|
4898
|
-
divPlaceholder
|
|
4925
|
+
divPlaceholder,
|
|
4926
|
+
handleEmojiSelected,
|
|
4927
|
+
showPicker,
|
|
4928
|
+
setShowPicker
|
|
4899
4929
|
};
|
|
4900
4930
|
};
|
|
4901
4931
|
|
|
@@ -4904,7 +4934,7 @@ const DefaultProfile = ({ className, size = 40 }) => {
|
|
|
4904
4934
|
};
|
|
4905
4935
|
|
|
4906
4936
|
const Container$r = styled__default["default"].div `
|
|
4907
|
-
background-color: #ffff;
|
|
4937
|
+
background-color: ${({ darkMode }) => darkMode ? '#323232' : '#ffff'} ;
|
|
4908
4938
|
display: ${({ hide }) => hide ? 'none' : 'flex'};
|
|
4909
4939
|
justify-content: center;
|
|
4910
4940
|
align-items: center;
|
|
@@ -4917,7 +4947,7 @@ const Container$r = styled__default["default"].div `
|
|
|
4917
4947
|
overflow-x: hidden;
|
|
4918
4948
|
z-index: 100;
|
|
4919
4949
|
border-radius: 8px;
|
|
4920
|
-
box-shadow: 4px 8px 10px 0 #BDBDBD;
|
|
4950
|
+
box-shadow: ${({ darkMode }) => darkMode ? '4px 8px 10px 0px #0000004D' : '4px 8px 10px 0 #BDBDBD'};
|
|
4921
4951
|
|
|
4922
4952
|
::-webkit-scrollbar {
|
|
4923
4953
|
width: 17px;
|
|
@@ -4951,15 +4981,15 @@ const MentionItem = styled__default["default"].div `
|
|
|
4951
4981
|
align-items: center;
|
|
4952
4982
|
justify-content: flex-start;
|
|
4953
4983
|
padding: 8px;
|
|
4954
|
-
border-bottom:${({ theme }) => `0.5px solid ${theme.colors.neutralsGrey5}`};
|
|
4984
|
+
border-bottom:${({ theme, darkMode }) => `0.5px solid ${darkMode ? theme.colors.neutralsGrey3 : theme.colors.neutralsGrey5}`};
|
|
4955
4985
|
&:last-child {
|
|
4956
4986
|
border-bottom: none; /* Remove the border for the last child */
|
|
4957
4987
|
}
|
|
4958
4988
|
&:hover {
|
|
4959
|
-
background-color:${({ active }) => active ? '#FCF3EB' : '#F1F5F9'};
|
|
4989
|
+
background-color:${({ active, darkMode }) => active ? (darkMode ? '#3D3D3D' : '#FCF3EB') : (darkMode ? '#3D3D3D' : '#F1F5F9')};
|
|
4960
4990
|
}
|
|
4961
4991
|
&:focus{
|
|
4962
|
-
background-color:${({ active }) => active ? '#FCF3EB' : '#F1F5F9'};
|
|
4992
|
+
background-color:${({ active, darkMode }) => active ? (darkMode ? '#4B4B4B' : '#FCF3EB') : (darkMode ? '#4B4B4B' : '#F1F5F9')};
|
|
4963
4993
|
}
|
|
4964
4994
|
|
|
4965
4995
|
|
|
@@ -4986,14 +5016,14 @@ const MentionUserContainer = styled__default["default"].div `
|
|
|
4986
5016
|
const MentionUserName = styled__default["default"].span `
|
|
4987
5017
|
font-weight: 400;
|
|
4988
5018
|
font-size: 16px;
|
|
4989
|
-
|
|
5019
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.shadeWhite : '#343434'};
|
|
4990
5020
|
`;
|
|
4991
5021
|
const MentionSubTitleContainer = styled__default["default"].div `
|
|
4992
5022
|
margin-top: 2px;
|
|
4993
5023
|
display: flex;
|
|
4994
5024
|
justify-content: center;
|
|
4995
5025
|
align-items: center;
|
|
4996
|
-
color: ${({ theme }) => theme.colors.neutralsGrey3};
|
|
5026
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.neutralsGrey5 : theme.colors.neutralsGrey3};
|
|
4997
5027
|
font-weight: 400;
|
|
4998
5028
|
`;
|
|
4999
5029
|
const MentionSubTitleText = styled__default["default"].span `
|
|
@@ -5008,12 +5038,12 @@ const Circle = styled__default["default"].div `
|
|
|
5008
5038
|
height: 4px;
|
|
5009
5039
|
border-radius: 50%;
|
|
5010
5040
|
font-weight: 400;
|
|
5011
|
-
background-color: ${({ theme }) => theme.colors.neutralsGrey3};
|
|
5012
|
-
color: ${({ theme }) => theme.colors.neutralsGrey3};
|
|
5041
|
+
background-color: ${({ theme, darkMode }) => darkMode ? theme.colors.neutralsGrey5 : theme.colors.neutralsGrey3};
|
|
5042
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.neutralsGrey5 : theme.colors.neutralsGrey3};
|
|
5013
5043
|
margin: 0 8px;
|
|
5014
5044
|
`;
|
|
5015
5045
|
const CompanyName = styled__default["default"].span `
|
|
5016
|
-
|
|
5046
|
+
white-space: nowrap;
|
|
5017
5047
|
overflow: hidden;
|
|
5018
5048
|
text-overflow: ellipsis;
|
|
5019
5049
|
max-width: 50%;
|
|
@@ -5064,18 +5094,21 @@ const useMentions = (mention) => {
|
|
|
5064
5094
|
|
|
5065
5095
|
const Mentions = (mention) => {
|
|
5066
5096
|
const { selectedUser, setSelectedUser, mentionListRef } = useMentions(mention);
|
|
5067
|
-
const { top, users } = mention;
|
|
5068
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Container$r, { top: top, tabIndex: 0, hide: !users || users.length <= 0, children: jsxRuntime.jsx(MentionList, { tabIndex: 1, ref: mentionListRef, children: users?.map((user, index) => {
|
|
5097
|
+
const { top, users, darkMode } = mention;
|
|
5098
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Container$r, { top: top, tabIndex: 0, hide: !users || users.length <= 0, darkMode: darkMode, children: jsxRuntime.jsx(MentionList, { tabIndex: 1, ref: mentionListRef, children: users?.map((user, index) => {
|
|
5069
5099
|
return (jsxRuntime.jsxs(MentionItem, { tabIndex: index += 2, active: user.user_uuid === selectedUser?.user_uuid, onMouseDown: () => setSelectedUser(user), onKeyUpCapture: (e) => {
|
|
5070
5100
|
if (e.key.toLowerCase() === 'enter') {
|
|
5071
5101
|
setSelectedUser(user);
|
|
5072
5102
|
}
|
|
5073
|
-
}, children: [!!user.profile.avatar && !!user.profile.avatar.length ? jsxRuntime.jsx(MentionAvatar, { src: user.profile.avatar }) : jsxRuntime.jsx(DefaultAvatar, { children: jsxRuntime.jsx(DefaultProfile, {}) }), jsxRuntime.jsxs(MentionUserContainer, { children: [jsxRuntime.jsx(MentionUserName, { children: user.name }), jsxRuntime.jsx(MentionSubTitleContainer, { children: jsxRuntime.jsxs(MentionSubTitleText, { children: [user.profile.role_name, " ", jsxRuntime.jsx(Circle, {}), jsxRuntime.jsx(CompanyName, { children: user.profile.company_name })] }) })] })] }, user.user_uuid));
|
|
5103
|
+
}, darkMode: darkMode, children: [!!user.profile.avatar && !!user.profile.avatar.length ? jsxRuntime.jsx(MentionAvatar, { src: user.profile.avatar }) : jsxRuntime.jsx(DefaultAvatar, { children: jsxRuntime.jsx(DefaultProfile, {}) }), jsxRuntime.jsxs(MentionUserContainer, { children: [jsxRuntime.jsx(MentionUserName, { darkMode: darkMode, children: user.name }), jsxRuntime.jsx(MentionSubTitleContainer, { darkMode: darkMode, children: jsxRuntime.jsxs(MentionSubTitleText, { children: [user.profile.role_name, " ", jsxRuntime.jsx(Circle, { darkMode: darkMode }), jsxRuntime.jsx(CompanyName, { children: user.profile.company_name })] }) })] })] }, user.user_uuid));
|
|
5074
5104
|
}) }) }) }));
|
|
5075
5105
|
};
|
|
5076
5106
|
|
|
5077
|
-
function
|
|
5078
|
-
|
|
5107
|
+
function EmojiIcon() {
|
|
5108
|
+
return (jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("mask", { id: "path-1-inside-1_2339_11367", fill: "white", children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM16.8474 14.9845C16.2991 16.7176 14.3368 18 12 18C9.66322 18 7.70085 16.7176 7.15257 14.9845C6.98599 14.4579 7.44772 14 8 14H16C16.5523 14 17.014 14.4579 16.8474 14.9845ZM15.75 9.8125C15.75 11.0206 15.75 12 14.8125 12C13.875 12 13.875 11.0206 13.875 9.8125C13.875 8.60438 13.875 7.625 14.8125 7.625C15.75 7.625 15.75 8.60438 15.75 9.8125ZM9.1875 12C10.125 12 10.125 11.0206 10.125 9.8125C10.125 8.60438 10.125 7.625 9.1875 7.625C8.25 7.625 8.25 8.60438 8.25 9.8125C8.25 11.0206 8.25 12 9.1875 12Z" }) }), jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM16.8474 14.9845C16.2991 16.7176 14.3368 18 12 18C9.66322 18 7.70085 16.7176 7.15257 14.9845C6.98599 14.4579 7.44772 14 8 14H16C16.5523 14 17.014 14.4579 16.8474 14.9845ZM15.75 9.8125C15.75 11.0206 15.75 12 14.8125 12C13.875 12 13.875 11.0206 13.875 9.8125C13.875 8.60438 13.875 7.625 14.8125 7.625C15.75 7.625 15.75 8.60438 15.75 9.8125ZM9.1875 12C10.125 12 10.125 11.0206 10.125 9.8125C10.125 8.60438 10.125 7.625 9.1875 7.625C8.25 7.625 8.25 8.60438 8.25 9.8125C8.25 11.0206 8.25 12 9.1875 12Z", fill: "#BDBDBD" }), jsxRuntime.jsx("path", { d: "M16.8474 14.9845L17.9915 15.3464L16.8474 14.9845ZM7.15257 14.9845L8.29668 14.6225L7.15257 14.9845ZM22 12H20.8C20.8 16.8601 16.8601 20.8 12 20.8V22V23.2C18.1856 23.2 23.2 18.1856 23.2 12H22ZM12 2V3.2C16.8601 3.2 20.8 7.13989 20.8 12H22H23.2C23.2 5.81441 18.1856 0.8 12 0.8V2ZM2 12H3.2C3.2 7.13989 7.13989 3.2 12 3.2V2V0.8C5.81441 0.8 0.8 5.81441 0.8 12H2ZM12 22V20.8C7.13989 20.8 3.2 16.8601 3.2 12H2H0.8C0.8 18.1856 5.81441 23.2 12 23.2V22ZM12 18V19.2C14.7165 19.2 17.246 17.703 17.9915 15.3464L16.8474 14.9845L15.7033 14.6225C15.3523 15.7321 13.9571 16.8 12 16.8V18ZM7.15257 14.9845L6.00846 15.3464C6.75399 17.703 9.28353 19.2 12 19.2V18V16.8C10.0429 16.8 8.64771 15.7321 8.29668 14.6225L7.15257 14.9845ZM8 14V12.8C7.40113 12.8 6.81957 13.046 6.41813 13.4883C5.99732 13.9519 5.78348 14.6353 6.00846 15.3464L7.15257 14.9845L8.29668 14.6225C8.32033 14.6973 8.32712 14.7933 8.30296 14.8925C8.27988 14.9873 8.23568 15.0568 8.19529 15.1013C8.12114 15.183 8.04658 15.2 8 15.2V14ZM16 14V12.8H8V14V15.2H16V14ZM16.8474 14.9845L17.9915 15.3464C18.2165 14.6353 18.0027 13.9519 17.5819 13.4883C17.1804 13.046 16.5989 12.8 16 12.8V14V15.2C15.9534 15.2 15.8789 15.183 15.8047 15.1013C15.7643 15.0568 15.7201 14.9873 15.697 14.8925C15.6729 14.7933 15.6797 14.6973 15.7033 14.6225L16.8474 14.9845ZM14.8125 12V13.2C15.2663 13.2 15.7345 13.076 16.1261 12.7471C16.4999 12.4332 16.6853 12.0316 16.7835 11.6999C16.9615 11.0986 16.95 10.3466 16.95 9.8125H15.75H14.55C14.55 10.1229 14.5496 10.3752 14.5372 10.5969C14.5246 10.8228 14.5021 10.9515 14.4822 11.0187C14.4632 11.0828 14.4727 11.0016 14.5829 10.9091C14.7109 10.8016 14.8274 10.8 14.8125 10.8V12ZM13.875 9.8125H12.675C12.675 10.3466 12.6635 11.0986 12.8415 11.6999C12.9397 12.0316 13.1251 12.4332 13.4989 12.7471C13.8905 13.076 14.3587 13.2 14.8125 13.2V12V10.8C14.7976 10.8 14.9141 10.8016 15.0421 10.9091C15.1523 11.0016 15.1618 11.0828 15.1428 11.0187C15.1229 10.9515 15.1004 10.8228 15.0878 10.5969C15.0754 10.3752 15.075 10.1229 15.075 9.8125H13.875ZM14.8125 7.625V6.425C14.3587 6.425 13.8905 6.54904 13.4989 6.87789C13.1251 7.19177 12.9397 7.59337 12.8415 7.92508C12.6635 8.52636 12.675 9.27835 12.675 9.8125H13.875H15.075C15.075 9.50214 15.0754 9.24985 15.0878 9.02809C15.1004 8.80222 15.1229 8.6735 15.1428 8.60633C15.1618 8.54218 15.1523 8.62343 15.0421 8.71592C14.9141 8.82338 14.7976 8.825 14.8125 8.825V7.625ZM15.75 9.8125H16.95C16.95 9.27835 16.9615 8.52636 16.7835 7.92508C16.6853 7.59337 16.4999 7.19177 16.1261 6.87789C15.7345 6.54904 15.2663 6.425 14.8125 6.425V7.625V8.825C14.8274 8.825 14.7109 8.82338 14.5829 8.71592C14.4727 8.62343 14.4632 8.54218 14.4822 8.60633C14.5021 8.6735 14.5246 8.80222 14.5372 9.02809C14.5496 9.24985 14.55 9.50214 14.55 9.8125H15.75ZM10.125 9.8125H8.925C8.925 10.1229 8.92464 10.3752 8.91223 10.5969C8.89958 10.8228 8.87706 10.9515 8.85717 11.0187C8.83818 11.0828 8.84771 11.0016 8.95786 10.9091C9.08585 10.8016 9.20243 10.8 9.1875 10.8V12V13.2C9.64132 13.2 10.1095 13.076 10.5011 12.7471C10.8749 12.4332 11.0603 12.0316 11.1585 11.6999C11.3365 11.0986 11.325 10.3466 11.325 9.8125H10.125ZM9.1875 7.625V8.825C9.20243 8.825 9.08585 8.82338 8.95786 8.71592C8.84771 8.62343 8.83818 8.54218 8.85717 8.60633C8.87706 8.6735 8.89958 8.80222 8.91223 9.02809C8.92464 9.24985 8.925 9.50214 8.925 9.8125H10.125H11.325C11.325 9.27835 11.3365 8.52636 11.1585 7.92508C11.0603 7.59337 10.8749 7.19177 10.5011 6.87789C10.1095 6.54904 9.64132 6.425 9.1875 6.425V7.625ZM8.25 9.8125H9.45C9.45 9.50214 9.45036 9.24985 9.46277 9.02809C9.47542 8.80222 9.49794 8.6735 9.51783 8.60633C9.53682 8.54218 9.52729 8.62343 9.41714 8.71592C9.28915 8.82338 9.17257 8.825 9.1875 8.825V7.625V6.425C8.73368 6.425 8.26554 6.54904 7.87388 6.87789C7.50005 7.19177 7.31474 7.59337 7.21655 7.92508C7.03855 8.52636 7.05 9.27835 7.05 9.8125H8.25ZM9.1875 12V10.8C9.17257 10.8 9.28915 10.8016 9.41714 10.9091C9.52729 11.0016 9.53682 11.0828 9.51783 11.0187C9.49794 10.9515 9.47542 10.8228 9.46277 10.5969C9.45036 10.3752 9.45 10.1229 9.45 9.8125H8.25H7.05C7.05 10.3466 7.03855 11.0986 7.21655 11.6999C7.31474 12.0316 7.50005 12.4332 7.87388 12.7471C8.26554 13.076 8.73368 13.2 9.1875 13.2V12Z", fill: "#BDBDBD", mask: "url(#path-1-inside-1_2339_11367)" })] }));
|
|
5109
|
+
}
|
|
5110
|
+
function InputComment$1({ placeholder, onChange, limit, users, showCharacterCounter, styles, onSendMentions, onContentFormat, onContentUnformat, disabled, className, value, replyMentionedUser, group_uuid, limitMessageExceeded, initialText, darkMode, showEmojiPicker }) {
|
|
5111
|
+
const { divPlaceholder, handleInput, isPlaceholder, divInputRef, handleMentionUser, mentionTopPosition, setShowMention, showMention, textLength, styleLimitExceeded, handleEmojiSelected, showPicker, setShowPicker } = useInputHook({
|
|
5079
5112
|
limit,
|
|
5080
5113
|
placeholder,
|
|
5081
5114
|
onContentFormat,
|
|
@@ -5106,12 +5139,25 @@ function InputComment$1({ placeholder, onChange, limit, users, showCharacterCoun
|
|
|
5106
5139
|
const removeFormatting = (text) => {
|
|
5107
5140
|
return text?.replace(/<[^>]*>/g, '');
|
|
5108
5141
|
};
|
|
5109
|
-
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs("div", { style: { minHeight: '48px', ...styles }, tabIndex: 0, onMouseDown: () => divPlaceholder.current.focus(), children: [jsxRuntime.jsxs(InputWrapper$2, { tabIndex: 1, isPlaceholder: isPlaceholder, isInputLimit: styleLimitExceeded, onMouseDown: () => divPlaceholder.current.focus(), children: [jsxRuntime.jsx(InputText$4, { id: "input-comment-component", tabIndex: 2, contentEditable: true, ref: divInputRef, onKeyUpCapture: (event) => {
|
|
5142
|
+
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs("div", { style: { minHeight: '48px', ...styles }, tabIndex: 0, onMouseDown: () => divPlaceholder.current.focus(), children: [jsxRuntime.jsxs(InputWrapper$2, { tabIndex: 1, isPlaceholder: isPlaceholder, isInputLimit: styleLimitExceeded, onMouseDown: () => divPlaceholder.current.focus(), darkMode: darkMode, children: [jsxRuntime.jsx(InputText$4, { id: "input-comment-component", tabIndex: 2, contentEditable: true, ref: divInputRef, onKeyUpCapture: (event) => {
|
|
5110
5143
|
handleInput(event);
|
|
5111
|
-
}, "data-text": "enter", suppressContentEditableWarning: true, onPaste: handlePaste,
|
|
5144
|
+
}, "data-text": "enter", suppressContentEditableWarning: true, onPaste: handlePaste, darkMode: darkMode }), jsxRuntime.jsx(InputPlaceholder, { style: { display: 'none' }, contentEditable: true, ref: divPlaceholder, children: placeholder }), showMention && users && users.length > 0 && (jsxRuntime.jsx(Mentions, { users: users, top: mentionTopPosition, onSelect: (user) => {
|
|
5112
5145
|
setShowMention(false);
|
|
5113
5146
|
handleMentionUser(user);
|
|
5114
|
-
} }))] }), jsxRuntime.
|
|
5147
|
+
}, darkMode: darkMode }))] }), jsxRuntime.jsxs(HelperContainer, { children: [!isPlaceholder && showCharacterCounter && (jsxRuntime.jsxs(HelperText$2, { isInputLimit: styleLimitExceeded, darkMode: darkMode, children: [textLength, "/", limit] })), !isPlaceholder && showEmojiPicker &&
|
|
5148
|
+
jsxRuntime.jsx(EmojiWrapper, { children: jsxRuntime.jsx(material.IconButton, { onClick: (e) => {
|
|
5149
|
+
e.preventDefault();
|
|
5150
|
+
e.stopPropagation();
|
|
5151
|
+
setShowPicker(!showPicker);
|
|
5152
|
+
}, children: jsxRuntime.jsx(EmojiIcon, {}) }) }), !isPlaceholder && showEmojiPicker &&
|
|
5153
|
+
jsxRuntime.jsx("div", { onClick: (e) => {
|
|
5154
|
+
e.preventDefault();
|
|
5155
|
+
e.stopPropagation();
|
|
5156
|
+
}, children: jsxRuntime.jsx(EmojiPicker__default["default"], { theme: darkMode ? EmojiPicker$1.Theme.DARK : EmojiPicker$1.Theme.LIGHT, autoFocusSearch: true, onEmojiClick: (emojiData, event) => {
|
|
5157
|
+
event.preventDefault();
|
|
5158
|
+
event.stopPropagation();
|
|
5159
|
+
handleEmojiSelected(emojiData, event);
|
|
5160
|
+
}, open: showPicker, skinTonesDisabled: true, style: { position: 'absolute', right: 0 } }) })] }), styleLimitExceeded && (jsxRuntime.jsxs(LimitCharsContainer$1, { children: [jsxRuntime.jsx(TagAlert, {}), jsxRuntime.jsx(LimitCharsExceededMessage$1, { children: limitMessageExceeded })] }))] }) }));
|
|
5115
5161
|
}
|
|
5116
5162
|
|
|
5117
5163
|
const HeaderWrapper$1 = styled__default["default"].div `
|
|
@@ -5583,17 +5629,17 @@ const Box = styled__default["default"].div `
|
|
|
5583
5629
|
justify-content: center;
|
|
5584
5630
|
align-items: flex-start;
|
|
5585
5631
|
border-radius: 0px 16px 16px 16px;
|
|
5586
|
-
background-color: #f2f2f2 ;
|
|
5632
|
+
background-color: ${({ darkMode }) => darkMode ? '#272727' : '#f2f2f2'} ;
|
|
5587
5633
|
`;
|
|
5588
5634
|
const UserDataContainer = styled__default["default"].div `
|
|
5589
5635
|
display:flex;
|
|
5590
5636
|
flex-direction: column;
|
|
5591
5637
|
width: 100%;
|
|
5592
|
-
|
|
5638
|
+
height: 34px;
|
|
5593
5639
|
margin-bottom: 8px;
|
|
5594
5640
|
`;
|
|
5595
5641
|
const Username = styled__default["default"].h2 `
|
|
5596
|
-
color:
|
|
5642
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.shadeWhite : theme.colors.neutralsGrey1};
|
|
5597
5643
|
font-family: PT Sans;
|
|
5598
5644
|
font-size: 16px;
|
|
5599
5645
|
font-style: normal;
|
|
@@ -5606,8 +5652,8 @@ const FirstChildUserData = styled__default["default"].div `
|
|
|
5606
5652
|
justify-content: space-between;
|
|
5607
5653
|
`;
|
|
5608
5654
|
const UserDataLastChild = styled__default["default"].div `
|
|
5609
|
-
display:flex;
|
|
5610
|
-
color: ${({ theme }) => theme.colors.neutralsGrey3};
|
|
5655
|
+
display: flex;
|
|
5656
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.neutralsGrey4 : theme.colors.neutralsGrey3};
|
|
5611
5657
|
font-family: PT Sans;
|
|
5612
5658
|
font-size: 12px;
|
|
5613
5659
|
font-style: normal;
|
|
@@ -5615,21 +5661,20 @@ const UserDataLastChild = styled__default["default"].div `
|
|
|
5615
5661
|
line-height: normal;
|
|
5616
5662
|
`;
|
|
5617
5663
|
const MenuMoreContainer = styled__default["default"].div `
|
|
5618
|
-
border-radius:
|
|
5619
|
-
height:
|
|
5620
|
-
width:
|
|
5664
|
+
border-radius: 50%;
|
|
5665
|
+
height: 36px;
|
|
5666
|
+
width: 36px;
|
|
5621
5667
|
display: flex;
|
|
5622
5668
|
align-items: center;
|
|
5623
5669
|
justify-content: center;
|
|
5624
5670
|
margin-top: 5px;
|
|
5625
|
-
padding: 4px;
|
|
5626
5671
|
|
|
5627
5672
|
&:hover {
|
|
5628
|
-
background-color: #f2f2f2;
|
|
5673
|
+
background-color: ${({ darkMode }) => darkMode ? '#323232' : '#f2f2f2'};
|
|
5629
5674
|
}
|
|
5630
5675
|
|
|
5631
5676
|
`;
|
|
5632
|
-
|
|
5677
|
+
styled__default["default"].div `
|
|
5633
5678
|
display: flex;
|
|
5634
5679
|
align-items: center;
|
|
5635
5680
|
gap: 4px;
|
|
@@ -5640,13 +5685,14 @@ const LikesContainer = styled__default["default"].div `
|
|
|
5640
5685
|
font-weight: 400;
|
|
5641
5686
|
line-height: 110%;
|
|
5642
5687
|
`;
|
|
5643
|
-
|
|
5688
|
+
styled__default["default"].div `
|
|
5644
5689
|
& > *:last-child {
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5690
|
+
border-radius: 50%;
|
|
5691
|
+
background-color: #757575;
|
|
5692
|
+
border: 3px solid #757575;
|
|
5693
|
+
width: 14px;
|
|
5694
|
+
height: 14px;
|
|
5695
|
+
}
|
|
5650
5696
|
`;
|
|
5651
5697
|
const RelationContainer = styled__default["default"].div `
|
|
5652
5698
|
display: flex;
|
|
@@ -5679,7 +5725,7 @@ const InteractiveButtonsContainer = styled__default["default"].div `
|
|
|
5679
5725
|
line-height: normal;
|
|
5680
5726
|
|
|
5681
5727
|
& > *:last-child {
|
|
5682
|
-
height:24px;
|
|
5728
|
+
/* height:24px; */
|
|
5683
5729
|
transform: rotate(90deg);
|
|
5684
5730
|
}
|
|
5685
5731
|
`;
|
|
@@ -5688,26 +5734,25 @@ const FlexButtonContainer = styled__default["default"].div `
|
|
|
5688
5734
|
display: flex;
|
|
5689
5735
|
align-items: center;
|
|
5690
5736
|
justify-content: center;
|
|
5691
|
-
padding:
|
|
5692
|
-
|
|
5693
|
-
border-radius: 8px;
|
|
5737
|
+
padding: 8px;
|
|
5738
|
+
border-radius: 100px;
|
|
5694
5739
|
|
|
5695
5740
|
&:hover {
|
|
5696
|
-
background-color: ${({ theme }) => theme.colors.neutralsGrey9};
|
|
5741
|
+
background-color: ${({ theme, darkMode }) => darkMode ? '#272727' : theme.colors.neutralsGrey9};
|
|
5697
5742
|
}
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
}
|
|
5743
|
+
svg {
|
|
5744
|
+
:hover {
|
|
5745
|
+
/* fill:${({ theme }) => theme.colors.neutralsGrey9}; */
|
|
5746
|
+
/* background-color: ${({ theme, darkMode }) => darkMode ? 'red' : theme.colors.neutralsGrey9}; */
|
|
5747
|
+
}
|
|
5748
|
+
:active {
|
|
5749
|
+
/* stroke:${({ theme }) => theme.colors.neutralsGrey1};
|
|
5750
|
+
background-color: ${({ theme }) => theme.colors.neutralsGrey9}; */
|
|
5707
5751
|
}
|
|
5752
|
+
}
|
|
5708
5753
|
`;
|
|
5709
5754
|
const Text$2 = styled__default["default"].div `
|
|
5710
|
-
color:
|
|
5755
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.neutralsGrey5 : theme.colors.neutralsGrey2};
|
|
5711
5756
|
font-family: Work Sans;
|
|
5712
5757
|
font-weight: 400;
|
|
5713
5758
|
word-break: break-word;
|
|
@@ -5723,7 +5768,7 @@ const Text$2 = styled__default["default"].div `
|
|
|
5723
5768
|
const TextContainer$2 = styled__default["default"].div `
|
|
5724
5769
|
`;
|
|
5725
5770
|
const ShowMore$1 = styled__default["default"].span `
|
|
5726
|
-
color: ${({ theme }) => theme.colors.neutralsGrey2};
|
|
5771
|
+
color: ${({ theme, darkMode }) => darkMode ? theme.colors.neutralsGrey5 : theme.colors.neutralsGrey2};
|
|
5727
5772
|
font-family: Work Sans;
|
|
5728
5773
|
font-size: 14px;
|
|
5729
5774
|
font-style: normal;
|
|
@@ -5734,7 +5779,7 @@ const ShowMore$1 = styled__default["default"].span `
|
|
|
5734
5779
|
`;
|
|
5735
5780
|
|
|
5736
5781
|
const Button$3 = styled__default["default"].div `
|
|
5737
|
-
${({ variant, disabled, active, theme, isTooltipActive }) => {
|
|
5782
|
+
${({ variant, disabled, active, theme, isTooltipActive, darkMode }) => {
|
|
5738
5783
|
let styleVariant = {
|
|
5739
5784
|
'primary': styled.css `
|
|
5740
5785
|
display: flex;
|
|
@@ -5766,7 +5811,7 @@ const Button$3 = styled__default["default"].div `
|
|
|
5766
5811
|
font-weight: 700;
|
|
5767
5812
|
font-size: 16px;
|
|
5768
5813
|
width: fit-content;
|
|
5769
|
-
color: ${({ theme }) => disabled ? theme.colors.borderPrimary : theme.colors.neutralsGrey2};
|
|
5814
|
+
color: ${({ theme }) => disabled ? theme.colors.borderPrimary : (darkMode ? theme.colors.neutralsGrey7 : theme.colors.neutralsGrey2)};
|
|
5770
5815
|
cursor: pointer;
|
|
5771
5816
|
user-select:none;
|
|
5772
5817
|
&:hover {
|
|
@@ -5790,15 +5835,15 @@ const Button$3 = styled__default["default"].div `
|
|
|
5790
5835
|
border-radius: 8px;
|
|
5791
5836
|
|
|
5792
5837
|
|
|
5793
|
-
color: ${({ theme }) => disabled ? theme.colors.borderPrimary : theme.colors.neutralsGrey2};
|
|
5838
|
+
color: ${({ theme }) => disabled ? theme.colors.borderPrimary : (darkMode ? theme.colors.neutralsGrey7 : theme.colors.neutralsGrey2)};
|
|
5794
5839
|
cursor: pointer;
|
|
5795
5840
|
user-select:none;
|
|
5796
5841
|
&:hover {
|
|
5797
|
-
background-color: ${({ theme }) => disabled ? theme.colors.borderPrimary : theme.colors.neutralsGrey9};
|
|
5842
|
+
background-color: ${({ theme }) => disabled ? theme.colors.borderPrimary : (darkMode ? '#272727' : theme.colors.neutralsGrey9)};
|
|
5798
5843
|
}
|
|
5799
5844
|
&:active {
|
|
5800
|
-
color: ${({ theme }) => disabled ? theme.colors.borderPrimary : theme.colors.neutralsGrey1};
|
|
5801
|
-
background-color: ${({ theme }) => disabled ? theme.colors.borderPrimary : theme.colors.neutralsGrey9};
|
|
5845
|
+
color: ${({ theme }) => disabled ? theme.colors.borderPrimary : (darkMode ? theme.colors.neutralsGrey7 : theme.colors.neutralsGrey1)};
|
|
5846
|
+
background-color: ${({ theme }) => disabled ? theme.colors.borderPrimary : (darkMode ? '#3D3D3D' : theme.colors.neutralsGrey9)};
|
|
5802
5847
|
}
|
|
5803
5848
|
${active && `color : ${theme.colors.primary1}`}
|
|
5804
5849
|
`,
|
|
@@ -5838,9 +5883,9 @@ const Button$3 = styled__default["default"].div `
|
|
|
5838
5883
|
}}
|
|
5839
5884
|
`;
|
|
5840
5885
|
|
|
5841
|
-
function MiniButton({ variant, label, disabled, onClick, styles, active, tooltipText, }) {
|
|
5886
|
+
function MiniButton({ variant, label, disabled, onClick, styles, active, tooltipText, darkMode }) {
|
|
5842
5887
|
const [isTooltipActive, setIsTooltipActive] = React.useState(false);
|
|
5843
|
-
const generateButtonComponent = () => (jsxRuntime.jsx(Button$3, { onClick: (e) => !disabled && onClick(e), disabled: disabled, variant: variant, style: { ...styles }, active: !!active, isTooltipActive: isTooltipActive, children: label }));
|
|
5888
|
+
const generateButtonComponent = () => (jsxRuntime.jsx(Button$3, { onClick: (e) => !disabled && onClick(e), disabled: disabled, variant: variant, style: { ...styles }, active: !!active, isTooltipActive: isTooltipActive, darkMode: darkMode, children: label }));
|
|
5844
5889
|
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: { ...FRSTTheme }, children: tooltipText ? (jsxRuntime.jsx(Tooltip$2, { direction: "bottom", content: tooltipText, trigger: "hover", width: tooltipText.length > 18 ? "220px" : "100px", height: "auto", style: { top: '50px', textAlign: 'center' }, setIsActive: setIsTooltipActive, children: generateButtonComponent() })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: generateButtonComponent() })) }));
|
|
5845
5890
|
}
|
|
5846
5891
|
|
|
@@ -5875,7 +5920,7 @@ const Container$p = styled__default["default"].div `
|
|
|
5875
5920
|
width:100%;
|
|
5876
5921
|
`;
|
|
5877
5922
|
const SpanText = styled__default["default"].p `
|
|
5878
|
-
color: #000;
|
|
5923
|
+
color: ${({ darkMode }) => darkMode ? '#EBEBEB' : '#000'};
|
|
5879
5924
|
font-family: PT Sans;
|
|
5880
5925
|
font-size: 16px;
|
|
5881
5926
|
font-style: normal;
|
|
@@ -5890,7 +5935,7 @@ const ButtonsContainer = styled__default["default"].div `
|
|
|
5890
5935
|
margin-left:auto;
|
|
5891
5936
|
`;
|
|
5892
5937
|
|
|
5893
|
-
const InputEdit = ({ placeHolderText, commentText, commentTextWithMention, getSearchUsers, onClickEditButton, limitInput, editButtonText, cancelButtonText, orText, limitMessageExceeded, commentId, group_uuid, setIsModeEdit }) => {
|
|
5938
|
+
const InputEdit = ({ placeHolderText, commentText, commentTextWithMention, getSearchUsers, onClickEditButton, limitInput, editButtonText, cancelButtonText, orText, limitMessageExceeded, commentId, group_uuid, setIsModeEdit, darkMode }) => {
|
|
5894
5939
|
const [comment, setComment] = React.useState(commentText);
|
|
5895
5940
|
const [CaptureFormattedValue, setCaptureFormattedValue] = React.useState(commentTextWithMention);
|
|
5896
5941
|
const [captureMentions, setCaptureMentions] = React.useState([]);
|
|
@@ -5924,26 +5969,27 @@ const InputEdit = ({ placeHolderText, commentText, commentTextWithMention, getSe
|
|
|
5924
5969
|
};
|
|
5925
5970
|
return (jsxRuntime.jsxs(Container$p, { children: [jsxRuntime.jsx(InputContainer$1, { ref: inputRef, style: { width: '100%' }, children: jsxRuntime.jsx(InputComment$1, { styles: { width: '100%' }, onChange: (e) => {
|
|
5926
5971
|
handleSearchUsers(e);
|
|
5927
|
-
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded, initialText: CaptureFormattedValue || comment }) }), jsxRuntime.jsxs(ButtonsContainer, { children: [jsxRuntime.jsx(MiniButton, { label: cancelButtonText, onClick: () => setIsModeEdit(false), variant: 'secondary' }), jsxRuntime.jsx(SpanText, { children: orText }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || comment.length > limitInput || isLoading, label: editButtonText, onClick: () => handlePublish(), variant: "primary", styles: {} })] }), isLoading && jsxRuntime.jsx(Loading, {})] }));
|
|
5972
|
+
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded, initialText: CaptureFormattedValue || comment, darkMode: darkMode, showEmojiPicker: darkMode }) }), jsxRuntime.jsxs(ButtonsContainer, { children: [jsxRuntime.jsx(MiniButton, { darkMode: darkMode, label: cancelButtonText, onClick: () => setIsModeEdit(false), variant: 'secondary' }), jsxRuntime.jsx(SpanText, { darkMode: darkMode, children: orText }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || comment.length > limitInput || isLoading, label: editButtonText, onClick: () => handlePublish(), variant: "primary", styles: {} })] }), isLoading && jsxRuntime.jsx(Loading, {})] }));
|
|
5928
5973
|
};
|
|
5929
5974
|
|
|
5930
|
-
const CommentaryBoxV2 = ({ userName, imgProfile, userCompany, userOffice, showMoreText, relationToPhaseText, showLessText, showLikeButton, styles, actionLike, actionUnlike, answerButtonText, likeButtonText, commentTextWithMention, editText, deleteText, isAuthor, isOwnerPost, howLongAgo, commentId, commentUuid, commentText, actionAnswer, onClickUserInfo, actionEditComment, actionDeleteComment, isMainComment, hasActionToClickOnAvatar, showOptions, limitInput = 800, saveButtonText, cancelButtonText, orText, groupUuid, limitMessageExceeded, placeHolderText, getSearchUsers, likes, loggedInUser, showInterconnectionLine = false }) => {
|
|
5975
|
+
const CommentaryBoxV2 = ({ userName, imgProfile, userCompany, userOffice, showMoreText, relationToPhaseText, showLessText, showLikeButton, styles, actionLike, actionUnlike, answerButtonText, likeButtonText, commentTextWithMention, editText, deleteText, isAuthor, isOwnerPost, howLongAgo, commentId, commentUuid, commentText, actionAnswer, onClickUserInfo, actionEditComment, actionDeleteComment, isMainComment, hasActionToClickOnAvatar, showOptions, limitInput = 800, saveButtonText, cancelButtonText, orText, groupUuid, limitMessageExceeded, placeHolderText, getSearchUsers, likes, loggedInUser, showInterconnectionLine = false, darkMode, isLiked, totalLikes = 0 }) => {
|
|
5931
5976
|
const iDCommentPosted = commentId ? commentId.toString() : `IDCommentPosted-${createUUID()}`;
|
|
5932
5977
|
const [isModeEdit, setIsModeEdit] = React.useState(false);
|
|
5933
5978
|
const [loadingLike, setLoadingLike] = React.useState(false);
|
|
5934
|
-
const itsLiked = likes?.some((like) => like.user_uuid === loggedInUser.id);
|
|
5935
|
-
const likesCount = likes?.length
|
|
5979
|
+
const itsLiked = likes?.length > 0 ? likes?.some((like) => like.user_uuid === loggedInUser.id) : isLiked;
|
|
5980
|
+
const likesCount = likes?.length > 0 ? likes?.length : totalLikes;
|
|
5936
5981
|
const likeId = likes?.find((like) => like.user_uuid === loggedInUser.id || like.user?.uuid === loggedInUser.id)?.id || null;
|
|
5937
5982
|
const edit = {
|
|
5938
5983
|
description: editText,
|
|
5939
|
-
startIcon: jsxRuntime.jsx(EditIcon, { fill: "#222" }),
|
|
5940
|
-
onClick: () => setIsModeEdit(true)
|
|
5984
|
+
startIcon: jsxRuntime.jsx(EditIcon, { fill: darkMode ? '#FFFFFF' : "#222" }),
|
|
5985
|
+
onClick: () => setIsModeEdit(true),
|
|
5986
|
+
color: darkMode ? '#FFFFFF' : "#222"
|
|
5941
5987
|
};
|
|
5942
5988
|
const exclude = {
|
|
5943
5989
|
description: deleteText,
|
|
5944
|
-
startIcon: jsxRuntime.jsx(TrashIconNew, { fill: "#C1341A" }),
|
|
5990
|
+
startIcon: jsxRuntime.jsx(TrashIconNew, { fill: darkMode ? '#FF4D3E' : "#C1341A" }),
|
|
5945
5991
|
onClick: () => actionDeleteComment(commentUuid),
|
|
5946
|
-
color: '#C1341A'
|
|
5992
|
+
color: darkMode ? '#FF4D3E' : '#C1341A'
|
|
5947
5993
|
};
|
|
5948
5994
|
const authorOptions = [edit, exclude];
|
|
5949
5995
|
const ownerPost = [exclude];
|
|
@@ -5962,7 +6008,7 @@ const CommentaryBoxV2 = ({ userName, imgProfile, userCompany, userOffice, showMo
|
|
|
5962
6008
|
const handleUnlike = async () => {
|
|
5963
6009
|
try {
|
|
5964
6010
|
setLoadingLike(true);
|
|
5965
|
-
await actionUnlike(likeId);
|
|
6011
|
+
await actionUnlike(likeId ? likeId : commentId.toString());
|
|
5966
6012
|
}
|
|
5967
6013
|
catch (error) {
|
|
5968
6014
|
console.log('error:', error);
|
|
@@ -6002,16 +6048,51 @@ const CommentaryBoxV2 = ({ userName, imgProfile, userCompany, userOffice, showMo
|
|
|
6002
6048
|
left: '16px',
|
|
6003
6049
|
top: '40px',
|
|
6004
6050
|
backgroundColor: '#D1D5DB'
|
|
6005
|
-
} }))] }), isModeEdit ? (jsxRuntime.jsx(InputEdit, { placeHolderText: placeHolderText, commentText: buildStringWithLinkHTML(commentText), commentTextWithMention: commentTextWithMention && buildStringWithLinkHTML(commentTextWithMention), editButtonText: saveButtonText, onClickEditButton: actionEditComment, limitInput: limitInput, cancelButtonText: cancelButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, commentId: commentId, setIsModeEdit: setIsModeEdit, group_uuid: groupUuid, getSearchUsers: getSearchUsers })) : (jsxRuntime.jsxs(Box, { id: `comment_${commentUuid}`,
|
|
6051
|
+
} }))] }), isModeEdit ? (jsxRuntime.jsx(InputEdit, { placeHolderText: placeHolderText, commentText: buildStringWithLinkHTML(commentText), commentTextWithMention: commentTextWithMention && buildStringWithLinkHTML(commentTextWithMention), editButtonText: saveButtonText, onClickEditButton: actionEditComment, limitInput: limitInput, cancelButtonText: cancelButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, commentId: commentId, setIsModeEdit: setIsModeEdit, group_uuid: groupUuid, getSearchUsers: getSearchUsers, darkMode: darkMode })) : (jsxRuntime.jsxs(Box, { id: `comment_${commentUuid}`, darkMode: darkMode, children: [jsxRuntime.jsxs(UserDataContainer, { children: [jsxRuntime.jsx(FirstChildUserData, { children: jsxRuntime.jsx(Username, { darkMode: darkMode, children: userName }) }), jsxRuntime.jsxs(UserDataLastChild, { darkMode: darkMode, children: [userOffice && userOffice, " ", userCompany && `• ${userCompany}`, " ", howLongAgo && `• ${howLongAgo}`] })] }), relationToPhaseText && jsxRuntime.jsx(RelationContainer, { children: relationToPhaseText }), jsxRuntime.jsxs(TextContainer$2, { id: "textContainerId", children: [jsxRuntime.jsx(Text$2, { style: isExpanded ? { display: 'block' } : { display: '-webkit-box' }, id: iDCommentPosted, dangerouslySetInnerHTML: {
|
|
6006
6052
|
__html: buildStringWithLinkHTML(commentTextWithMention ? commentTextWithMention : commentText)
|
|
6007
|
-
} }), jsxRuntime.jsx(ShowMore$1, { isVisible: isEllipsisVisible, onClick: toggleExpand, children: isExpanded ? showLessText : showMoreText })] })] }))] }), !isModeEdit && (jsxRuntime.jsxs(InteractiveButtonsContainer, { style: isMainComment ? { marginLeft: '55px' } : {}, children: [showLikeButton && (jsxRuntime.jsxs(
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6053
|
+
}, darkMode: darkMode }), jsxRuntime.jsx(ShowMore$1, { darkMode: darkMode, isVisible: isEllipsisVisible, onClick: toggleExpand, children: isExpanded ? showLessText : showMoreText })] })] }))] }), !isModeEdit && (jsxRuntime.jsxs(InteractiveButtonsContainer, { style: isMainComment ? { marginLeft: '55px' } : {}, children: [showLikeButton && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.Tooltip, { title: itsLiked ? 'Remover curtida' : 'Curtir', placement: 'bottom', arrow: true, slotProps: {
|
|
6054
|
+
popper: {
|
|
6055
|
+
modifiers: [
|
|
6056
|
+
{
|
|
6057
|
+
name: 'offset',
|
|
6058
|
+
options: {
|
|
6059
|
+
offset: [0, 0]
|
|
6060
|
+
}
|
|
6061
|
+
}
|
|
6062
|
+
],
|
|
6063
|
+
},
|
|
6064
|
+
tooltip: {
|
|
6065
|
+
sx: {
|
|
6066
|
+
backgroundColor: darkMode ? '#323232' : '#FFFFFF',
|
|
6067
|
+
fontFamily: 'PT Sans',
|
|
6068
|
+
fontWeight: 400,
|
|
6069
|
+
fontSize: '14px',
|
|
6070
|
+
lineHeight: 1.3,
|
|
6071
|
+
textAlign: 'center',
|
|
6072
|
+
color: darkMode ? '#FFFFFF' : '#757575',
|
|
6073
|
+
border: darkMode ? '1px solid #323232' : '1px solid #BDBDBD',
|
|
6074
|
+
boxShadow: '0px 25px 18px -20px #22222233'
|
|
6075
|
+
}
|
|
6076
|
+
},
|
|
6077
|
+
arrow: {
|
|
6078
|
+
sx: {
|
|
6079
|
+
":before": {
|
|
6080
|
+
border: darkMode ? '1px solid #323232' : '1px solid #BDBDBD'
|
|
6081
|
+
},
|
|
6082
|
+
color: darkMode ? '#323232' : '#FFFFFF'
|
|
6083
|
+
}
|
|
6084
|
+
}
|
|
6085
|
+
}, children: jsxRuntime.jsx(FlexButtonContainer, { onClick: itsLiked ? handleUnlike : handleLike, style: {
|
|
6086
|
+
cursor: loadingLike ? 'not-allowed !important' : 'pointer',
|
|
6087
|
+
pointerEvents: loadingLike ? 'none' : 'auto'
|
|
6088
|
+
}, darkMode: darkMode, children: itsLiked ?
|
|
6089
|
+
jsxRuntime.jsx(IconLikeFilled, { customColor_1: darkMode ? '#151515' : '#FFFFFF' })
|
|
6090
|
+
:
|
|
6091
|
+
jsxRuntime.jsx(IconLikeLine, { fill: darkMode ? "#EBEBEB" : "#444" }) }) }), jsxRuntime.jsx("span", { style: { color: itsLiked ? '#F26818' : (darkMode ? "#EBEBEB" : "#444"),
|
|
6092
|
+
fontFamily: 'PT Sans',
|
|
6093
|
+
fontSize: '14px',
|
|
6094
|
+
fontWeight: 700
|
|
6095
|
+
}, children: likesCount })] })), jsxRuntime.jsx(MiniButton, { darkMode: darkMode, variant: "terciary", onClick: actionAnswer, label: answerButtonText, styles: { color: darkMode ? '#EBEBEB' : '#444444' } }), showOptions ? (isAuthor ? (jsxRuntime.jsx(MenuMoreContainer, { darkMode: darkMode, children: jsxRuntime.jsx(MenuMore, { isDarkMode: darkMode, options: authorOptions, style: {}, closeAfterClick: true, isHover: false }) })) : isOwnerPost ? (jsxRuntime.jsx(MenuMoreContainer, { darkMode: darkMode, children: jsxRuntime.jsx(MenuMore, { isDarkMode: darkMode, options: ownerPost, style: {}, closeAfterClick: true, isHover: false }) })) : (jsxRuntime.jsx(MenuMoreContainer, { darkMode: darkMode, children: jsxRuntime.jsx(MenuMore, { isDarkMode: darkMode, options: [], isHover: false }) }))) : (jsxRuntime.jsx("div", {}))] }))] }));
|
|
6015
6096
|
};
|
|
6016
6097
|
|
|
6017
6098
|
const Container$o = styled__default["default"].div `
|
|
@@ -6031,21 +6112,7 @@ display:flex;
|
|
|
6031
6112
|
flex-direction:column;
|
|
6032
6113
|
`;
|
|
6033
6114
|
const ViewReplysButtonContainer = styled__default["default"].div `
|
|
6034
|
-
color: #444444;
|
|
6035
|
-
font-family: PT Sans;
|
|
6036
|
-
font-size: 14px;
|
|
6037
|
-
font-style: normal;
|
|
6038
|
-
font-weight: 400;
|
|
6039
|
-
line-height: 110%;
|
|
6040
|
-
position: relative;
|
|
6041
|
-
left: 59px;
|
|
6042
|
-
margin-top: 6px;
|
|
6043
|
-
span{
|
|
6044
|
-
cursor:pointer;
|
|
6045
|
-
}
|
|
6046
|
-
|
|
6047
|
-
@media screen and (max-width:768px){
|
|
6048
|
-
color: #444444;
|
|
6115
|
+
color: ${({ darkMode }) => darkMode ? '#EBEBEB' : '#444444'};
|
|
6049
6116
|
font-family: PT Sans;
|
|
6050
6117
|
font-size: 14px;
|
|
6051
6118
|
font-style: normal;
|
|
@@ -6054,13 +6121,26 @@ span{
|
|
|
6054
6121
|
position: relative;
|
|
6055
6122
|
left: 59px;
|
|
6056
6123
|
margin-top: 6px;
|
|
6057
|
-
|
|
6124
|
+
span{
|
|
6125
|
+
cursor:pointer;
|
|
6126
|
+
}
|
|
6127
|
+
|
|
6128
|
+
@media screen and (max-width:768px){
|
|
6129
|
+
color: ${({ darkMode }) => darkMode ? '#EBEBEB' : '#444444'};
|
|
6130
|
+
font-family: PT Sans;
|
|
6131
|
+
font-size: 14px;
|
|
6132
|
+
font-style: normal;
|
|
6133
|
+
font-weight: 400;
|
|
6134
|
+
line-height: 110%;
|
|
6135
|
+
position: relative;
|
|
6136
|
+
left: 59px;
|
|
6137
|
+
margin-top: 6px;
|
|
6138
|
+
max-width: 150px !important;
|
|
6058
6139
|
}
|
|
6059
|
-
}
|
|
6060
6140
|
`;
|
|
6061
6141
|
const RepplysContainer = styled__default["default"].div `
|
|
6062
|
-
width: ${({ width }) => (width ? `${width}px` : 'auto')};
|
|
6063
|
-
margin-left:60px;
|
|
6142
|
+
width: ${({ width }) => (width ? `${width}px` : 'auto')};
|
|
6143
|
+
margin-left:60px;
|
|
6064
6144
|
`;
|
|
6065
6145
|
|
|
6066
6146
|
const InputContainer = styled__default["default"].div `
|
|
@@ -6073,7 +6153,7 @@ const Container$n = styled__default["default"].div `
|
|
|
6073
6153
|
justify-content:center;
|
|
6074
6154
|
`;
|
|
6075
6155
|
|
|
6076
|
-
const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, parentId, limitInput, publishButtonText, replyMentionedUser, imgProfile, styles, handleHiddenInput, group_uuid, limitMessageExceeded }) => {
|
|
6156
|
+
const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, parentId, limitInput, publishButtonText, replyMentionedUser, imgProfile, styles, handleHiddenInput, group_uuid, limitMessageExceeded, darkMode }) => {
|
|
6077
6157
|
const [comment, setComment] = React.useState('');
|
|
6078
6158
|
const [CaptureFormattedValue, setCaptureFormattedValue] = React.useState('');
|
|
6079
6159
|
const [captureMentions, setCaptureMentions] = React.useState([]);
|
|
@@ -6129,20 +6209,23 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
6129
6209
|
};
|
|
6130
6210
|
return (jsxRuntime.jsxs(Container$n, { style: { ...styles }, children: [jsxRuntime.jsx(Avatar, { src: imgProfile, size: "32px", style: { marginTop: '16px', marginRight: '8px' } }), jsxRuntime.jsxs(InputContainer, { ref: inputRef, style: { width: '100%', marginTop: '16px' }, children: [jsxRuntime.jsx(InputComment$1, { styles: { width: '100%' }, className: "userComment", onChange: (e) => {
|
|
6131
6211
|
handleSearchUsers(e);
|
|
6132
|
-
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, replyMentionedUser: !userMentionedOnReplied && user, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || comment.length > limitInput || isLoading, label: publishButtonText, onClick: () => handlePublish(), variant: "primary", styles: { marginLeft: 'auto', marginTop: '14px' } }), isLoading && jsxRuntime.jsx(Loading, {})] })] }));
|
|
6212
|
+
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, replyMentionedUser: !userMentionedOnReplied && user, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded, darkMode: darkMode, showEmojiPicker: darkMode }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || comment.length > limitInput || isLoading, label: publishButtonText, onClick: () => handlePublish(), variant: "primary", styles: { marginLeft: 'auto', marginTop: '14px' } }), isLoading && jsxRuntime.jsx(Loading, {})] })] }));
|
|
6133
6213
|
};
|
|
6134
6214
|
|
|
6135
|
-
const CommentaryBoxReply = ({ commentData, showMoreButtonText, showLessButtonText, answerButtonText, isAuthor, isOwnerPost, deleteText, editText, onClickDelete, onClickEdit, limitInput, cancelButtonText, saveButtonText, orText, limitMessageExceeded, placeHolderText, getSearchUsers, onClickLike, onClickUnlike, likeButtonText, loggedInUser, likes, replies = [], isGoalOwner, group_uuid, publishButtonText, onClickPublishButton, mainCommentUser, answersText, toViewText, answerText, threadOpenByDefault }) => {
|
|
6215
|
+
const CommentaryBoxReply = ({ commentData, showMoreButtonText, showLessButtonText, answerButtonText, isAuthor, isOwnerPost, deleteText, editText, onClickDelete, onClickEdit, limitInput, cancelButtonText, saveButtonText, orText, limitMessageExceeded, placeHolderText, getSearchUsers, onClickLike, onClickUnlike, likeButtonText, loggedInUser, likes, replies = [], isGoalOwner, group_uuid, publishButtonText, onClickPublishButton, mainCommentUser, answersText, toViewText, answerText, threadOpenByDefault, darkMode, toHideText }) => {
|
|
6136
6216
|
const [showAnswers, setShowAnswers] = React.useState(threadOpenByDefault);
|
|
6137
6217
|
const [showReplyInput, setShowReplyInput] = React.useState(false);
|
|
6138
6218
|
const handleLoadMoreReplies = () => {
|
|
6139
6219
|
setShowAnswers(true);
|
|
6140
6220
|
};
|
|
6141
|
-
|
|
6142
|
-
|
|
6221
|
+
const handleHideReplies = () => {
|
|
6222
|
+
setShowAnswers(false);
|
|
6223
|
+
};
|
|
6224
|
+
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { hasActionToClickOnAvatar: false, imgProfile: commentData.user?.avatar, loggedInUser: loggedInUser, userName: commentData.user?.name, userOffice: commentData.user?.role_name, userCompany: commentData.user?.company_name, commentId: commentData.id, commentText: commentData.text, commentUuid: commentData.uuid, howLongAgo: commentData.howLongAgo, showMoreText: showMoreButtonText, actionAnswer: () => setShowReplyInput(true), showLessText: showLessButtonText, answerButtonText: answerButtonText, styles: { marginTop: '16px' }, commentTextWithMention: commentData.mentionText, isAuthor: isAuthor, isOwnerPost: isOwnerPost, deleteText: deleteText, editText: editText, showOptions: isAuthor || isOwnerPost, actionDeleteComment: onClickDelete, limitInput: limitInput, cancelButtonText: cancelButtonText, saveButtonText: saveButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, actionEditComment: onClickEdit, placeHolderText: placeHolderText, getSearchUsers: getSearchUsers, likes: likes, actionLike: onClickLike, actionUnlike: onClickUnlike, showLikeButton: true, likeButtonText: likeButtonText, showInterconnectionLine: replies.length > 0 && showAnswers, darkMode: darkMode, isLiked: commentData?.isLiked, totalLikes: commentData?.totalLikes }), replies.length > 0 && !showAnswers && (jsxRuntime.jsx(ViewReplysButtonContainer, { style: { left: '44px' }, darkMode: darkMode, children: jsxRuntime.jsx("span", { onClick: handleLoadMoreReplies, children: `${toViewText} ${replies.length} ${replies.length === 1 ? answerText : answersText}` }) })), replies.length > 0 && showAnswers && toHideText && (jsxRuntime.jsx(ViewReplysButtonContainer, { style: { left: '44px' }, darkMode: darkMode, children: jsxRuntime.jsx("span", { onClick: handleHideReplies, children: `${toHideText} ${replies.length} ${replies.length === 1 ? answerText : answersText}` }) })), showReplyInput && (jsxRuntime.jsx(InputReply, { imgProfile: loggedInUser?.avatar, styles: { width: '100%' }, idInput: `idInput-${commentData.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInput, onClickPublishButton: onClickPublishButton, replyMentionedUser: mainCommentUser, getSearchUsers: getSearchUsers, parentId: commentData.id, handleHiddenInput: () => setShowReplyInput(false), group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded, darkMode: darkMode })), showAnswers &&
|
|
6225
|
+
replies?.map((reply, index) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(CommentaryBoxV2, { styles: { marginTop: '16px' }, userName: reply.user?.name, userOffice: reply.user?.role_name, userCompany: reply.user?.company_name, commentUuid: reply.uuid, commentId: reply.id, commentText: reply.text, commentTextWithMention: reply.mentionText, howLongAgo: reply.howLongAgo, placeHolderText: placeHolderText, cancelButtonText: cancelButtonText, saveButtonText: saveButtonText, likeButtonText: likeButtonText, editText: editText, deleteText: deleteText, orText: orText, limitInput: limitInput, showMoreText: showMoreButtonText, showLessText: showLessButtonText, hasActionToClickOnAvatar: false, likes: reply.likes, loggedInUser: loggedInUser, limitMessageExceeded: limitMessageExceeded, showLikeButton: true, actionLike: onClickLike, actionUnlike: onClickUnlike, getSearchUsers: getSearchUsers, actionEditComment: onClickEdit, actionDeleteComment: onClickDelete, isAuthor: reply.user?.uuid === loggedInUser?.id, isOwnerPost: isAuthor || isOwnerPost || isGoalOwner, showOptions: isAuthor || isOwnerPost || reply.user?.uuid === loggedInUser?.id || isGoalOwner, imgProfile: reply.user?.avatar, showInterconnectionLine: replies.length != index + 1, darkMode: darkMode, isLiked: reply?.isLiked, totalLikes: reply?.totalLikes }, reply.id) })))] }));
|
|
6143
6226
|
};
|
|
6144
6227
|
|
|
6145
|
-
const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onClickPublishButton, showReplysButtonText, publishButtonText, limitInputs, answerButtonText, loggedInUser, group_uuid, getSearchUsers, showMoreButtonText, showLessButtonText, styles, relationToPhaseText, limitMessageExceeded, size = 5, showMoreReplysButtonText, isGoalOwner, editText, deleteText, onClickDelete, onClickEdit, cancelButtonText, saveButtonText, orText, onClickLike, onClickUnlike, likeButtonText, toViewText, answersText, answerText }) => {
|
|
6228
|
+
const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onClickPublishButton, showReplysButtonText, publishButtonText, limitInputs, answerButtonText, loggedInUser, group_uuid, getSearchUsers, showMoreButtonText, showLessButtonText, styles, relationToPhaseText, limitMessageExceeded, size = 5, showMoreReplysButtonText, isGoalOwner, editText, deleteText, onClickDelete, onClickEdit, cancelButtonText, saveButtonText, orText, onClickLike, onClickUnlike, likeButtonText, toViewText, answersText, answerText, darkMode, toHideText, hideRepliesText }) => {
|
|
6146
6229
|
const threadOpenByDefault = mainComment?.thread_open;
|
|
6147
6230
|
const [showAnswers, setShowAnswers] = React.useState(false);
|
|
6148
6231
|
const [showReplysOnClickCounter, setReplysOnClickCounter] = React.useState(0);
|
|
@@ -6158,6 +6241,11 @@ const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onCli
|
|
|
6158
6241
|
}
|
|
6159
6242
|
setShowAnswers(true);
|
|
6160
6243
|
};
|
|
6244
|
+
const handleHideReplies = () => {
|
|
6245
|
+
setVisibleReplies(0);
|
|
6246
|
+
setReplysOnClickCounter(0);
|
|
6247
|
+
setShowAnswers(false);
|
|
6248
|
+
};
|
|
6161
6249
|
const handleHiddenInput = () => {
|
|
6162
6250
|
setShowReplyInput(false);
|
|
6163
6251
|
};
|
|
@@ -6171,7 +6259,7 @@ const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onCli
|
|
|
6171
6259
|
}
|
|
6172
6260
|
}, [threadOpenByDefault]);
|
|
6173
6261
|
const isMainCommentUser = mainComment.user?.uuid === loggedInUser?.id;
|
|
6174
|
-
return (jsxRuntime.jsx(Container$o, { style: styles, children: jsxRuntime.jsxs(CommentarysContainer, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { loggedInUser: loggedInUser, hasActionToClickOnAvatar: false, imgProfile: mainComment.user?.avatar, userId: mainComment.user?.uuid, userName: mainComment.user?.name, userOffice: mainComment.user?.role_name, userCompany: mainComment.user?.company_name, commentId: mainComment.id, commentText: mainComment.text, howLongAgo: mainComment.howLongAgo, showMoreText: showMoreButtonText, showLessText: showLessButtonText, answerButtonText: answerButtonText, actionAnswer: handleCommentReply, actionDeleteComment: onClickDelete, actionEditComment: onClickEdit, relationToPhaseText: relationToPhaseText, commentTextWithMention: mainComment.mentionText, isMainComment: true, isAuthor: isMainCommentUser, isOwnerPost: isGoalOwner, deleteText: deleteText, editText: editText, showOptions: isMainCommentUser || isGoalOwner, commentUuid: mainComment.uuid, limitInput: limitInputs, groupUuid: group_uuid, cancelButtonText: cancelButtonText, saveButtonText: saveButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, placeHolderText: placeHolderText, getSearchUsers: getSearchUsers, actionLike: onClickLike, actionUnlike: onClickUnlike, showLikeButton: true, likeButtonText: likeButtonText, likes: mainComment.likes }), listReplyComments.length > visibleReplies && (jsxRuntime.jsx(ViewReplysButtonContainer, { id: "text-viwMsg", children: jsxRuntime.jsx("span", { onClick: handleLoadMoreReplies, children: showReplysOnClickCounter === 0 ? showReplysButtonText : showMoreReplysButtonText }) })), showReplyInput && (jsxRuntime.jsx(InputReply, { styles: { marginLeft: '60px' }, imgProfile: loggedInUser?.avatar, idInput: `idInput-${mainComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, getSearchUsers: getSearchUsers, replyMentionedUser: mainComment.user, parentId: Number(mainComment.id), handleHiddenInput: handleHiddenInput, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }))] }), showAnswers && visibleReplies && (jsxRuntime.jsx(RepplysContainer, { style: { marginTop: '6px' }, children: listReplyComments.slice(0, visibleReplies).map((replyComment) => (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(CommentaryBoxReply, { replies: replyComment?.replies, commentData: replyComment, answerButtonText: answerButtonText, showMoreButtonText: showMoreButtonText, showLessButtonText: showLessButtonText, isAuthor: replyComment.user?.uuid === loggedInUser?.id, isOwnerPost: mainComment.user?.uuid === loggedInUser?.id || isGoalOwner, deleteText: deleteText, editText: editText, onClickDelete: onClickDelete, limitInput: limitInputs, groupUuid: group_uuid, cancelButtonText: cancelButtonText, saveButtonText: saveButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, onClickEdit: onClickEdit, placeHolderText: placeHolderText, getSearchUsers: getSearchUsers, onClickLike: onClickLike, onClickUnlike: onClickUnlike, likeButtonText: likeButtonText, likes: replyComment.likes, loggedInUser: loggedInUser, isGoalOwner: isGoalOwner, group_uuid: group_uuid, publishButtonText: publishButtonText, onClickPublishButton: onClickPublishButton, mainCommentUser: replyComment.user, showReplysButtonText: showReplysButtonText, toViewText: toViewText, answersText: answersText, answerText: answerText, threadOpenByDefault: !!threadOpenByDefault }) }, replyComment.id))) }))] }) }));
|
|
6262
|
+
return (jsxRuntime.jsx(Container$o, { style: styles, children: jsxRuntime.jsxs(CommentarysContainer, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { loggedInUser: loggedInUser, hasActionToClickOnAvatar: false, imgProfile: mainComment.user?.avatar, userId: mainComment.user?.uuid, userName: mainComment.user?.name, userOffice: mainComment.user?.role_name, userCompany: mainComment.user?.company_name, commentId: mainComment.id, commentText: mainComment.text, howLongAgo: mainComment.howLongAgo, showMoreText: showMoreButtonText, showLessText: showLessButtonText, answerButtonText: answerButtonText, actionAnswer: handleCommentReply, actionDeleteComment: onClickDelete, actionEditComment: onClickEdit, relationToPhaseText: relationToPhaseText, commentTextWithMention: mainComment.mentionText, isMainComment: true, isAuthor: isMainCommentUser, isOwnerPost: isGoalOwner, deleteText: deleteText, editText: editText, showOptions: isMainCommentUser || isGoalOwner, commentUuid: mainComment.uuid, limitInput: limitInputs, groupUuid: group_uuid, cancelButtonText: cancelButtonText, saveButtonText: saveButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, placeHolderText: placeHolderText, getSearchUsers: getSearchUsers, actionLike: onClickLike, actionUnlike: onClickUnlike, showLikeButton: true, likeButtonText: likeButtonText, likes: mainComment.likes, darkMode: darkMode, isLiked: mainComment?.isLiked, totalLikes: mainComment?.totalLikes }), listReplyComments.length > visibleReplies && (jsxRuntime.jsx(ViewReplysButtonContainer, { id: "text-viwMsg", darkMode: darkMode, children: jsxRuntime.jsx("span", { onClick: handleLoadMoreReplies, children: showReplysOnClickCounter === 0 ? showReplysButtonText : showMoreReplysButtonText }) })), showAnswers && visibleReplies && hideRepliesText && (jsxRuntime.jsx(ViewReplysButtonContainer, { id: "text-viwMsg", darkMode: darkMode, children: jsxRuntime.jsx("span", { onClick: handleHideReplies, children: hideRepliesText }) })), showReplyInput && (jsxRuntime.jsx(InputReply, { styles: { marginLeft: '60px' }, imgProfile: loggedInUser?.avatar, idInput: `idInput-${mainComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, getSearchUsers: getSearchUsers, replyMentionedUser: mainComment.user, parentId: Number(mainComment.id), handleHiddenInput: handleHiddenInput, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded, darkMode: darkMode }))] }), showAnswers && visibleReplies && (jsxRuntime.jsx(RepplysContainer, { style: { marginTop: '6px' }, children: listReplyComments.slice(0, visibleReplies).map((replyComment) => (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(CommentaryBoxReply, { replies: replyComment?.replies, commentData: replyComment, answerButtonText: answerButtonText, showMoreButtonText: showMoreButtonText, showLessButtonText: showLessButtonText, isAuthor: replyComment.user?.uuid === loggedInUser?.id, isOwnerPost: mainComment.user?.uuid === loggedInUser?.id || isGoalOwner, deleteText: deleteText, editText: editText, onClickDelete: onClickDelete, limitInput: limitInputs, groupUuid: group_uuid, cancelButtonText: cancelButtonText, saveButtonText: saveButtonText, orText: orText, limitMessageExceeded: limitMessageExceeded, onClickEdit: onClickEdit, placeHolderText: placeHolderText, getSearchUsers: getSearchUsers, onClickLike: onClickLike, onClickUnlike: onClickUnlike, likeButtonText: likeButtonText, likes: replyComment.likes, loggedInUser: loggedInUser, isGoalOwner: isGoalOwner, group_uuid: group_uuid, publishButtonText: publishButtonText, onClickPublishButton: onClickPublishButton, mainCommentUser: replyComment.user, showReplysButtonText: showReplysButtonText, toViewText: toViewText, answersText: answersText, answerText: answerText, threadOpenByDefault: !!threadOpenByDefault, darkMode: darkMode, toHideText: toHideText }) }, replyComment.id))) }))] }) }));
|
|
6175
6263
|
};
|
|
6176
6264
|
|
|
6177
6265
|
const ButtonCheckmark = styled__default["default"].div `
|
|
@@ -23575,11 +23663,11 @@ const TextContainer = styled__default["default"].div `
|
|
|
23575
23663
|
text-overflow: ellipsis;
|
|
23576
23664
|
max-width: 100%;
|
|
23577
23665
|
`;
|
|
23578
|
-
const
|
|
23666
|
+
const SelectTag = styled__default["default"].div `
|
|
23579
23667
|
display: inline-flex;
|
|
23580
23668
|
align-items: center;
|
|
23581
23669
|
min-height: 32px;
|
|
23582
|
-
background: ${({ isVariant }) => (isVariant ? '#6A3F86' : '#00828c')};
|
|
23670
|
+
background: ${({ isVariant, tagColor }) => (tagColor ? tagColor : isVariant ? '#6A3F86' : '#00828c')};
|
|
23583
23671
|
border-radius: 4px;
|
|
23584
23672
|
gap: 8px;
|
|
23585
23673
|
padding: 4px 8px;
|
|
@@ -23587,7 +23675,7 @@ const selectTag = styled__default["default"].div `
|
|
|
23587
23675
|
z-index: 999;
|
|
23588
23676
|
|
|
23589
23677
|
:hover {
|
|
23590
|
-
background: ${({ isVariant }) => (isVariant ? '#6A3F86' : '#1f6e74')};
|
|
23678
|
+
background: ${({ isVariant, tagColor }) => (tagColor ? tagColor : isVariant ? '#6A3F86' : '#1f6e74')};
|
|
23591
23679
|
}
|
|
23592
23680
|
|
|
23593
23681
|
& > p {
|
|
@@ -23699,46 +23787,67 @@ var css_248z = ".p-component,\n.p-component * {\n box-sizing: border-box;\n}\n\
|
|
|
23699
23787
|
styleInject(css_248z);
|
|
23700
23788
|
|
|
23701
23789
|
function DropdownMultiselect(props) {
|
|
23702
|
-
const { canShowAvatar = true, useTextFilter = false, searchTerm, hiddenAddAll, variantModeDescritpion, width } = props;
|
|
23790
|
+
const { canShowAvatar = true, useTextFilter = false, searchTerm, hiddenAddAll, variantModeDescritpion, width, listItems, selectedDefault, getSelectedItems, onSearch, tagColor } = props;
|
|
23703
23791
|
const [selectedValues, setSelectedValues] = React.useState([]);
|
|
23704
23792
|
const [textFilter, setTextFilter] = React.useState(searchTerm || '');
|
|
23705
|
-
const [listItemsFilter, setListItemsFilter] = React.useState(
|
|
23793
|
+
const [listItemsFilter, setListItemsFilter] = React.useState(listItems);
|
|
23706
23794
|
const [showModal, setShowModal] = React.useState(false);
|
|
23707
23795
|
const [listFilterSearch, setListFilterSearch] = React.useState();
|
|
23708
23796
|
const [lazyLoading, setLazyLoading] = React.useState(false);
|
|
23709
23797
|
const [lazyItems, setLazyItems] = React.useState([]);
|
|
23710
23798
|
const loadLazyTimeout = React.useRef(null);
|
|
23799
|
+
// Atualiza a lista de itens quando props.listItems muda
|
|
23711
23800
|
React.useEffect(() => {
|
|
23712
|
-
|
|
23713
|
-
|
|
23801
|
+
if (listItems) {
|
|
23802
|
+
setListItemsFilter(listItems);
|
|
23803
|
+
setListFilterSearch(listItems);
|
|
23804
|
+
}
|
|
23805
|
+
}, [listItems]);
|
|
23806
|
+
// Atualiza o termo de busca quando searchTerm muda
|
|
23714
23807
|
React.useEffect(() => {
|
|
23715
|
-
|
|
23808
|
+
if (searchTerm !== undefined) {
|
|
23809
|
+
setTextFilter(searchTerm || '');
|
|
23810
|
+
}
|
|
23716
23811
|
}, [searchTerm]);
|
|
23812
|
+
// Filtra os itens quando useTextFilter está ativado
|
|
23717
23813
|
React.useEffect(() => {
|
|
23718
|
-
if (!useTextFilter)
|
|
23814
|
+
if (!useTextFilter || !listItemsFilter)
|
|
23719
23815
|
return;
|
|
23720
|
-
|
|
23816
|
+
const temp = listItemsFilter.filter((resp) => resp.name.toLowerCase().includes(textFilter.toLowerCase()));
|
|
23721
23817
|
setListFilterSearch(temp);
|
|
23722
|
-
}, [textFilter]);
|
|
23818
|
+
}, [textFilter, listItemsFilter, useTextFilter]);
|
|
23819
|
+
// Inicializa valores selecionados com selectedDefault
|
|
23723
23820
|
React.useEffect(() => {
|
|
23724
|
-
if (
|
|
23725
|
-
setSelectedValues(
|
|
23821
|
+
if (selectedDefault) {
|
|
23822
|
+
setSelectedValues(selectedDefault);
|
|
23726
23823
|
}
|
|
23727
|
-
}, [
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
|
|
23824
|
+
}, [selectedDefault]);
|
|
23825
|
+
// Notifica o componente pai sobre alterações nos valores selecionados
|
|
23826
|
+
// Envolvendo em um useCallback para evitar loops infinitos
|
|
23827
|
+
const notifySelectedItemsChange = React.useCallback(() => {
|
|
23828
|
+
if (getSelectedItems) {
|
|
23829
|
+
getSelectedItems(selectedValues);
|
|
23830
|
+
}
|
|
23831
|
+
}, [selectedValues, getSelectedItems]);
|
|
23731
23832
|
React.useEffect(() => {
|
|
23732
|
-
|
|
23733
|
-
}, [
|
|
23833
|
+
notifySelectedItemsChange();
|
|
23834
|
+
}, [notifySelectedItemsChange]);
|
|
23734
23835
|
const removeSelectedValue = (id) => {
|
|
23735
23836
|
setSelectedValues((prev) => {
|
|
23736
|
-
|
|
23737
|
-
const index =
|
|
23738
|
-
|
|
23739
|
-
|
|
23837
|
+
const newValues = [...prev];
|
|
23838
|
+
const index = newValues.map((value) => value.id).indexOf(id);
|
|
23839
|
+
if (index !== -1) {
|
|
23840
|
+
newValues.splice(index, 1);
|
|
23841
|
+
}
|
|
23842
|
+
return newValues;
|
|
23740
23843
|
});
|
|
23741
23844
|
};
|
|
23845
|
+
const handleSearchChange = (value) => {
|
|
23846
|
+
setTextFilter(value);
|
|
23847
|
+
if (onSearch) {
|
|
23848
|
+
onSearch(value);
|
|
23849
|
+
}
|
|
23850
|
+
};
|
|
23742
23851
|
const itemTemplate = (item) => {
|
|
23743
23852
|
const fullText = variantModeDescritpion
|
|
23744
23853
|
? `${item?.name} ${item?.description ? `- ${item.description}` : ''} ${item?.subDescription ? `- ${item.subDescription}` : ''} ${!!item?.isVariant ? ' (Externo)' : ''}`
|
|
@@ -23747,43 +23856,38 @@ function DropdownMultiselect(props) {
|
|
|
23747
23856
|
(item?.isVariant ? jsxRuntime.jsx(ExternalAvatar, {}) : jsxRuntime.jsx(Avatar, { src: item?.avatar, size: "24px" })), jsxRuntime.jsxs(TextContainer, { children: [item?.name, variantModeDescritpion ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!!item?.description && ` - ${item.description}`, !!item?.subDescription && ` - ${item.subDescription}`, !!item?.isVariant && jsxRuntime.jsx("span", { style: { color: '#757575' }, children: ` (Externo)` })] })) : (item?.description && jsxRuntime.jsxs("span", { style: { color: '#757575' }, children: [" (", item.description, ") "] }))] })] }) }));
|
|
23748
23857
|
};
|
|
23749
23858
|
const selectTemplate = (option) => {
|
|
23750
|
-
|
|
23751
|
-
if (option) {
|
|
23752
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: option.map((item, index) => {
|
|
23753
|
-
if (index < props.maxSelectedShow) {
|
|
23754
|
-
return props.optionLayout ? (props.optionLayout(item)) : (jsxRuntime.jsxs(selectTag, { id: "tag-container", isVariant: !!item?.isVariant, children: [canShowAvatar &&
|
|
23755
|
-
(item?.isVariant ? (externaAvatarBackgroundWhite) : (jsxRuntime.jsx(Avatar, { src: item?.avatar, size: "24px" }))), jsxRuntime.jsxs("p", { children: [" ", item?.name, " "] }), jsxRuntime.jsx(material.IconButton, { id: "close-icon", onClick: () => removeSelectedValue(item.id), children: jsxRuntime.jsx(CloseIcon, { width: "8", height: "8", fill: "#FFFFFF" }) })] }, index));
|
|
23756
|
-
}
|
|
23757
|
-
else if (index === props?.maxSelectedShow) {
|
|
23758
|
-
return (jsxRuntime.jsx(overShowInfo, { onClick: () => setShowModal(true), id: "number-people", children: jsxRuntime.jsx("p", { children: `+ ${pessoasAMais} ${pessoasAMais > 1 ? props?.people : props?.person}` }) }, index));
|
|
23759
|
-
}
|
|
23760
|
-
}) }));
|
|
23761
|
-
}
|
|
23762
|
-
else {
|
|
23859
|
+
if (!option || option.length === 0)
|
|
23763
23860
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
23764
|
-
|
|
23861
|
+
const pessoasAMais = selectedValues?.length - props.maxSelectedShow;
|
|
23862
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: option.map((item, index) => {
|
|
23863
|
+
if (index < props.maxSelectedShow) {
|
|
23864
|
+
return props.optionLayout ? (props.optionLayout(item)) : (jsxRuntime.jsxs(SelectTag, { id: "tag-container", isVariant: !!item?.isVariant, tagColor: tagColor, children: [canShowAvatar &&
|
|
23865
|
+
(item?.isVariant ? (externaAvatarBackgroundWhite) : (jsxRuntime.jsx(Avatar, { src: item?.avatar, size: "24px" }))), jsxRuntime.jsxs("p", { children: [" ", item?.name, " "] }), jsxRuntime.jsx(material.IconButton, { id: "close-icon", onClick: () => removeSelectedValue(item.id), children: jsxRuntime.jsx(CloseIcon, { width: "8", height: "8", fill: "#FFFFFF" }) })] }, index));
|
|
23866
|
+
}
|
|
23867
|
+
else if (index === props?.maxSelectedShow) {
|
|
23868
|
+
return (jsxRuntime.jsx(overShowInfo, { onClick: () => setShowModal(true), id: "number-people", children: jsxRuntime.jsx("p", { children: `+ ${pessoasAMais} ${pessoasAMais > 1 ? props?.people : props?.person}` }) }, index));
|
|
23869
|
+
}
|
|
23870
|
+
return null;
|
|
23871
|
+
}) }));
|
|
23872
|
+
};
|
|
23873
|
+
const handleSelectAll = () => {
|
|
23874
|
+
if (!listFilterSearch)
|
|
23875
|
+
return;
|
|
23876
|
+
setSelectedValues((prev) => {
|
|
23877
|
+
const currentIds = new Set(prev.map(item => item.id));
|
|
23878
|
+
const newItems = listFilterSearch.filter(value => !currentIds.has(value.id));
|
|
23879
|
+
return [...prev, ...newItems];
|
|
23880
|
+
});
|
|
23765
23881
|
};
|
|
23766
23882
|
const handleTemplateHeader = () => {
|
|
23767
|
-
|
|
23768
|
-
selectedItems ? selectedItems?.length : 0;
|
|
23769
|
-
return (jsxRuntime.jsxs(searchAndButton, { children: [jsxRuntime.jsx("div", { style: { marginBottom: hiddenAddAll ? '0rem' : '1rem' }, children: jsxRuntime.jsx(SearchField, { placeholder: props.searchSelectPlaceholder ? props.searchSelectPlaceholder : 'Buscar', className: null, handleClickButton: null, isButton: true, hasSearchIcon: true, value: textFilter, onChange: (e) => {
|
|
23770
|
-
props.onSearch(e.target.value);
|
|
23771
|
-
setTextFilter(e.target.value);
|
|
23772
|
-
} }) }), props.listItems?.length > 0 && !hiddenAddAll ? (jsxRuntime.jsx(Button$5, { id: "select-all", variant: 'link', label: props.btnSelectAllText ? props.btnSelectAllText : 'Selecionar todos', disabled: false, handleClick: () => {
|
|
23773
|
-
setSelectedValues([
|
|
23774
|
-
...selectedValues,
|
|
23775
|
-
...listFilterSearch.filter((value) => {
|
|
23776
|
-
if (!selectedValues.find((item) => item.id === value.id)) {
|
|
23777
|
-
return value;
|
|
23778
|
-
}
|
|
23779
|
-
})
|
|
23780
|
-
]);
|
|
23781
|
-
} })) : (jsxRuntime.jsx(jsxRuntime.Fragment, {}))] }));
|
|
23883
|
+
return (jsxRuntime.jsxs(searchAndButton, { children: [jsxRuntime.jsx("div", { style: { marginBottom: hiddenAddAll ? '0rem' : '1rem' }, children: jsxRuntime.jsx(SearchField, { placeholder: props.searchSelectPlaceholder ? props.searchSelectPlaceholder : 'Buscar', className: null, handleClickButton: null, isButton: true, hasSearchIcon: true, value: textFilter, onChange: (e) => handleSearchChange(e.target.value) }) }), listFilterSearch?.length > 0 && !hiddenAddAll ? (jsxRuntime.jsx(Button$5, { id: "select-all", variant: 'link', label: props.btnSelectAllText ? props.btnSelectAllText : 'Selecionar todos', disabled: false, handleClick: handleSelectAll })) : (jsxRuntime.jsx(jsxRuntime.Fragment, {}))] }));
|
|
23782
23884
|
};
|
|
23783
23885
|
const selectValuesModal = () => {
|
|
23784
|
-
|
|
23886
|
+
if (!selectedValues || !showModal)
|
|
23887
|
+
return null;
|
|
23888
|
+
return (jsxRuntime.jsx(material.Modal, { open: showModal, onClose: () => setShowModal(false), children: jsxRuntime.jsxs(modalContainer, { id: "container-modal", children: [jsxRuntime.jsx(modalHeader, { id: "header-people", children: jsxRuntime.jsxs("p", { children: [props.modalTitle ? props.modalTitle : 'Este grupo é administrado por', ' ', selectedValues.length, " ", selectedValues.length > 1 ? props.people : props.person, ' '] }) }), jsxRuntime.jsx(modalContent, { children: selectedValues.map((item, index) => {
|
|
23785
23889
|
return (jsxRuntime.jsxs(modalCards, { style: { background: index % 2 === 0 ? '#F2F2F2' : '#FFF' }, children: [jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '12px' }, children: [canShowAvatar &&
|
|
23786
|
-
(item?.isVariant ? (jsxRuntime.jsx(ExternalAvatar, { size: "50px" })) : (jsxRuntime.jsx(Avatar, { src: item?.avatar, size: "50px" }))), jsxRuntime.jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsxRuntime.jsxs(cardTitle, { children: [" ", item?.name, " "] }), jsxRuntime.jsxs(cardDescription, { children: [" ", item?.description, " "] }), jsxRuntime.jsxs(cardDescription, { children: [" ", item?.subDescription, " "] })] })] }), jsxRuntime.jsxs("div", { id: "remove-people-admin", style: { display: 'flex', cursor: 'pointer' }, onClick: () => removeSelectedValue(item?.id), children: [jsxRuntime.jsx(Trash, { fill: "#A50000", width: "24", height: "24" }), jsxRuntime.jsxs(cardTitle, { style: { color: '#A50000' }, children: [
|
|
23890
|
+
(item?.isVariant ? (jsxRuntime.jsx(ExternalAvatar, { size: "50px" })) : (jsxRuntime.jsx(Avatar, { src: item?.avatar, size: "50px" }))), jsxRuntime.jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsxRuntime.jsxs(cardTitle, { children: [" ", item?.name, " "] }), jsxRuntime.jsxs(cardDescription, { children: [" ", item?.description, " "] }), jsxRuntime.jsxs(cardDescription, { children: [" ", item?.subDescription, " "] })] })] }), jsxRuntime.jsxs("div", { id: "remove-people-admin", style: { display: 'flex', cursor: 'pointer' }, onClick: () => removeSelectedValue(item?.id), children: [jsxRuntime.jsx(Trash, { fill: "#A50000", width: "24", height: "24" }), jsxRuntime.jsxs(cardTitle, { style: { color: '#A50000' }, children: [props?.removeModalText ? props.removeModalText : 'Remover', ' '] })] })] }, index));
|
|
23787
23891
|
}) }), jsxRuntime.jsx(closeModal, { children: jsxRuntime.jsx(material.IconButton, { id: "close-modal", onClick: () => setShowModal(false), children: jsxRuntime.jsx(CloseIcon, {}) }) })] }) }));
|
|
23788
23892
|
};
|
|
23789
23893
|
const onLazyLoad = (event) => {
|
|
@@ -23802,29 +23906,30 @@ function DropdownMultiselect(props) {
|
|
|
23802
23906
|
setLazyLoading(false);
|
|
23803
23907
|
}, Math.random() * 500 + 250);
|
|
23804
23908
|
};
|
|
23805
|
-
|
|
23909
|
+
const renderVirtualScrollerOptions = () => {
|
|
23910
|
+
if (!props.activeLazyLoad)
|
|
23911
|
+
return null;
|
|
23912
|
+
return {
|
|
23913
|
+
lazy: true,
|
|
23914
|
+
onLazyLoad: onLazyLoad,
|
|
23915
|
+
itemSize: 50,
|
|
23916
|
+
showLoader: true,
|
|
23917
|
+
loading: lazyLoading,
|
|
23918
|
+
delay: 100,
|
|
23919
|
+
loadingTemplate: (option) => (jsxRuntime.jsx("div", { style: {
|
|
23920
|
+
display: 'flex',
|
|
23921
|
+
alignItems: 'center',
|
|
23922
|
+
padding: 2,
|
|
23923
|
+
height: '50px'
|
|
23924
|
+
}, children: jsxRuntime.jsx(material.Skeleton, { width: option.even ? '70%' : '60%', height: '2rem' }) }))
|
|
23925
|
+
};
|
|
23926
|
+
};
|
|
23927
|
+
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs(containerSelect, { style: { ...props.style }, id: "container-select", children: [selectedValues?.length > 0 && (jsxRuntime.jsxs(headerSelect, { children: [selectTemplate(selectedValues), selectedValues?.length > 1 && (jsxRuntime.jsx("div", { style: { zIndex: 999, position: 'absolute', right: 40 }, id: "remove-all-selected", children: jsxRuntime.jsx(Tooltip$2, { content: props.removeItemsToolTip ? props.removeItemsToolTip : 'Excluir todos', direction: "bottom", trigger: "hover", style: { height: 'auto' }, children: jsxRuntime.jsx(material.IconButton, { onClick: () => setSelectedValues([]), children: jsxRuntime.jsx(Trash, { fill: "#9C9C9C" }) }) }) }))] })), jsxRuntime.jsx(customSelect, { onClick: () => textFilter !== '' && setTextFilter(''), children: jsxRuntime.jsx(multiselect.MultiSelect, { id: "list-selected", panelStyle: {
|
|
23806
23928
|
display: props.isModalOpen !== undefined ? (props.isModalOpen ? 'block' : 'none') : 'block',
|
|
23807
23929
|
background: '#fff'
|
|
23808
23930
|
}, value: selectedValues, options: listFilterSearch, onChange: (e) => setSelectedValues(e.value), placeholder: props.selectPlaceholder ? props.selectPlaceholder : 'Selecione aqui', className: "custom-multiselect", dropdownIcon: jsxRuntime.jsx(DropdownIcon, { fill: FRSTTheme['colors'].shadeBlack }), panelHeaderTemplate: handleTemplateHeader(), itemTemplate: itemTemplate, disabled: props.isDisabled, maxSelectedLabels: 0, selectedItemsLabel: " ", style: {
|
|
23809
23931
|
border: selectedValues?.length > 0 ? 'none' : `1px solid ${FRSTTheme['colors'].borderPrimary}`
|
|
23810
|
-
}, virtualScrollerOptions:
|
|
23811
|
-
? null
|
|
23812
|
-
: {
|
|
23813
|
-
lazy: true,
|
|
23814
|
-
onLazyLoad: onLazyLoad,
|
|
23815
|
-
itemSize: 50,
|
|
23816
|
-
showLoader: true,
|
|
23817
|
-
loading: lazyLoading,
|
|
23818
|
-
delay: 100,
|
|
23819
|
-
loadingTemplate: (option) => {
|
|
23820
|
-
return (jsxRuntime.jsx("div", { style: {
|
|
23821
|
-
display: 'flex',
|
|
23822
|
-
alignItems: 'center',
|
|
23823
|
-
padding: 2,
|
|
23824
|
-
height: '50px'
|
|
23825
|
-
}, children: jsxRuntime.jsx(material.Skeleton, { width: option.even ? '70%' : '60%', height: '2rem' }) }));
|
|
23826
|
-
}
|
|
23827
|
-
} }) }), selectedValues && selectValuesModal()] }) }));
|
|
23932
|
+
}, virtualScrollerOptions: renderVirtualScrollerOptions() }) }), selectValuesModal()] }) }));
|
|
23828
23933
|
}
|
|
23829
23934
|
const ExternalAvatar = ({ size = '24' }) => {
|
|
23830
23935
|
return (jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 25 24", fill: "white", children: [jsxRuntime.jsx("g", { children: jsxRuntime.jsx("path", { d: "M12.5231 0.333496C6.08311 0.333496 0.856445 5.56016 0.856445 12.0002C0.856445 18.4402 6.08311 23.6668 12.5231 23.6668C18.9631 23.6668 24.1898 18.4402 24.1898 12.0002C24.1898 5.56016 18.9631 0.333496 12.5231 0.333496ZM12.5231 3.8335C14.4598 3.8335 16.0231 5.39683 16.0231 7.3335C16.0231 9.27016 14.4598 10.8335 12.5231 10.8335C10.5864 10.8335 9.02311 9.27016 9.02311 7.3335C9.02311 5.39683 10.5864 3.8335 12.5231 3.8335ZM12.5231 20.4002C9.60645 20.4002 7.02811 18.9068 5.52311 16.6435C5.55811 14.3218 10.1898 13.0502 12.5231 13.0502C14.8448 13.0502 19.4881 14.3218 19.5231 16.6435C18.0181 18.9068 15.4398 20.4002 12.5231 20.4002Z", fill: "#6A3F86" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { children: jsxRuntime.jsx("rect", { width: size, height: size, fill: "white" }) }) })] }));
|