This commit is contained in:
Nikita Gopienko 2020-02-17 16:50:49 +03:00
commit 785f002c4d
10 changed files with 27 additions and 18 deletions

View File

@ -209,7 +209,7 @@ class SectionBodyContent extends React.PureComponent {
},
isSelf
? viewer.isOwner
? {}
? null
: {
key: "delete-profile",
label: t("DeleteSelfProfile"),
@ -280,7 +280,7 @@ class SectionBodyContent extends React.PureComponent {
};
onContentRowSelect = (checked, user) => {
console.log("ContentRow onSelect", checked, user);
//console.log("ContentRow onSelect", checked, user);
if (checked) {
this.props.selectUser(user);
} else {
@ -311,7 +311,7 @@ class SectionBodyContent extends React.PureComponent {
};
render() {
console.log("Home SectionBodyContent render()");
//console.log("Home SectionBodyContent render()");
const { users, viewer, selection, history, settings, t, filter } = this.props;
const { dialogsVisible, user } = this.state;
@ -321,7 +321,7 @@ class SectionBodyContent extends React.PureComponent {
<>
<RowContainer useReactWindow={false}>
{users.map(user => {
const contextOptions = this.getUserContextOptions(user, viewer);
const contextOptions = this.getUserContextOptions(user, viewer).filter(o => o);
const contextOptionsProps = !contextOptions.length
? {}
: { contextOptions };

View File

@ -1,6 +1,6 @@
{
"name": "asc-web-common",
"version": "1.0.86",
"version": "1.0.88",
"description": "Ascensio System SIA common components and solutions library",
"license": "AGPL-3.0",
"files": [

View File

@ -26,6 +26,8 @@ class PageLayoutComponent extends React.PureComponent {
componentDidMount() {
window.addEventListener("orientationchange", this.orientationChangeHandler);
const articleElement = document.getElementsByTagName('article') && document.getElementsByTagName('article')[0];
articleElement && this.orientationChangeHandler();
}
componentWillUnmount() {

View File

@ -1,6 +1,6 @@
{
"name": "asc-web-components",
"version": "1.0.356",
"version": "1.0.358",
"description": "Ascensio System SIA component library",
"license": "AGPL-3.0",
"main": "dist/asc-web-components.js",

View File

@ -87,6 +87,7 @@ class ContextMenuButton extends React.Component {
onMouseOver,
onMouseOut,
directionX,
directionY,
className,
id,
style
@ -113,7 +114,8 @@ class ContextMenuButton extends React.Component {
onMouseOut={onMouseOut}
/>
<DropDown
directionX={directionX}
directionX={directionX}
directionY={directionY}
open={isOpen}
clickOutsideAction={this.clickOutsideAction}
>
@ -152,6 +154,7 @@ ContextMenuButton.propTypes = {
onMouseOut: PropTypes.func,
directionX: PropTypes.string,
directionY: PropTypes.string,
className: PropTypes.string,
id: PropTypes.string,

View File

@ -75,6 +75,7 @@ class ContextMenu extends React.PureComponent {
}
render() {
//console.log('ContextMenu render', this.props);
const { visible } = this.state;
const { options, id, className, style } = this.props;
@ -83,7 +84,7 @@ class ContextMenu extends React.PureComponent {
id={id}
className={className}
style={style}
open={true}
open={visible}
clickOutsideAction={this.handleClick}
>
{options.map((item) => {

View File

@ -12,12 +12,11 @@ const StyledDropdown = styled.div`
font-style: normal;
font-weight: 600;
font-size: 13px;
${props => props.maxHeight && `
max-height: ${props.maxHeight}px;
overflow-y: auto;
`}
height: fit-content;
position: absolute;
${props => props.manualWidth && `width: ${props.manualWidth};`}
${props => (props.directionY === 'top' && css`bottom: ${props => props.manualY ? props.manualY : '100%'};`)}
@ -33,7 +32,6 @@ const StyledDropdown = styled.div`
box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.13);
-moz-box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.13);
-webkit-box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.13);
padding: ${props => !props.maxHeight && props.children && props.children.length > 1 && `6px 0px`};
`;
@ -100,11 +98,10 @@ class DropDown extends React.PureComponent {
const container = { width: window.innerWidth, height: window.innerHeight };
const left = rects.left < 0 && rects.width < container.width;
const right = rects.left < 250 && rects.left > rects.width && rects.width < container.width;
const top = rects.bottom > container.height;
const bottom = null;
const top = rects.bottom > container.height && rects.top > rects.height;
const bottom = rects.top < 0;
const x = left ? 'left' : right ? 'right' : this.state.directionX;
const y = top ? 'top' : bottom ? 'bottom' : this.state.directionY;
const y = bottom ? 'bottom' : top ? 'top' : this.state.directionY;
this.setState({
directionX: x,
@ -121,7 +118,7 @@ class DropDown extends React.PureComponent {
const fullHeight = children && children.length * itemHeight;
const calculatedHeight = ((fullHeight > 0) && (fullHeight < maxHeight)) ? fullHeight : maxHeight;
const dropDownMaxHeightProp = maxHeight ? { height: calculatedHeight + 'px' } : {};
//console.log("DropDown render");
//console.log("DropDown render", this.props);
return (
<StyledDropdown
ref={this.dropDownRef}

View File

@ -84,7 +84,7 @@ const StyledComboBox = styled(ComboBox)`
max-width: 185px;
cursor: pointer;
vertical-align: middle;
margin-top: -1px;
margin-top: -2px;
> div:first-child{
width: auto;
padding-left: 4px;

View File

@ -15,7 +15,7 @@ class FilterButton extends React.PureComponent {
size={this.props.iconSize}
isDisabled={this.props.isDisabled}
getData={this.props.getData}
directionY='bottom'
className='filter-button'
></ContextMenuButton>
)

View File

@ -28,6 +28,12 @@ const StyledSearchInput = styled.div`
@media ${mobile} {
width: calc(100% - 58px);
}
.search-input-block {
& > input {
height: 30px;
}
}
`;
const StyledFilterBlock = styled.div`
display: flex;