mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-26 00:46:22 +08:00
add component for unhide menu (#904)
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/web-apps/pulls/904 Co-authored-by: Polina <polina.hudyakova@onlyoffice.com> Co-committed-by: Polina <polina.hudyakova@onlyoffice.com>
This commit is contained in:
@ -450,6 +450,7 @@
|
||||
"textSheetName": "Sheet Name",
|
||||
"textTabColor": "Tab Color",
|
||||
"textUnhide": "Unhide",
|
||||
"textUnhideSheets": "Unhide sheets",
|
||||
"textWarnDeleteSheet": "The sheet maybe has data. Proceed operation?",
|
||||
"warnAddSheetCsv": "The CSV format does not support saving a multi-sheet file. Only the active sheet will be saved. To keep all sheets, please save the file in a different format."
|
||||
},
|
||||
|
||||
@ -330,7 +330,6 @@ const Statusbar = inject('storeWorksheets', 'storeAppOptions', 'users', 'storeSp
|
||||
f7.dialog.alert(_t.textErrorLastSheet, _t.notcriticalErrorTitle) :
|
||||
api['asc_hideWorksheet']([index]);
|
||||
} else {
|
||||
f7.popover.close('#idx-hidden-sheets-popover');
|
||||
api['asc_showWorksheet'](index);
|
||||
}
|
||||
};
|
||||
@ -363,13 +362,14 @@ const Statusbar = inject('storeWorksheets', 'storeAppOptions', 'users', 'storeSp
|
||||
}
|
||||
break;
|
||||
case 'unhide':
|
||||
f7.popover.open('#idx-hidden-sheets-popover', '.active');
|
||||
Device.phone ? f7.sheet.open('.hidden-sheet') : f7.popover.open('.hidden-sheet', targetRef.current);
|
||||
break;
|
||||
case 'showMore':
|
||||
f7.actions.open('#idx-tab-menu-actions');
|
||||
break;
|
||||
default:
|
||||
let _re = /reveal\:(\d+)/.exec(event);
|
||||
f7.sheet.close('.hidden-sheet');
|
||||
if (_re && !!_re[1]) {
|
||||
hideWorksheet(false, parseInt(_re[1]));
|
||||
}
|
||||
|
||||
@ -45,6 +45,44 @@ const PageListMove = props => {
|
||||
)
|
||||
};
|
||||
|
||||
const PageListHidden = props => {
|
||||
const { t } = useTranslation();
|
||||
const { sheets, onTabMenu } = props;
|
||||
const allSheets = sheets.sheets;
|
||||
|
||||
return (
|
||||
<View style={!Device.phone ? {height: '420px'} : null}>
|
||||
<Page>
|
||||
<Navbar title={t('Statusbar.textUnhideSheets')}>
|
||||
{Device.phone &&
|
||||
<NavRight>
|
||||
<Link sheetClose>
|
||||
{Device.ios ?
|
||||
<SvgIcon symbolId={IconExpandDownIos.id} className={'icon icon-svg'} /> :
|
||||
<SvgIcon symbolId={IconExpandDownAndroid.id} className={'icon icon-svg'} />
|
||||
}
|
||||
</Link>
|
||||
</NavRight>
|
||||
}
|
||||
</Navbar>
|
||||
<List>
|
||||
<ListGroup style={Device.phone ? { paddingBottom: '44px' } : undefined}>
|
||||
{ allSheets.map((sheet, index) =>
|
||||
sheet.hidden ?
|
||||
<ListItem
|
||||
key={sheet.name}
|
||||
data-event={`reveal:${index}`}
|
||||
title={sheet.name}
|
||||
onClick={() => onTabMenu(`reveal:${index}`)} />
|
||||
: null
|
||||
)}
|
||||
</ListGroup>
|
||||
</List>
|
||||
</Page>
|
||||
</View>
|
||||
)
|
||||
};
|
||||
|
||||
const PageAllList = observer((props) => {
|
||||
const { t } = useTranslation();
|
||||
const { sheets, onTabListClick } = props;
|
||||
@ -339,23 +377,17 @@ const StatusbarView = inject('storeAppOptions', 'storeWorksheets', 'users', 'sto
|
||||
</View>
|
||||
</Popover>
|
||||
}
|
||||
{hiddenSheets.length ? (
|
||||
<Popover id="idx-hidden-sheets-popover"
|
||||
className="document-menu"
|
||||
backdrop={false}
|
||||
closeByBackdropClick={false}
|
||||
closeByOutsideClick={false}
|
||||
{ isPhone ?
|
||||
<Sheet style={{height: '48%'}} swipeToClose={true} closeByOutsideClick={true} className="hidden-sheet">
|
||||
<PageListHidden sheets={storeWorksheets} onTabMenu={props.onTabMenu}/>
|
||||
</Sheet>
|
||||
:
|
||||
<Popover className="hidden-sheet" closeByOutsideClick={true}
|
||||
>
|
||||
<List className="list-block">
|
||||
{hiddenSheets.map(sheet => {
|
||||
return (
|
||||
<ListButton key={sheet.index} data-event={`reveal:${sheet.index}`} title={sheet.name}
|
||||
onClick={() => props.onTabMenu(`reveal:${sheet.index}`)} />
|
||||
)
|
||||
})}
|
||||
</List>
|
||||
<PageListHidden sheets={storeWorksheets} onTabMenu={props.onTabMenu}/>
|
||||
</Popover>
|
||||
) : null}
|
||||
|
||||
}
|
||||
</Fragment>
|
||||
)
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user