2022-03-03 11:25:10 +00:00
|
|
|
import React from "react";
|
|
|
|
import PropTypes from "prop-types";
|
2022-03-16 12:22:48 +00:00
|
|
|
|
2022-01-31 13:40:43 +00:00
|
|
|
import {
|
|
|
|
desktop,
|
|
|
|
size,
|
|
|
|
tablet,
|
2022-04-04 09:25:16 +00:00
|
|
|
mobile,
|
2022-01-31 13:40:43 +00:00
|
|
|
isMobile as isMobileUtils,
|
|
|
|
isTablet as isTabletUtils,
|
|
|
|
} from "@appserver/components/utils/device";
|
2022-03-03 11:25:10 +00:00
|
|
|
import { Provider } from "@appserver/components/utils/context";
|
|
|
|
import { isMobile, isFirefox, isMobileOnly } from "react-device-detect";
|
2022-03-16 12:22:48 +00:00
|
|
|
|
|
|
|
import SectionContainer from "./sub-components/section-container";
|
2022-03-03 11:25:10 +00:00
|
|
|
import SubSectionHeader from "./sub-components/section-header";
|
|
|
|
import SubSectionFilter from "./sub-components/section-filter";
|
2020-08-11 12:34:00 +00:00
|
|
|
import SubSectionBody from "./sub-components/section-body";
|
|
|
|
import SubSectionBodyContent from "./sub-components/section-body-content";
|
2022-04-04 09:25:16 +00:00
|
|
|
import SubSectionBar from "./sub-components/section-bar";
|
2020-08-11 12:34:00 +00:00
|
|
|
import SubSectionPaging from "./sub-components/section-paging";
|
2022-03-21 08:13:56 +00:00
|
|
|
//import SectionToggler from "./sub-components/section-toggler";
|
2022-03-03 11:25:10 +00:00
|
|
|
import InfoPanel from "./sub-components/info-panel";
|
|
|
|
import SubInfoPanelBody from "./sub-components/info-panel-body";
|
|
|
|
import SubInfoPanelHeader from "./sub-components/info-panel-header";
|
2022-03-16 12:22:48 +00:00
|
|
|
|
2022-03-03 11:25:10 +00:00
|
|
|
import ReactResizeDetector from "react-resize-detector";
|
|
|
|
import FloatingButton from "../FloatingButton";
|
|
|
|
import { inject, observer } from "mobx-react";
|
|
|
|
import Selecto from "react-selecto";
|
|
|
|
import styled, { css } from "styled-components";
|
2021-04-13 09:43:17 +00:00
|
|
|
|
2021-06-18 14:17:59 +00:00
|
|
|
const StyledSelectoWrapper = styled.div`
|
2022-03-03 10:43:43 +00:00
|
|
|
.selecto-selection {
|
|
|
|
z-index: 200;
|
|
|
|
}
|
2021-04-13 09:43:17 +00:00
|
|
|
`;
|
2020-10-29 14:33:05 +00:00
|
|
|
|
2021-11-22 12:01:33 +00:00
|
|
|
const StyledMainBar = styled.div`
|
2022-03-03 10:43:43 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
|
2022-04-04 09:25:16 +00:00
|
|
|
margin-left: -20px;
|
2022-04-04 14:40:45 +00:00
|
|
|
/* width: calc(100vw - 256px);
|
|
|
|
max-width: calc(100vw - 256px); */
|
|
|
|
|
|
|
|
width: ${(props) =>
|
|
|
|
props.infoPanelIsVisible ? "calc(100vw - 657px)" : "calc(100vw - 256px)"};
|
|
|
|
max-width: ${(props) =>
|
|
|
|
props.infoPanelIsVisible ? "calc(100vw - 657px)" : "calc(100vw - 256px)"};
|
2022-03-03 10:43:43 +00:00
|
|
|
|
2022-04-04 09:25:16 +00:00
|
|
|
#bar-banner {
|
|
|
|
margin-bottom: -3px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#bar-frame {
|
|
|
|
min-width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ${tablet} {
|
|
|
|
width: ${(props) =>
|
|
|
|
props.showText ? "calc(100vw - 240px)" : "calc(100vw - 52px)"};
|
|
|
|
max-width: ${(props) =>
|
|
|
|
props.showText ? "calc(100vw - 240px)" : "calc(100vw - 52px)"};
|
|
|
|
margin-left: -16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
${isMobile &&
|
|
|
|
css`
|
|
|
|
width: ${(props) =>
|
|
|
|
props.showText ? "calc(100vw - 240px)" : "calc(100vw - 52px)"} !important;
|
|
|
|
max-width: ${(props) =>
|
|
|
|
props.showText ? "calc(100vw - 240px)" : "calc(100vw - 52px)"} !important;
|
|
|
|
margin-left: -16px;
|
|
|
|
`}
|
|
|
|
|
|
|
|
@media ${mobile} {
|
|
|
|
width: 100vw !important;
|
|
|
|
max-width: 100vw !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
${isMobileOnly &&
|
|
|
|
css`
|
|
|
|
width: 100vw !important;
|
|
|
|
max-width: 100vw !important;
|
|
|
|
|
|
|
|
#bar-frame {
|
|
|
|
min-width: 100vw;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
|
|
|
|
${(props) =>
|
|
|
|
!props.isSectionHeaderAvailable &&
|
|
|
|
css`
|
|
|
|
width: 100vw !important;
|
|
|
|
max-width: 100vw !important;
|
|
|
|
|
|
|
|
${isMobile &&
|
|
|
|
css`
|
|
|
|
position: fixed;
|
|
|
|
top: 48px;
|
|
|
|
left: 0;
|
|
|
|
margin-left: 0 !important;
|
|
|
|
box-sizing: border-box;
|
2022-03-03 10:43:43 +00:00
|
|
|
`}
|
2022-04-04 09:25:16 +00:00
|
|
|
`}
|
2021-11-22 12:01:33 +00:00
|
|
|
`;
|
|
|
|
|
2020-08-11 12:34:00 +00:00
|
|
|
function SectionHeader() {
|
2022-03-03 10:43:43 +00:00
|
|
|
return null;
|
2020-08-11 12:34:00 +00:00
|
|
|
}
|
|
|
|
SectionHeader.displayName = "SectionHeader";
|
|
|
|
|
2022-04-04 09:25:16 +00:00
|
|
|
function SectionBar() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionBar.displayName = "SectionBar";
|
|
|
|
|
2020-08-11 12:34:00 +00:00
|
|
|
function SectionFilter() {
|
2022-03-03 10:43:43 +00:00
|
|
|
return null;
|
2020-08-11 12:34:00 +00:00
|
|
|
}
|
|
|
|
SectionFilter.displayName = "SectionFilter";
|
|
|
|
|
|
|
|
function SectionBody() {
|
2022-03-03 10:43:43 +00:00
|
|
|
return null;
|
2020-08-11 12:34:00 +00:00
|
|
|
}
|
|
|
|
SectionBody.displayName = "SectionBody";
|
|
|
|
|
|
|
|
function SectionPaging() {
|
2022-03-03 10:43:43 +00:00
|
|
|
return null;
|
2020-08-11 12:34:00 +00:00
|
|
|
}
|
|
|
|
SectionPaging.displayName = "SectionPaging";
|
|
|
|
|
2022-02-11 14:35:18 +00:00
|
|
|
function InfoPanelBody() {
|
2022-03-03 10:43:43 +00:00
|
|
|
return null;
|
2022-02-08 12:11:31 +00:00
|
|
|
}
|
2022-02-11 14:35:18 +00:00
|
|
|
InfoPanelBody.displayName = "InfoPanelBody";
|
2022-02-09 09:13:16 +00:00
|
|
|
|
2022-02-11 14:35:18 +00:00
|
|
|
function InfoPanelHeader() {
|
2022-03-03 10:43:43 +00:00
|
|
|
return null;
|
2022-02-09 09:13:16 +00:00
|
|
|
}
|
2022-02-11 14:35:18 +00:00
|
|
|
InfoPanelHeader.displayName = "InfoPanelHeader";
|
2022-02-08 12:11:31 +00:00
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
class Section extends React.Component {
|
2022-03-03 10:43:43 +00:00
|
|
|
static SectionHeader = SectionHeader;
|
|
|
|
static SectionFilter = SectionFilter;
|
|
|
|
static SectionBody = SectionBody;
|
2022-04-04 09:25:16 +00:00
|
|
|
static SectionBar = SectionBar;
|
2022-03-03 10:43:43 +00:00
|
|
|
static SectionPaging = SectionPaging;
|
|
|
|
static InfoPanelBody = InfoPanelBody;
|
|
|
|
static InfoPanelHeader = InfoPanelHeader;
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.timeoutHandler = null;
|
|
|
|
this.intervalHandler = null;
|
|
|
|
|
|
|
|
this.scroll = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
if (!this.scroll) {
|
|
|
|
this.scroll = document.getElementsByClassName("section-scroll")[0];
|
2021-06-18 14:17:59 +00:00
|
|
|
}
|
2022-03-03 10:43:43 +00:00
|
|
|
}
|
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
componentDidMount() {}
|
2022-03-03 10:43:43 +00:00
|
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
if (this.intervalHandler) clearInterval(this.intervalHandler);
|
|
|
|
if (this.timeoutHandler) clearTimeout(this.timeoutHandler);
|
|
|
|
}
|
|
|
|
|
|
|
|
onSelect = (e) => {
|
|
|
|
if (this.props.dragging) return;
|
|
|
|
const items = e.selected;
|
|
|
|
this.props.setSelections(items);
|
|
|
|
};
|
|
|
|
|
|
|
|
dragCondition = (e) => {
|
|
|
|
const path = e.inputEvent.composedPath();
|
|
|
|
const isBackdrop = path.some(
|
|
|
|
(x) => x.classList && x.classList.contains("backdrop-active")
|
|
|
|
);
|
|
|
|
const notSelectablePath = path.some(
|
|
|
|
(x) => x.classList && x.classList.contains("not-selectable")
|
|
|
|
);
|
|
|
|
|
|
|
|
const isDraggable = path.some(
|
|
|
|
(x) => x.classList && x.classList.contains("draggable")
|
|
|
|
);
|
|
|
|
|
|
|
|
if (notSelectablePath || isBackdrop || isDraggable) {
|
|
|
|
return false;
|
|
|
|
} else return true;
|
|
|
|
};
|
|
|
|
|
|
|
|
onScroll = (e) => {
|
|
|
|
this.scroll.scrollBy(e.direction[0] * 10, e.direction[1] * 10);
|
|
|
|
};
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
onDrop,
|
|
|
|
showPrimaryProgressBar,
|
|
|
|
primaryProgressBarIcon,
|
|
|
|
primaryProgressBarValue,
|
|
|
|
showPrimaryButtonAlert,
|
|
|
|
showSecondaryProgressBar,
|
|
|
|
secondaryProgressBarValue,
|
|
|
|
secondaryProgressBarIcon,
|
|
|
|
showSecondaryButtonAlert,
|
|
|
|
uploadFiles,
|
|
|
|
viewAs,
|
|
|
|
//withBodyAutoFocus,
|
|
|
|
withBodyScroll,
|
|
|
|
children,
|
|
|
|
isHeaderVisible,
|
|
|
|
//headerBorderBottom,
|
|
|
|
onOpenUploadPanel,
|
|
|
|
isTabletView,
|
|
|
|
firstLoad,
|
|
|
|
dragging,
|
|
|
|
isDesktop,
|
2021-12-14 11:45:40 +00:00
|
|
|
isHomepage,
|
2022-04-04 09:25:16 +00:00
|
|
|
maintenanceExist,
|
|
|
|
setMaintenanceExist,
|
|
|
|
snackbarExist,
|
|
|
|
showText,
|
2022-04-04 11:57:22 +00:00
|
|
|
infoPanelIsVisible,
|
2022-03-03 10:43:43 +00:00
|
|
|
} = this.props;
|
2022-03-11 08:04:09 +00:00
|
|
|
|
2022-03-03 10:43:43 +00:00
|
|
|
let sectionHeaderContent = null;
|
2022-04-04 09:25:16 +00:00
|
|
|
let sectionBarContent = null;
|
2022-03-03 10:43:43 +00:00
|
|
|
let sectionFilterContent = null;
|
|
|
|
let sectionPagingContent = null;
|
|
|
|
let sectionBodyContent = null;
|
|
|
|
let infoPanelBodyContent = null;
|
|
|
|
let infoPanelHeaderContent = null;
|
|
|
|
|
|
|
|
React.Children.forEach(children, (child) => {
|
|
|
|
const childType =
|
|
|
|
child && child.type && (child.type.displayName || child.type.name);
|
|
|
|
|
|
|
|
switch (childType) {
|
|
|
|
case SectionHeader.displayName:
|
|
|
|
sectionHeaderContent = child;
|
|
|
|
break;
|
|
|
|
case SectionFilter.displayName:
|
|
|
|
sectionFilterContent = child;
|
|
|
|
break;
|
2022-04-04 09:25:16 +00:00
|
|
|
case SectionBar.displayName:
|
|
|
|
sectionBarContent = child;
|
|
|
|
break;
|
2022-03-03 10:43:43 +00:00
|
|
|
case SectionPaging.displayName:
|
|
|
|
sectionPagingContent = child;
|
|
|
|
break;
|
|
|
|
case SectionBody.displayName:
|
|
|
|
sectionBodyContent = child;
|
|
|
|
break;
|
|
|
|
case InfoPanelBody.displayName:
|
|
|
|
infoPanelBodyContent = child;
|
|
|
|
break;
|
|
|
|
case InfoPanelHeader.displayName:
|
|
|
|
infoPanelHeaderContent = child;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
const isSectionHeaderAvailable = !!sectionHeaderContent,
|
2022-03-03 10:43:43 +00:00
|
|
|
isSectionFilterAvailable = !!sectionFilterContent,
|
|
|
|
isSectionPagingAvailable = !!sectionPagingContent,
|
|
|
|
isSectionBodyAvailable =
|
|
|
|
!!sectionBodyContent ||
|
|
|
|
isSectionFilterAvailable ||
|
|
|
|
isSectionPagingAvailable,
|
2022-04-04 09:25:16 +00:00
|
|
|
isSectionBarAvailable = !!sectionBarContent,
|
2022-03-03 10:43:43 +00:00
|
|
|
isSectionAvailable =
|
|
|
|
isSectionHeaderAvailable ||
|
|
|
|
isSectionFilterAvailable ||
|
|
|
|
isSectionBodyAvailable ||
|
2022-03-16 12:22:48 +00:00
|
|
|
isSectionPagingAvailable;
|
2020-08-11 12:34:00 +00:00
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
const renderSection = () => {
|
2022-03-03 10:43:43 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{isSectionAvailable && (
|
|
|
|
<ReactResizeDetector
|
|
|
|
refreshRate={100}
|
|
|
|
refreshMode="debounce"
|
|
|
|
refreshOptions={{ trailing: true }}
|
|
|
|
>
|
|
|
|
{({ width, height }) => (
|
|
|
|
<Provider
|
|
|
|
value={{
|
|
|
|
sectionWidth: width,
|
|
|
|
sectionHeight: height,
|
|
|
|
}}
|
|
|
|
>
|
2022-04-04 09:25:16 +00:00
|
|
|
<SectionContainer
|
|
|
|
widthProp={width}
|
|
|
|
showText={showText}
|
|
|
|
viewAs={viewAs}
|
|
|
|
maintenanceExist={maintenanceExist}
|
|
|
|
isSectionBarAvailable={isSectionBarAvailable}
|
|
|
|
isSectionHeaderAvailable={isSectionHeaderAvailable}
|
2022-04-04 11:57:22 +00:00
|
|
|
infoPanelIsVisible={infoPanelIsVisible}
|
2022-04-04 09:25:16 +00:00
|
|
|
>
|
|
|
|
{!isMobile && (
|
|
|
|
<StyledMainBar
|
|
|
|
width={width}
|
|
|
|
id="main-bar"
|
|
|
|
className={"main-bar"}
|
|
|
|
showText={showText}
|
|
|
|
isSectionHeaderAvailable={isSectionHeaderAvailable}
|
2022-04-04 14:40:45 +00:00
|
|
|
infoPanelIsVisible={infoPanelIsVisible}
|
2022-04-04 09:25:16 +00:00
|
|
|
>
|
|
|
|
<SubSectionBar
|
|
|
|
setMaintenanceExist={setMaintenanceExist}
|
|
|
|
>
|
|
|
|
{sectionBarContent
|
|
|
|
? sectionBarContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionBar>
|
|
|
|
</StyledMainBar>
|
|
|
|
)}
|
|
|
|
|
2022-04-04 09:22:08 +00:00
|
|
|
{isSectionHeaderAvailable && !isMobile && (
|
2022-03-03 10:43:43 +00:00
|
|
|
<SubSectionHeader
|
2022-04-04 09:25:16 +00:00
|
|
|
maintenanceExist={maintenanceExist}
|
|
|
|
snackbarExist={snackbarExist}
|
2022-03-29 11:35:55 +00:00
|
|
|
className="section-header_header"
|
2022-03-03 10:43:43 +00:00
|
|
|
isHeaderVisible={isHeaderVisible}
|
2022-04-04 11:57:22 +00:00
|
|
|
infoPanelIsVisible={infoPanelIsVisible}
|
2022-03-03 10:43:43 +00:00
|
|
|
viewAs={viewAs}
|
2022-04-04 09:25:16 +00:00
|
|
|
showText={showText}
|
2022-03-03 10:43:43 +00:00
|
|
|
>
|
|
|
|
{sectionHeaderContent
|
|
|
|
? sectionHeaderContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionHeader>
|
2021-04-13 06:35:07 +00:00
|
|
|
)}
|
2022-04-04 09:25:16 +00:00
|
|
|
{isSectionFilterAvailable && !isMobile && (
|
2022-03-03 10:43:43 +00:00
|
|
|
<>
|
|
|
|
<SubSectionFilter
|
|
|
|
className="section-header_filter"
|
|
|
|
viewAs={viewAs}
|
2022-02-08 12:11:31 +00:00
|
|
|
>
|
2022-03-03 10:43:43 +00:00
|
|
|
{sectionFilterContent
|
|
|
|
? sectionFilterContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionFilter>
|
|
|
|
</>
|
2021-04-13 06:35:07 +00:00
|
|
|
)}
|
2022-03-03 10:43:43 +00:00
|
|
|
|
|
|
|
{isSectionBodyAvailable && (
|
|
|
|
<>
|
|
|
|
<SubSectionBody
|
|
|
|
onDrop={onDrop}
|
|
|
|
uploadFiles={uploadFiles}
|
|
|
|
withScroll={withBodyScroll}
|
|
|
|
autoFocus={isMobile || isTabletView ? false : true}
|
|
|
|
viewAs={viewAs}
|
2021-12-14 11:45:40 +00:00
|
|
|
isHomepage={isHomepage}
|
2022-02-08 12:11:31 +00:00
|
|
|
>
|
2022-04-04 09:25:16 +00:00
|
|
|
{isMobile && (
|
|
|
|
<StyledMainBar
|
|
|
|
width={width}
|
|
|
|
id="main-bar"
|
|
|
|
className={"main-bar"}
|
|
|
|
showText={showText}
|
|
|
|
isSectionHeaderAvailable={
|
|
|
|
isSectionHeaderAvailable
|
|
|
|
}
|
2022-04-04 14:40:45 +00:00
|
|
|
infoPanelIsVisible={infoPanelIsVisible}
|
2022-04-04 09:25:16 +00:00
|
|
|
>
|
|
|
|
<SubSectionBar
|
|
|
|
setMaintenanceExist={setMaintenanceExist}
|
|
|
|
>
|
|
|
|
{sectionBarContent
|
|
|
|
? sectionBarContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionBar>
|
|
|
|
</StyledMainBar>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{isSectionHeaderAvailable && isMobile && (
|
2022-03-29 11:35:55 +00:00
|
|
|
<SubSectionHeader
|
|
|
|
className="section-body_header"
|
|
|
|
isHeaderVisible={isHeaderVisible}
|
|
|
|
viewAs={viewAs}
|
2022-04-04 09:25:16 +00:00
|
|
|
showText={showText}
|
2022-04-04 11:57:22 +00:00
|
|
|
infoPanelIsVisible={infoPanelIsVisible}
|
2022-03-29 11:35:55 +00:00
|
|
|
>
|
|
|
|
{sectionHeaderContent
|
|
|
|
? sectionHeaderContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionHeader>
|
|
|
|
)}
|
|
|
|
|
2022-04-04 09:25:16 +00:00
|
|
|
{isSectionFilterAvailable && isMobile && (
|
2022-03-03 10:43:43 +00:00
|
|
|
<SubSectionFilter className="section-body_filter">
|
|
|
|
{sectionFilterContent
|
|
|
|
? sectionFilterContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionFilter>
|
|
|
|
)}
|
2022-03-21 08:13:56 +00:00
|
|
|
|
2022-03-03 10:43:43 +00:00
|
|
|
<SubSectionBodyContent>
|
|
|
|
{sectionBodyContent
|
|
|
|
? sectionBodyContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionBodyContent>
|
2022-03-21 08:13:56 +00:00
|
|
|
|
2022-03-03 10:43:43 +00:00
|
|
|
{isSectionPagingAvailable && (
|
|
|
|
<SubSectionPaging>
|
|
|
|
{sectionPagingContent
|
|
|
|
? sectionPagingContent.props.children
|
|
|
|
: null}
|
|
|
|
</SubSectionPaging>
|
|
|
|
)}
|
|
|
|
</SubSectionBody>
|
|
|
|
</>
|
2022-02-08 12:11:31 +00:00
|
|
|
)}
|
2022-03-21 08:13:56 +00:00
|
|
|
|
2022-02-03 08:34:47 +00:00
|
|
|
{!(isMobile || isMobileUtils() || isTabletUtils()) ? (
|
2022-01-31 13:40:43 +00:00
|
|
|
showPrimaryProgressBar && showSecondaryProgressBar ? (
|
|
|
|
<>
|
|
|
|
<FloatingButton
|
|
|
|
className="layout-progress-bar"
|
|
|
|
icon={primaryProgressBarIcon}
|
|
|
|
percent={primaryProgressBarValue}
|
|
|
|
alert={showPrimaryButtonAlert}
|
|
|
|
onClick={onOpenUploadPanel}
|
|
|
|
/>
|
|
|
|
<FloatingButton
|
|
|
|
className="layout-progress-second-bar"
|
|
|
|
icon={secondaryProgressBarIcon}
|
|
|
|
percent={secondaryProgressBarValue}
|
|
|
|
alert={showSecondaryButtonAlert}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
) : showPrimaryProgressBar &&
|
|
|
|
!showSecondaryProgressBar ? (
|
2022-03-03 10:43:43 +00:00
|
|
|
<FloatingButton
|
|
|
|
className="layout-progress-bar"
|
|
|
|
icon={primaryProgressBarIcon}
|
|
|
|
percent={primaryProgressBarValue}
|
|
|
|
alert={showPrimaryButtonAlert}
|
|
|
|
onClick={onOpenUploadPanel}
|
2022-02-08 12:11:31 +00:00
|
|
|
/>
|
2022-01-31 13:40:43 +00:00
|
|
|
) : !showPrimaryProgressBar &&
|
|
|
|
showSecondaryProgressBar ? (
|
2022-03-03 10:43:43 +00:00
|
|
|
<FloatingButton
|
2022-01-31 13:40:43 +00:00
|
|
|
className="layout-progress-bar"
|
2022-03-03 10:43:43 +00:00
|
|
|
icon={secondaryProgressBarIcon}
|
|
|
|
percent={secondaryProgressBarValue}
|
|
|
|
alert={showSecondaryButtonAlert}
|
|
|
|
/>
|
2022-01-31 13:40:43 +00:00
|
|
|
) : (
|
|
|
|
<></>
|
|
|
|
)
|
2022-03-03 10:43:43 +00:00
|
|
|
) : (
|
|
|
|
<></>
|
|
|
|
)}
|
2022-03-16 12:22:48 +00:00
|
|
|
</SectionContainer>
|
2022-03-03 10:43:43 +00:00
|
|
|
<InfoPanel>
|
|
|
|
<SubInfoPanelHeader>
|
|
|
|
{infoPanelHeaderContent}
|
|
|
|
</SubInfoPanelHeader>
|
|
|
|
<SubInfoPanelBody>{infoPanelBodyContent}</SubInfoPanelBody>
|
|
|
|
</InfoPanel>
|
|
|
|
</Provider>
|
|
|
|
)}
|
|
|
|
</ReactResizeDetector>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const scrollOptions = this.scroll
|
|
|
|
? {
|
|
|
|
container: this.scroll,
|
|
|
|
throttleTime: 0,
|
|
|
|
threshold: 100,
|
|
|
|
}
|
|
|
|
: {};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2022-03-16 12:22:48 +00:00
|
|
|
{renderSection()}
|
2022-03-03 10:43:43 +00:00
|
|
|
{!isMobile && uploadFiles && !dragging && (
|
|
|
|
<StyledSelectoWrapper>
|
|
|
|
<Selecto
|
|
|
|
boundContainer={".section-wrapper"}
|
|
|
|
dragContainer={".section-body"}
|
|
|
|
selectableTargets={[".files-item"]}
|
|
|
|
hitRate={0}
|
|
|
|
selectByClick={false}
|
|
|
|
selectFromInside={true}
|
|
|
|
ratio={0}
|
|
|
|
continueSelect={false}
|
|
|
|
onSelect={this.onSelect}
|
|
|
|
dragCondition={this.dragCondition}
|
|
|
|
scrollOptions={scrollOptions}
|
|
|
|
onScroll={this.onScroll}
|
|
|
|
/>
|
|
|
|
</StyledSelectoWrapper>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
2019-07-11 11:43:07 +00:00
|
|
|
}
|
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
Section.propTypes = {
|
2022-03-03 10:43:43 +00:00
|
|
|
children: PropTypes.any,
|
|
|
|
withBodyScroll: PropTypes.bool,
|
|
|
|
withBodyAutoFocus: PropTypes.bool,
|
|
|
|
showPrimaryProgressBar: PropTypes.bool,
|
|
|
|
primaryProgressBarValue: PropTypes.number,
|
|
|
|
showPrimaryButtonAlert: PropTypes.bool,
|
|
|
|
progressBarDropDownContent: PropTypes.any,
|
|
|
|
primaryProgressBarIcon: PropTypes.string,
|
|
|
|
showSecondaryProgressBar: PropTypes.bool,
|
|
|
|
secondaryProgressBarValue: PropTypes.number,
|
|
|
|
secondaryProgressBarIcon: PropTypes.string,
|
|
|
|
showSecondaryButtonAlert: PropTypes.bool,
|
|
|
|
onDrop: PropTypes.func,
|
|
|
|
setSelections: PropTypes.func,
|
|
|
|
uploadFiles: PropTypes.bool,
|
|
|
|
hideAside: PropTypes.bool,
|
|
|
|
viewAs: PropTypes.string,
|
|
|
|
uploadPanelVisible: PropTypes.bool,
|
|
|
|
onOpenUploadPanel: PropTypes.func,
|
|
|
|
isTabletView: PropTypes.bool,
|
|
|
|
isHeaderVisible: PropTypes.bool,
|
|
|
|
firstLoad: PropTypes.bool,
|
2021-12-14 11:45:40 +00:00
|
|
|
isHomepage: PropTypes.bool,
|
2019-09-12 12:15:22 +00:00
|
|
|
};
|
2019-07-11 11:43:07 +00:00
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
Section.defaultProps = {
|
2022-03-03 10:43:43 +00:00
|
|
|
withBodyScroll: true,
|
|
|
|
withBodyAutoFocus: false,
|
2019-09-12 12:15:22 +00:00
|
|
|
};
|
2019-07-11 11:43:07 +00:00
|
|
|
|
2022-03-21 08:13:56 +00:00
|
|
|
Section.InfoPanelHeader = InfoPanelHeader;
|
|
|
|
Section.InfoPanelBody = InfoPanelBody;
|
2022-03-16 12:22:48 +00:00
|
|
|
Section.SectionHeader = SectionHeader;
|
|
|
|
Section.SectionFilter = SectionFilter;
|
|
|
|
Section.SectionBody = SectionBody;
|
|
|
|
Section.SectionPaging = SectionPaging;
|
2020-08-11 12:34:00 +00:00
|
|
|
|
2022-04-04 11:57:22 +00:00
|
|
|
export default inject(({ auth, infoPanelStore }) => {
|
2022-03-03 10:43:43 +00:00
|
|
|
const { isLoaded, settingsStore } = auth;
|
|
|
|
const {
|
|
|
|
isHeaderVisible,
|
|
|
|
isTabletView,
|
2022-03-16 12:22:48 +00:00
|
|
|
|
2022-03-03 10:43:43 +00:00
|
|
|
isDesktopClient,
|
2022-04-04 09:25:16 +00:00
|
|
|
maintenanceExist,
|
|
|
|
snackbarExist,
|
|
|
|
setMaintenanceExist,
|
|
|
|
|
|
|
|
showText,
|
2022-03-03 10:43:43 +00:00
|
|
|
} = settingsStore;
|
|
|
|
|
2022-04-04 11:57:22 +00:00
|
|
|
let infoPanelIsVisible = false;
|
|
|
|
if (infoPanelStore) infoPanelIsVisible = infoPanelStore.isVisible;
|
|
|
|
|
2022-03-03 10:43:43 +00:00
|
|
|
return {
|
|
|
|
isLoaded,
|
|
|
|
isTabletView,
|
|
|
|
isHeaderVisible,
|
2022-03-16 12:22:48 +00:00
|
|
|
|
2022-04-04 09:25:16 +00:00
|
|
|
maintenanceExist,
|
|
|
|
snackbarExist,
|
|
|
|
setMaintenanceExist,
|
2022-03-03 10:43:43 +00:00
|
|
|
isDesktop: isDesktopClient,
|
2022-04-04 09:25:16 +00:00
|
|
|
|
|
|
|
showText,
|
2022-04-04 11:57:22 +00:00
|
|
|
|
|
|
|
infoPanelIsVisible: infoPanelIsVisible,
|
2022-03-03 10:43:43 +00:00
|
|
|
};
|
2022-03-16 12:22:48 +00:00
|
|
|
})(observer(Section));
|