From eaa1e66d09e8539e4cd9d95d27ec88f3e7657069 Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Tue, 1 Feb 2022 12:29:01 +0300 Subject: [PATCH] [SSE] Add tab 'All-list' --- apps/spreadsheeteditor/mobile/locale/en.json | 1 + .../mobile/src/controller/Statusbar.jsx | 9 +++++ .../mobile/src/less/app.less | 23 +++++++++++++ .../mobile/src/less/icons-ios.less | 5 +++ .../mobile/src/less/statusbar.less | 10 +++++- .../mobile/src/view/Statusbar.jsx | 34 +++++++++++++++++-- 6 files changed, 79 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 405750adb..3ba08de09 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -288,6 +288,7 @@ "textErrorLastSheet": "The workbook must have at least one visible worksheet.", "textErrorRemoveSheet": "Can't delete the worksheet.", "textHide": "Hide", + "textHidden": "Hidden", "textMore": "More", "textMove": "Move", "textMoveBack": "Move back", diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index f0edbc676..9db12e319 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -365,12 +365,21 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props => api.asc_moveWorksheet(activeIndex === undefined ? api.asc_getWorksheetsCount() : activeIndex, [api.asc_getActiveWorksheetIndex()]); } + const onTabListClick = (sheetIndex) => { + const api = Common.EditorApi.get(); + if(api && api.asc_getActiveWorksheetIndex() !== sheetIndex) { + api.asc_showWorksheet(sheetIndex); + f7.popover.close('#idx-all-list'); + } + } + return ( ) diff --git a/apps/spreadsheeteditor/mobile/src/less/app.less b/apps/spreadsheeteditor/mobile/src/less/app.less index ce6c67388..b22abf0b7 100644 --- a/apps/spreadsheeteditor/mobile/src/less/app.less +++ b/apps/spreadsheeteditor/mobile/src/less/app.less @@ -141,4 +141,27 @@ .actions-move-sheet { background-color: @background-secondary; +} + +// All-list sheet +.all-list { + --f7-popover-width: 190px; + .item-checkbox{ + padding-left: 8px; + .icon-checkbox{ + border-color: transparent; + margin-right: 8px; + &::after{ + color: @brandColor; + } + } + .item-after div { + color: @text-secondary; + font-style: italic; + } + input[type='checkbox']:checked ~ .icon-checkbox { + background-color: unset; + border-color: transparent; + } + } } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less index 47acba9e6..c61930cb2 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less @@ -47,6 +47,11 @@ height: 22px; .encoded-svg-mask(''); } + &.icon-list { + width: 22px; + height: 22px; + .encoded-svg-mask('') + } &.icon-settings { width: 24px; height: 24px; diff --git a/apps/spreadsheeteditor/mobile/src/less/statusbar.less b/apps/spreadsheeteditor/mobile/src/less/statusbar.less index c2cebdd47..f3c9c4b0d 100644 --- a/apps/spreadsheeteditor/mobile/src/less/statusbar.less +++ b/apps/spreadsheeteditor/mobile/src/less/statusbar.less @@ -8,6 +8,10 @@ background-color: @background-tertiary; display: flex; + .box-tab { + display: flex; + } + .tab { border: 0 none; border-radius: 0; @@ -70,7 +74,11 @@ // @source: ''; // .encoded-svg-mask(@source, @fontColor); // background-image: none; - .encoded-svg-mask('') + .encoded-svg-mask('') + } + + &.icon-list.bold { + .encoded-svg-mask('') } } } diff --git a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx index 6c09899e9..2ca1afb04 100644 --- a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx @@ -1,5 +1,5 @@ import React, { Fragment, useState } from 'react'; -import { View, Link, Icon, Popover, List, ListItem, ListButton, Actions, ActionsGroup, ActionsButton, Sheet, Page } from 'framework7-react'; +import {f7, View, Link, Icon, Popover, List, ListItem, ListButton, Actions, ActionsGroup, ActionsButton, Sheet, Page } from 'framework7-react'; import { useTranslation } from 'react-i18next'; import { Device } from '../../../../common/mobile/utils/device'; import { inject, observer } from 'mobx-react'; @@ -53,6 +53,28 @@ const PageListMove = props => { ) }; +const PageAllList = (props) => { + const { t } = useTranslation(); + const { sheets, onTabListClick } = props; + const allSheets = sheets.sheets; + + return ( + + + { allSheets.map( (model,sheetIndex) => + onTabListClick(sheetIndex)}> + {model.hidden ? +
+ {t('Statusbar.textHidden')} +
+ : null} +
) + } +
+
+ ) +}; + const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(props => { const { t } = useTranslation(); const _t = t('Statusbar', {returnObjects: true}); @@ -71,10 +93,13 @@ const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(prop {isEdit && -
+
+ f7.popover.open('#idx-all-list', e.target)}> + +
}
@@ -131,6 +156,11 @@ const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(prop ) : null} + { + + + + } {isPhone ?