2022-02-02 13:18:15 +00:00
|
|
|
import styled from "styled-components";
|
|
|
|
import commonInputStyle from "../text-input/common-input-styles";
|
|
|
|
import Base from "../themes/base";
|
2022-02-07 15:49:08 +00:00
|
|
|
import TextInput from "../text-input";
|
2022-02-02 13:18:15 +00:00
|
|
|
|
2022-02-07 15:49:08 +00:00
|
|
|
const StyledChipWithInput = styled.div`
|
|
|
|
min-height: 32px;
|
2022-02-08 13:41:29 +00:00
|
|
|
max-height: 220px;
|
|
|
|
width: 100%;
|
2022-02-07 15:49:08 +00:00
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
height: fit-content;
|
|
|
|
width: ${(props) => props.length === 0 && "100%"};
|
|
|
|
`;
|
|
|
|
|
2022-02-02 13:18:15 +00:00
|
|
|
const StyledContent = styled.div`
|
2022-02-17 11:37:44 +00:00
|
|
|
position: relative;
|
2022-02-02 13:18:15 +00:00
|
|
|
width: 469px;
|
2022-02-08 13:41:29 +00:00
|
|
|
height: 220px;
|
2022-02-02 13:18:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-02-07 15:49:08 +00:00
|
|
|
const StyledChipGroup = styled.div`
|
2022-02-17 11:37:44 +00:00
|
|
|
:focus-visible {
|
|
|
|
outline: 0px solid #2da7db !important;
|
|
|
|
}
|
2022-02-07 15:49:08 +00:00
|
|
|
height: fit-content;
|
|
|
|
${commonInputStyle} :focus-within {
|
|
|
|
border-color: ${(props) => props.theme.inputBlock.borderColor};
|
|
|
|
}
|
|
|
|
|
|
|
|
.scroll {
|
|
|
|
height: fit-content;
|
|
|
|
position: inherit !important;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2022-02-25 11:42:31 +00:00
|
|
|
|
2022-02-17 11:37:44 +00:00
|
|
|
:focus-visible {
|
|
|
|
outline: 0px solid #2da7db !important;
|
|
|
|
}
|
2022-02-07 15:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
input {
|
|
|
|
flex: 1 0 auto;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
StyledChipGroup.defaultProps = { theme: Base };
|
|
|
|
|
2022-02-08 13:41:29 +00:00
|
|
|
const StyledAllChips = styled.div`
|
|
|
|
width: 448px;
|
|
|
|
max-height: 180px;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
`;
|
|
|
|
|
2022-02-02 13:18:15 +00:00
|
|
|
const StyledChip = styled.div`
|
|
|
|
width: fit-content;
|
2022-02-08 13:41:29 +00:00
|
|
|
max-width: calc(100% - 18px);
|
2022-02-02 13:18:15 +00:00
|
|
|
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
box-sizing: border-box;
|
2022-02-17 11:37:44 +00:00
|
|
|
background: #eceef1;
|
2022-02-02 13:18:15 +00:00
|
|
|
|
2022-02-08 13:41:29 +00:00
|
|
|
height: 32px;
|
|
|
|
margin: 2px 4px;
|
2022-02-11 14:43:50 +00:00
|
|
|
padding: ${(props) => (props.isSelected ? "5px 7px" : "6px 8px")};
|
2022-02-02 13:18:15 +00:00
|
|
|
|
2022-02-17 11:37:44 +00:00
|
|
|
border-radius: 3px 0 0 3px;
|
2022-02-02 13:18:15 +00:00
|
|
|
border: ${(props) => props.isSelected && "1px dashed #000"};
|
2022-02-08 13:41:29 +00:00
|
|
|
background: ${(props) => (props.isValid ? "#ECEEF1" : "#F7CDBE")};
|
2022-02-07 15:49:08 +00:00
|
|
|
|
|
|
|
.warning_icon_wrap {
|
|
|
|
cursor: pointer;
|
|
|
|
.warning_icon {
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
|
|
|
}
|
2022-02-02 13:18:15 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledChipValue = styled.div`
|
|
|
|
margin-right: 4px;
|
2022-02-08 13:41:29 +00:00
|
|
|
min-width: 0px;
|
2022-03-01 14:10:57 +00:00
|
|
|
max-width: 395px;
|
2022-02-08 13:41:29 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2022-02-02 13:18:15 +00:00
|
|
|
|
|
|
|
font-weight: normal;
|
2022-02-08 13:41:29 +00:00
|
|
|
font-size: 13px;
|
2022-02-02 13:18:15 +00:00
|
|
|
|
2022-02-17 11:37:44 +00:00
|
|
|
color: #333333;
|
2022-02-02 13:18:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-03-01 11:53:57 +00:00
|
|
|
const StyledContainer = styled.div`
|
|
|
|
position: relative;
|
|
|
|
`;
|
|
|
|
|
2022-02-07 15:49:08 +00:00
|
|
|
const StyledChipInput = styled(TextInput)`
|
2022-02-18 10:27:07 +00:00
|
|
|
flex: ${(props) => `${props.flexvalue}!important`};
|
2022-02-08 13:41:29 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledInputWithLink = styled.div`
|
2022-02-11 14:43:50 +00:00
|
|
|
position: relative;
|
2022-02-21 20:30:42 +00:00
|
|
|
|
|
|
|
display: grid;
|
|
|
|
gap: 8px;
|
|
|
|
grid-template-columns: auto 15%;
|
|
|
|
align-content: space-between;
|
|
|
|
width: calc(100% - 8px);
|
2022-02-14 10:48:52 +00:00
|
|
|
|
|
|
|
.textInput {
|
2022-02-21 20:30:42 +00:00
|
|
|
width: calc(100% - 8px);
|
2022-02-14 10:48:52 +00:00
|
|
|
padding: 0px;
|
|
|
|
margin: 8px 0px 10px 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.link {
|
2022-02-21 20:30:42 +00:00
|
|
|
text-align: end;
|
|
|
|
margin: 10px 0px;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
margin-right: 8px;
|
2022-02-14 10:48:52 +00:00
|
|
|
}
|
2022-02-02 13:18:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-02-11 14:43:50 +00:00
|
|
|
const StyledTooltip = styled.div`
|
|
|
|
position: absolute;
|
|
|
|
top: -49px;
|
|
|
|
left: 0;
|
2022-02-25 11:42:31 +00:00
|
|
|
|
|
|
|
max-width: 435px;
|
2022-02-11 14:43:50 +00:00
|
|
|
padding: 16px;
|
2022-02-25 11:42:31 +00:00
|
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
|
2022-02-11 14:43:50 +00:00
|
|
|
background: #f8f7bf;
|
|
|
|
border-radius: 6px;
|
|
|
|
opacity: 0.9;
|
|
|
|
`;
|
|
|
|
|
2022-02-02 13:18:15 +00:00
|
|
|
export {
|
2022-02-07 15:49:08 +00:00
|
|
|
StyledChipWithInput,
|
2022-02-02 13:18:15 +00:00
|
|
|
StyledContent,
|
2022-02-07 15:49:08 +00:00
|
|
|
StyledChipGroup,
|
2022-02-08 13:41:29 +00:00
|
|
|
StyledAllChips,
|
2022-02-02 13:18:15 +00:00
|
|
|
StyledChip,
|
|
|
|
StyledChipValue,
|
2022-03-01 11:53:57 +00:00
|
|
|
StyledContainer,
|
2022-02-07 15:49:08 +00:00
|
|
|
StyledChipInput,
|
2022-02-08 13:41:29 +00:00
|
|
|
StyledInputWithLink,
|
2022-02-11 14:43:50 +00:00
|
|
|
StyledTooltip,
|
2022-02-02 13:18:15 +00:00
|
|
|
};
|