diff --git a/apps/common/mobile/lib/controller/collaboration/Comments.jsx b/apps/common/mobile/lib/controller/collaboration/Comments.jsx index 1251123393..e1ebcda4be 100644 --- a/apps/common/mobile/lib/controller/collaboration/Comments.jsx +++ b/apps/common/mobile/lib/controller/collaboration/Comments.jsx @@ -558,10 +558,20 @@ class ViewCommentsController extends Component { break; } } + + showComment (comment) { + const api = Common.EditorApi.get(); + + api.asc_selectComment(comment.uid); + api.asc_showComment(comment.uid, false); + } + + render() { return( - {this.props.allComments && } + {this.props.allComments && } {this.state.isOpenViewCurComments && { } // View comments -const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment}) => { +const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment}) => { const { t } = useTranslation(); const _t = t('Common.Collaboration', {returnObjects: true}); const isAndroid = Device.android; @@ -657,7 +657,8 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes {sortComments.map((comment, indexComment) => { return ( - + { + !e.target.closest('.comment-menu') && !e.target.closest('.reply-menu') ? showComment(comment) : null}}>
{isAndroid &&
{comment.userInitials}
} diff --git a/apps/common/mobile/resources/less/common-ios.less b/apps/common/mobile/resources/less/common-ios.less index 5bea40077f..396a2051a9 100644 --- a/apps/common/mobile/resources/less/common-ios.less +++ b/apps/common/mobile/resources/less/common-ios.less @@ -355,6 +355,10 @@ color: red; } + .list-button { + position: initial; + } + .block-title { position: relative; overflow: hidden; diff --git a/apps/common/mobile/resources/less/common-material.less b/apps/common/mobile/resources/less/common-material.less index 4a67427569..c3cf6f0d3d 100644 --- a/apps/common/mobile/resources/less/common-material.less +++ b/apps/common/mobile/resources/less/common-material.less @@ -103,7 +103,8 @@ .button-fill { color: @white; - background-color: @themeColor; + // background-color: @themeColor; + background-color: transparent; } .button-raised { @@ -116,14 +117,19 @@ } .buttons-list { - li { - margin: 20px 16px; - color: @white; - border-radius: 2px; - text-transform: uppercase; - height: 36px; - min-height: 36px; - font-size: 14px; + ul { + &::before, &::after { + display: none; + } + li { + margin: 20px 16px; + color: @white; + border-radius: 2px; + text-transform: uppercase; + height: 36px; + min-height: 36px; + font-size: 14px; + } } } @@ -142,7 +148,8 @@ font-size: 14px; font-weight: 500; border-radius: 2px; - margin: 20px 16px; + // margin: 20px 16px; + margin: 0; } .button-raised .list-button { box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24); diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less index 064aa53da8..b8292d9706 100644 --- a/apps/common/mobile/resources/less/common.less +++ b/apps/common/mobile/resources/less/common.less @@ -339,9 +339,9 @@ .buttons-list { ul { - &::before, &::after { - display: none; - } + // &::before, &::after { + // display: none; + // } li { border: 0; font-weight: normal; @@ -505,6 +505,12 @@ } } +#edit-table-style { + .list ul ul { + padding-left: 0; + } +} + // Cell styles .cell-styles-list { diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index 136679559e..54d0b7c63d 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -25,6 +25,7 @@ class ContextMenu extends ContextMenuController { this.onApiHideComment = this.onApiHideComment.bind(this); this.onApiShowChange = this.onApiShowChange.bind(this); this.getUserName = this.getUserName.bind(this); + this.ShowModal = this.ShowModal.bind(this); } static closeContextMenu() { @@ -43,9 +44,13 @@ class ContextMenu extends ContextMenuController { api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment); api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment); api.asc_unregisterCallback('asc_onShowRevisionsChange', this.onApiShowChange); + Common.Notifications.off('showSplitModal', this.ShowModal); } - + ShowModal() { + this.showSplitModal() + } + onApiShowComment(comments) { this.isComments = comments && comments.length > 0; } @@ -199,6 +204,7 @@ class ContextMenu extends ContextMenuController { api.asc_registerCallback('asc_onShowComment', this.onApiShowComment); api.asc_registerCallback('asc_onHideComment', this.onApiHideComment); api.asc_registerCallback('asc_onShowRevisionsChange', this.onApiShowChange); + Common.Notifications.on('showSplitModal', this.ShowModal); } initMenuItems() { diff --git a/apps/documenteditor/mobile/src/controller/Error.jsx b/apps/documenteditor/mobile/src/controller/Error.jsx index ff499f2515..21b8d35e4e 100644 --- a/apps/documenteditor/mobile/src/controller/Error.jsx +++ b/apps/documenteditor/mobile/src/controller/Error.jsx @@ -199,14 +199,18 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu Common.Gateway.reportWarning(id, config.msg); config.title = _t.notcriticalErrorTitle; + config.callback = (btn) => { if (id === Asc.c_oAscError.ID.Warning && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) { api.asc_DownloadOrigin(); + } else if(id === Asc.c_oAscError.ID.SplitCellMaxRows || + Asc.c_oAscError.ID.SplitCellMaxCols || + Asc.c_oAscError.ID.SplitCellRowsDivider && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) { + Common.Notifications.trigger('showSplitModal',true); } storeAppOptions.changeEditingRights(false); }; } - f7.dialog.create({ cssClass: 'error-dialog', title : config.title, diff --git a/apps/documenteditor/mobile/src/view/add/AddImage.jsx b/apps/documenteditor/mobile/src/view/add/AddImage.jsx index 066f03c8ac..1fed2d95a5 100644 --- a/apps/documenteditor/mobile/src/view/add/AddImage.jsx +++ b/apps/documenteditor/mobile/src/view/add/AddImage.jsx @@ -20,7 +20,7 @@ const PageLinkSettings = props => { > - + {props.onInsertByUrl(stateValue)}}> diff --git a/apps/documenteditor/mobile/src/view/add/AddLink.jsx b/apps/documenteditor/mobile/src/view/add/AddLink.jsx index 8239d3819b..479ed36036 100644 --- a/apps/documenteditor/mobile/src/view/add/AddLink.jsx +++ b/apps/documenteditor/mobile/src/view/add/AddLink.jsx @@ -39,7 +39,7 @@ const PageLink = props => { onChange={(event) => {setTip(event.target.value)}} > - + { props.onInsertLink(stateLink, stateDisplay, stateTip) }}> diff --git a/apps/documenteditor/mobile/src/view/add/AddOther.jsx b/apps/documenteditor/mobile/src/view/add/AddOther.jsx index 0ea3485a11..f32b48ae01 100644 --- a/apps/documenteditor/mobile/src/view/add/AddOther.jsx +++ b/apps/documenteditor/mobile/src/view/add/AddOther.jsx @@ -141,7 +141,7 @@ const PageFootnote = props => { ) })} - + { props.onInsertFootnote(stateFormat, stateStartAt, stateLocation); }}> diff --git a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx index 4a013cf20e..a539c9339b 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx @@ -446,7 +446,7 @@ const EditChart = props => { onReorder: props.onReorder }}> - + {props.onRemoveChart()}} className='button-red button-fill button-raised'/> diff --git a/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx b/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx index b05207cc8b..9509f0a543 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx @@ -38,7 +38,7 @@ const EditHyperlink = props => { onChange={(event) => {setTip(event.target.value)}} > - + { props.onEditLink(stateLink, stateDisplay, stateTip) }}> diff --git a/apps/documenteditor/mobile/src/view/edit/EditImage.jsx b/apps/documenteditor/mobile/src/view/edit/EditImage.jsx index 26795d0e35..d87558efc8 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditImage.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditImage.jsx @@ -156,7 +156,7 @@ const PageLinkSettings = props => { > - + {onReplace()}}> @@ -236,6 +236,10 @@ const PageReorder = props => { const EditImage = props => { const { t } = useTranslation(); const _t = t('Edit', {returnObjects: true}); + const storeFocusObjects = props.storeFocusObjects; + const imageObject = storeFocusObjects.imageObject; + const pluginGuid = imageObject.asc_getPluginGuid(); + return ( @@ -246,7 +250,7 @@ const EditImage = props => { onOverlap: props.onOverlap, onWrapDistance: props.onWrapDistance }}> - @@ -254,7 +258,7 @@ const EditImage = props => { onReorder: props.onReorder }}> - + {props.onDefaulSize()}}/> {props.onRemoveImage()}}/> diff --git a/apps/documenteditor/mobile/src/view/edit/EditShape.jsx b/apps/documenteditor/mobile/src/view/edit/EditShape.jsx index 093bb735a0..227dc6f1f6 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditShape.jsx @@ -507,6 +507,9 @@ const EditShape = props => { const storeShapeSettings = props.storeShapeSettings; const shapeObject = props.storeFocusObjects.shapeObject; const wrapType = storeShapeSettings.getWrapType(shapeObject); + + let disableRemove = !!props.storeFocusObjects.paragraphObject; + return ( @@ -536,8 +539,8 @@ const EditShape = props => { onReorder: props.onReorder }}> - - {props.onRemoveShape()}} className='button-red button-fill button-raised'/> + + {props.onRemoveShape()}} className={`button-red button-fill button-raised${disableRemove ? ' disabled' : ''}`} /> ) diff --git a/apps/documenteditor/mobile/src/view/edit/EditTable.jsx b/apps/documenteditor/mobile/src/view/edit/EditTable.jsx index e1eb03bd48..528c3bf230 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditTable.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditTable.jsx @@ -173,40 +173,25 @@ const PageWrap = props => { // Style -const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyleClick, storeFocusObjects}) => { +const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer(({onStyleClick,storeTableSettings,storeFocusObjects}) => { const tableObject = storeFocusObjects.tableObject; const styleId = tableObject && tableObject.get_TableStyle(); const [stateId, setId] = useState(styleId); - - const widthContainer = document.querySelector(".page-content").clientWidth; - const columns = parseInt((widthContainer - 47) / 70); // magic - const styles = []; - let row = -1; - templates.forEach((style, index) => { - if (0 == index % columns) { - styles.push([]); - row++ - } - styles[row].push(style); - }); + const styles = storeTableSettings.styles; return (
- {styles.map((row, rowIndex) => { - return ( -
- {row.map((style, index)=>{ - return( -
{onStyleClick(style.templateId); setId(style.templateId)}}> - -
- ) - })} -
- ) - })} +
    + {styles.map((style, index) => { + return ( +
  • {onStyleClick(style.templateId); setId(style.templateId)}}> + +
  • + ) + })} +
) })); @@ -560,7 +545,9 @@ const EditTable = props => { - {props.onRemoveTable()}} className='button-red button-fill button-raised'> + + {props.onRemoveTable()}} className='button-red button-fill button-raised'> +
{ - if (id === -82) return; // format error - if (id === Asc.c_oAscError.ID.LoadingScriptError) { f7.notification.create({ title: _t.criticalErrorTitle, diff --git a/apps/presentationeditor/mobile/src/view/add/AddImage.jsx b/apps/presentationeditor/mobile/src/view/add/AddImage.jsx index f25c979df9..c34d4e6080 100644 --- a/apps/presentationeditor/mobile/src/view/add/AddImage.jsx +++ b/apps/presentationeditor/mobile/src/view/add/AddImage.jsx @@ -20,7 +20,7 @@ const PageLinkSettings = props => { > - + {props.onInsertByUrl(stateValue)}}> diff --git a/apps/presentationeditor/mobile/src/view/add/AddLink.jsx b/apps/presentationeditor/mobile/src/view/add/AddLink.jsx index 7d1b3bcaf2..4894ac9650 100644 --- a/apps/presentationeditor/mobile/src/view/add/AddLink.jsx +++ b/apps/presentationeditor/mobile/src/view/add/AddLink.jsx @@ -143,7 +143,7 @@ const PageLink = props => { /> - { props.onInsertLink(typeLink, (typeLink === 1 ? diff --git a/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx b/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx index 7371610c26..2112aa589f 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {List, ListItem, ListButton, Icon, Row, Page, Navbar, BlockTitle, Toggle, Range, Link, Tabs, Tab} from 'framework7-react'; +import {List, ListItem, ListButton, Icon, Row, Page, Navbar, BlockTitle, Toggle, Range, Link, Tabs, Tab, NavRight} from 'framework7-react'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx"; @@ -24,7 +24,15 @@ const PageCustomFillColor = props => { return ( - + + {Device.phone && + + + + + + } + ) @@ -84,7 +92,15 @@ const PageCustomBorderColor = props => { return ( - + + {Device.phone && + + + + + + } + ) @@ -114,7 +130,15 @@ const PageBorderColor = props => { return ( - + + {Device.phone && + + + + + + } + { const styles = storeChartSettings.styles; const shapeObject = props.storeFocusObjects.shapeObject; const chartStyles = storeChartSettings.chartStyles; - // console.log(chartStyles, curType); - // console.log(Asc.c_oAscChartTypeSettings.comboBarLine, Asc.c_oAscChartTypeSettings.comboBarLineSecondary, Asc.c_oAscChartTypeSettings.comboAreaBar, Asc.c_oAscChartTypeSettings.comboCustom); let borderSize, borderType, borderColor; @@ -173,6 +195,13 @@ const PageStyle = props => { {_t.textFill} {_t.textBorder}
+ {Device.phone && + + + + + + } @@ -262,7 +291,15 @@ const PageReorder = props => { return ( - + + {Device.phone && + + + + + + } + {props.onReorder('all-up')}} link='#' className='no-indicator'> @@ -293,7 +330,15 @@ const PageAlign = props => { return ( - + + {Device.phone && + + + + + + } + {props.onAlign('align-left')}} className='no-indicator'> @@ -329,6 +374,7 @@ const PageAlign = props => { const EditChart = props => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); + return ( @@ -346,7 +392,7 @@ const EditChart = props => { onAlign: props.onAlign }}> - + {props.onRemoveChart()}} className='button-red button-fill button-raised'/> diff --git a/apps/presentationeditor/mobile/src/view/edit/EditImage.jsx b/apps/presentationeditor/mobile/src/view/edit/EditImage.jsx index e5ca3d134c..fdc0f3ece1 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditImage.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditImage.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, Tab, Tabs, ListInput, ListButton} from 'framework7-react'; +import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, ListItemCell, Range, Button, Segmented, Tab, Tabs, ListInput, ListButton, NavRight} from 'framework7-react'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; @@ -8,11 +8,14 @@ import {Device} from '../../../../../common/mobile/utils/device'; const EditImage = props => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); + const storeFocusObjects = props.storeFocusObjects; + const imageObject = storeFocusObjects.imageObject; + const pluginGuid = imageObject.asc_getPluginGuid(); return ( - @@ -24,8 +27,8 @@ const EditImage = props => { }}> - {_t.textActualSize} - {_t.textRemoveImage} + {_t.textActualSize} + {_t.textRemoveImage} ) @@ -43,7 +46,15 @@ const PageReorder = props => { return ( - + + {Device.phone && + + + + + + } + {props.onReorder('all-up')}} className='no-indicator'> @@ -74,7 +85,15 @@ const PageAlign = props => { return ( - + + {Device.phone && + + + + + + } + {props.onAlign('align-left')}} className='no-indicator'> @@ -119,7 +138,15 @@ const PageReplace = props => { return ( - + + {Device.phone && + + + + + + } + {props.onReplaceByFile()}}> @@ -152,7 +179,15 @@ const PageLinkSettings = props => { }; return ( - + + {Device.phone && + + + + + + } + {_t.textAddress} { return ( - + + {Device.phone && + + + + + + } + {setTypeLink(1); props.changeType(1);}}> {setTypeLink(0); props.changeType(0);}}> @@ -62,7 +70,15 @@ const PageLinkTo = props => { return ( - + + {Device.phone && + + + + + + } + {changeTypeTo(0)}}> {changeTypeTo(1)}}> @@ -134,7 +150,15 @@ const PageLink = props => { return ( - + + {Device.phone && + + + + + + } + { /> - { props.onEditLink(typeLink, (typeLink === 1 ? @@ -179,8 +203,8 @@ const PageLink = props => { {linkTo: linkTo, numberTo: numberTo, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled})); }} /> - { props.onRemoveLink() }} diff --git a/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx b/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx index 4a05bdfae1..71210945c3 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, Tab, Tabs} from 'framework7-react'; +import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, Tab, Tabs, ListButton} from 'framework7-react'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; @@ -12,6 +12,8 @@ const EditShape = props => { const shapeObject = storeFocusObjects.shapeObject; const canFill = shapeObject && shapeObject.get_CanFill(); + let disableRemove = !!props.storeFocusObjects.paragraphObject; + return ( @@ -39,7 +41,7 @@ const EditShape = props => { }}> - {_t.textRemoveShape} + {_t.textRemoveShape} ) diff --git a/apps/presentationeditor/mobile/src/view/edit/EditSlide.jsx b/apps/presentationeditor/mobile/src/view/edit/EditSlide.jsx index 07685bd1ed..4557b9f72d 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditSlide.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditSlide.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented} from 'framework7-react'; +import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, ListButton} from 'framework7-react'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; @@ -32,8 +32,8 @@ const EditSlide = props => { }}> - {_t.textDuplicateSlide} - {_t.textDeleteSlide} + {_t.textDuplicateSlide} + {_t.textDeleteSlide} ) @@ -48,17 +48,16 @@ const PageTheme = props => { const defaultThemes = arrayThemes[0]; const docThemes = arrayThemes[1]; - console.log(arrayThemes); - - // console.log(slideThemeIndex); - // console.log(arrayThemes); - return ( - - - + {Device.phone && + + + + + + } {arrayThemes.length ? ( @@ -99,15 +98,16 @@ const PageLayout = props => { const arrayLayouts = storeSlideSettings.arrayLayouts; const slideLayoutIndex = storeSlideSettings.slideLayoutIndex; - // console.log(slideLayoutIndex); - // console.log(arrayLayouts); - return ( - - - + {Device.phone && + + + + + + } {arrayLayouts.length ? ( @@ -234,9 +234,13 @@ const PageTransition = props => { return ( - - - + {Device.phone && + + + + + + } { return ( - + + {Device.phone && + + + + + + } + {_arrEffect.length ? ( {_arrEffect.map((elem, index) => { @@ -354,9 +366,13 @@ const PageType= props => { return ( - - - + {Device.phone && + + + + + + } {_arrCurrentEffectTypes.length ? ( @@ -406,9 +422,13 @@ const PageFillColor = props => { return ( - - - + {Device.phone && + + + + + + } @@ -439,7 +459,15 @@ const PageCustomFillColor = props => { return ( - + + {Device.phone && + + + + + + } + ) diff --git a/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx b/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx index bd05449063..2377f9295b 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx @@ -1,51 +1,36 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle, Icon, Link, Tabs, Tab} from 'framework7-react'; +import {f7, Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle, Icon, Link, Tabs, Tab, NavRight} from 'framework7-react'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx"; // Style -const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyleClick, storeFocusObjects}) => { +const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer(({onStyleClick,storeTableSettings,storeFocusObjects}) => { const tableObject = storeFocusObjects.tableObject; const styleId = tableObject ? tableObject.get_TableStyle() : null; const [stateId, setId] = useState(styleId); - - const widthContainer = document.querySelector(".page-content").clientWidth; - const columns = parseInt((widthContainer - 47) / 70); // magic - const styles = []; - let row = -1; - templates.forEach((style, index) => { - if (0 == index % columns) { - styles.push([]); - row++ - } - styles[row].push(style); - }); + const styles = storeTableSettings.styles; if (!tableObject && Device.phone) { $$('.sheet-modal.modal-in').length > 0 && f7.sheet.close(); return null; } - + return (
- {styles.map((row, rowIndex) => { - return ( -
- {row.map((style, index)=>{ - return( -
{onStyleClick(style.templateId); setId(style.templateId)}}> - -
- ) - })} -
- ) - })} +
    + {styles.map((style, index) => { + return ( +
  • {onStyleClick(style.templateId); setId(style.templateId)}}> + +
  • + ) + })} +
) })); @@ -68,7 +53,15 @@ const PageStyleOptions = props => { return ( - + + {Device.phone && + + + + + + } + {props.onCheckTemplateChange(tableLook, 0, !isFirstRow)}}/> @@ -113,7 +106,15 @@ const PageCustomFillColor = props => { return( - + + {Device.phone && + + + + + + } + ) @@ -169,7 +170,15 @@ const PageCustomBorderColor = props => { return ( - + + {Device.phone && + + + + + + } + ) @@ -198,7 +207,15 @@ const PageBorderColor = props => { return ( - + + {Device.phone && + + + + + + } + @@ -305,6 +322,13 @@ const PageStyle = props => { {_t.textFill} {_t.textBorder}
+ {Device.phone && + + + + + + } @@ -342,7 +366,15 @@ const PageReorder = props => { return ( - + + {Device.phone && + + + + + + } + {props.onReorder('all-up')}} className='no-indicator'> @@ -373,7 +405,15 @@ const PageAlign = props => { return ( - + + {Device.phone && + + + + + + } + {props.onAlign('align-left')}} className='no-indicator'> @@ -446,7 +486,7 @@ const EditTable = props => { - {props.onRemoveTable()}} className='button button-raised button-red'> + {props.onRemoveTable()}} className='button-red button-fill button-raised'> diff --git a/apps/presentationeditor/mobile/src/view/edit/EditText.jsx b/apps/presentationeditor/mobile/src/view/edit/EditText.jsx index a9c780e184..d7bd881f53 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditText.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditText.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, List, ListItem, Icon, Row, Button, Page, Navbar, Segmented, BlockTitle} from 'framework7-react'; +import {f7, List, ListItem, Icon, Row, Button, Page, Navbar, Segmented, BlockTitle, NavRight, Link} from 'framework7-react'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; @@ -201,7 +201,15 @@ const PageFonts = props => { return ( - + + {Device.phone && + + + + + + } + {!isAndroid &&
{displaySize}
} @@ -267,7 +275,15 @@ const PageFontColor = props => { return ( - + + {Device.phone && + + + + + + } + { }; return( - + + {Device.phone && + + + + + + } + ) @@ -334,7 +358,15 @@ const PageAdditionalFormatting = props => { return ( - + + {Device.phone && + + + + + + } + {props.onAdditionalStrikethrough('strikethrough', !isStrikeout)}}/> {props.onAdditionalStrikethrough('dbStrikethrough', !isDStrikeout)}}/> @@ -391,7 +423,15 @@ const PageBullets = props => { return ( - + + {Device.phone && + + + + + + } + {bulletArrays.map((bullets, index) => (
    {bullets.map((bullet) => ( @@ -439,7 +479,15 @@ const PageNumbers = props => { return ( - + + {Device.phone && + + + + + + } + {numberArrays.map((numbers, index) => (
      {numbers.map((number) => ( @@ -472,7 +520,15 @@ const PageLineSpacing = props => { return ( - + + {Device.phone && + + + + + + } + {props.onLineSpacing(1.0)}}> {props.onLineSpacing(1.15)}}> diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 86fbc28a4c..afedbcdc06 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -223,6 +223,8 @@ "txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"", "textEmptyImgUrl": "You need to specify image URL.", "notcriticalErrorTitle": "Warning", + "errorStockChart": "Incorrect row order. To build a stock chart place the data on the sheet in the following order:
      opening price, max price, min price, closing price.", + "errorMaxRows": "ERROR! The maximum number of data series per chart is 255.", "textLink": "Link", "textAddLink": "Add Link", "textLinkType": "Link Type", diff --git a/apps/spreadsheeteditor/mobile/src/controller/add/AddChart.jsx b/apps/spreadsheeteditor/mobile/src/controller/add/AddChart.jsx index 55d1b8e3af..b560d95199 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/add/AddChart.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/add/AddChart.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import { f7 } from 'framework7-react'; import {Device} from '../../../../../common/mobile/utils/device'; +import { withTranslation } from 'react-i18next'; import AddChart from '../../view/add/AddChart'; @@ -20,10 +21,24 @@ class AddChartController extends Component { onInsertChart (type) { const api = Common.EditorApi.get(); - const settings = api.asc_getChartObject(); - settings.changeType(type); - api.asc_addChartDrawingObject(settings); - this.closeModal(); + const { t } = this.props; + const _t = t('View.Add', {returnObjects: true}); + const settings = api.asc_getChartObject(true); + const info = api.asc_getCellInfo(); + const selType = info.asc_getSelectionType(); + const isChartEdit = (selType == Asc.c_oAscSelectionType.RangeChart || selType == Asc.c_oAscSelectionType.RangeChartText); + + if (settings) { + isChartEdit ? settings.changeType(type) : settings.putType(type); + let range = settings.getRange(), + isValid = !!range ? api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, !settings.getInColumns(), settings.getType()) : Asc.c_oAscError.ID.No; + if (isValid == Asc.c_oAscError.ID.No) { + isChartEdit ? api.asc_editChartDrawingObject(settings) : api.asc_addChartDrawingObject(settings); + this.closeModal(); + } else { + f7.dialog.alert((isValid == Asc.c_oAscError.ID.StockChartError) ? _t.errorStockChart : ((isValid == Asc.c_oAscError.ID.MaxDataSeriesError) ? _t.errorMaxRows : _t.txtInvalidRange), _t.notcriticalErrorTitle); + } + } } render () { @@ -34,4 +49,6 @@ class AddChartController extends Component { } } -export default AddChartController; \ No newline at end of file +const AddChartControllerTranslated = withTranslation()(AddChartController); + +export {AddChartControllerTranslated as AddChartController}; \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx b/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx index 3fd7091813..b98e305ce9 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx @@ -5,7 +5,7 @@ import {f7} from 'framework7-react'; import { observer, inject } from "mobx-react"; import {Device} from '../../../../../common/mobile/utils/device'; -import AddChartController from "../../controller/add/AddChart"; +import {AddChartController} from "../../controller/add/AddChart"; import {AddFunctionController} from "../../controller/add/AddFunction"; import {PageFunctionGroup, PageFunctionInfo} from "./AddFunction"; import AddShapeController from "../../controller/add/AddShape"; diff --git a/apps/spreadsheeteditor/mobile/src/view/add/AddImage.jsx b/apps/spreadsheeteditor/mobile/src/view/add/AddImage.jsx index c71fbc56be..a23ad9a3c2 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/AddImage.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/AddImage.jsx @@ -36,7 +36,7 @@ const PageLinkSettings = props => { >
      - + {props.onInsertByUrl(stateValue)}}> diff --git a/apps/spreadsheeteditor/mobile/src/view/add/AddLink.jsx b/apps/spreadsheeteditor/mobile/src/view/add/AddLink.jsx index 2b2086bc1d..bb107b16e1 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/AddLink.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/AddLink.jsx @@ -129,7 +129,7 @@ const AddLinkView = props => { className={isIos ? 'list-input-right' : ''} /> - + {props.onInsertLink(typeLink === 'ext' ? diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx index 539fdc2e8b..7662e68fa3 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx @@ -1466,7 +1466,7 @@ const EditChart = props => { onReorder: props.onReorder }}> - + {props.onRemoveChart()}} className='button-red button-fill button-raised'/> diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditImage.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditImage.jsx index a71943fa31..800494c905 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditImage.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditImage.jsx @@ -7,11 +7,14 @@ import {Device} from '../../../../../common/mobile/utils/device'; const EditImage = props => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); + const storeFocusObjects = props.storeFocusObjects; + const imageObject = storeFocusObjects.imageObject; + const pluginGuid = imageObject.asc_getPluginGuid(); return ( - @@ -20,8 +23,8 @@ const EditImage = props => { }}> - {_t.textActualSize} - {_t.textRemoveImage} + {_t.textActualSize} + {_t.textRemoveImage} ) diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditLink.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditLink.jsx index 24db43a7c8..5b8772a342 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditLink.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditLink.jsx @@ -157,7 +157,7 @@ const EditLink = props => { className={isIos ? 'list-input-right' : ''} /> - + {props.onEditLink(typeLink === 1 ? @@ -165,7 +165,7 @@ const EditLink = props => { {type: 2, url: range, sheet: curSheet, text: stateDisplayText, tooltip: screenTip})}} /> props.onRemoveLink()} /> diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx index f4fcb7c197..dd3eeb6e5a 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, Page, Navbar, NavRight, List, ListItem, Link, Icon, Range, Tab, Tabs} from 'framework7-react'; +import {f7, Page, Navbar, NavRight, List, ListItem, Link, Icon, Range, Tab, Tabs, ListButton} from 'framework7-react'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; @@ -12,6 +12,8 @@ const EditShape = props => { const shapeObject = storeFocusObjects.shapeObject; const canFill = shapeObject && shapeObject.get_ShapeProperties().asc_getCanFill(); + let disableRemove = storeFocusObjects.selections.indexOf('text') > -1; + return ( @@ -36,7 +38,7 @@ const EditShape = props => { }}> - {_t.textRemoveShape} + {_t.textRemoveShape} )