[DE mobile] Bug 50044
This commit is contained in:
parent
2d91270e18
commit
5832ba5551
|
@ -1,6 +1,7 @@
|
||||||
import React, {Fragment, useState} from 'react';
|
import React, {Fragment, useState} from 'react';
|
||||||
import {observer, inject} from "mobx-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} from 'framework7-react';
|
||||||
|
import {f7} from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {Device} from '../../../../../common/mobile/utils/device';
|
import {Device} from '../../../../../common/mobile/utils/device';
|
||||||
import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx";
|
import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx";
|
||||||
|
@ -118,29 +119,36 @@ const PageStyle = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
const storeChartSettings = props.storeChartSettings;
|
const storeChartSettings = props.storeChartSettings;
|
||||||
const chartProperties = props.storeFocusObjects.chartObject.get_ChartProperties();
|
const chartProperties = props.storeFocusObjects.chartObject ? props.storeFocusObjects.chartObject.get_ChartProperties() : null;
|
||||||
|
|
||||||
const types = storeChartSettings.types;
|
const types = storeChartSettings.types;
|
||||||
const curType = chartProperties.getType();
|
const curType = chartProperties ? chartProperties.getType() : null;
|
||||||
|
|
||||||
const styles = storeChartSettings.styles;
|
const styles = storeChartSettings.styles;
|
||||||
|
|
||||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||||
const shapeStroke = shapeObject.get_ShapeProperties().get_stroke();
|
let borderSize, borderType, borderColor;
|
||||||
|
if (shapeObject) {
|
||||||
|
const shapeStroke = shapeObject.get_ShapeProperties().get_stroke();
|
||||||
|
borderSize = shapeStroke.get_width() * 72.0 / 25.4;
|
||||||
|
borderType = shapeStroke.get_type();
|
||||||
|
borderColor = !storeChartSettings.borderColor ? storeChartSettings.initBorderColor(shapeStroke) : storeChartSettings.borderColor;
|
||||||
|
}
|
||||||
|
|
||||||
// Init border size
|
// Init border size
|
||||||
const borderSizeTransform = storeChartSettings.borderSizeTransform();
|
const borderSizeTransform = storeChartSettings.borderSizeTransform();
|
||||||
const borderSize = shapeStroke.get_width() * 72.0 / 25.4;
|
const displayBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE || borderType === undefined) ? 0 : borderSizeTransform.indexSizeByValue(borderSize);
|
||||||
const borderType = shapeStroke.get_type();
|
const displayTextBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE || borderType === undefined) ? 0 : borderSizeTransform.sizeByValue(borderSize);
|
||||||
const displayBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize);
|
|
||||||
const displayTextBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize);
|
|
||||||
const [stateBorderSize, setBorderSize] = useState(displayBorderSize);
|
const [stateBorderSize, setBorderSize] = useState(displayBorderSize);
|
||||||
const [stateTextBorderSize, setTextBorderSize] = useState(displayTextBorderSize);
|
const [stateTextBorderSize, setTextBorderSize] = useState(displayTextBorderSize);
|
||||||
|
|
||||||
// Init border color
|
// Init border color
|
||||||
const borderColor = !storeChartSettings.borderColor ? storeChartSettings.initBorderColor(shapeStroke) : storeChartSettings.borderColor;
|
|
||||||
const displayBorderColor = borderColor !== 'transparent' ? `#${(typeof borderColor === "object" ? borderColor.color : borderColor)}` : borderColor;
|
const displayBorderColor = borderColor !== 'transparent' ? `#${(typeof borderColor === "object" ? borderColor.color : borderColor)}` : borderColor;
|
||||||
|
|
||||||
|
if (!chartProperties && Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar backLink={_t.textBack}>
|
<Navbar backLink={_t.textBack}>
|
||||||
|
@ -231,13 +239,20 @@ const PageWrap = props => {
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
const storeChartSettings = props.storeChartSettings;
|
const storeChartSettings = props.storeChartSettings;
|
||||||
const chartObject = props.storeFocusObjects.chartObject;
|
const chartObject = props.storeFocusObjects.chartObject;
|
||||||
const wrapType = storeChartSettings.getWrapType(chartObject);
|
let wrapType, align, moveText, overlap, distance;
|
||||||
const align = storeChartSettings.getAlign(chartObject);
|
if (chartObject) {
|
||||||
const moveText = storeChartSettings.getMoveText(chartObject);
|
wrapType = storeChartSettings.getWrapType(chartObject);
|
||||||
const overlap = storeChartSettings.getOverlap(chartObject);
|
align = storeChartSettings.getAlign(chartObject);
|
||||||
const distance = Common.Utils.Metric.fnRecalcFromMM(storeChartSettings.getWrapDistance(chartObject));
|
moveText = storeChartSettings.getMoveText(chartObject);
|
||||||
|
overlap = storeChartSettings.getOverlap(chartObject);
|
||||||
|
distance = Common.Utils.Metric.fnRecalcFromMM(storeChartSettings.getWrapDistance(chartObject));
|
||||||
|
}
|
||||||
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||||
const [stateDistance, setDistance] = useState(distance);
|
const [stateDistance, setDistance] = useState(distance);
|
||||||
|
if (!chartObject && Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textWrap} backLink={_t.textBack} />
|
<Navbar title={_t.textWrap} backLink={_t.textBack} />
|
||||||
|
@ -328,6 +343,11 @@ const PageWrap = props => {
|
||||||
const PageReorder = props => {
|
const PageReorder = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
|
const chartObject = props.storeFocusObjects.chartObject;
|
||||||
|
if (!chartObject && Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textReorder} backLink={_t.textBack} />
|
<Navbar title={_t.textReorder} backLink={_t.textBack} />
|
||||||
|
@ -382,6 +402,7 @@ const EditChart = props => {
|
||||||
|
|
||||||
const PageChartStyle = inject("storeChartSettings", "storeFocusObjects")(observer(PageStyle));
|
const PageChartStyle = inject("storeChartSettings", "storeFocusObjects")(observer(PageStyle));
|
||||||
const PageChartWrap = inject("storeChartSettings", "storeFocusObjects")(observer(PageWrap));
|
const PageChartWrap = inject("storeChartSettings", "storeFocusObjects")(observer(PageWrap));
|
||||||
|
const PageChartReorder = inject("storeFocusObjects")(observer(PageReorder));
|
||||||
const PageChartCustomFillColor = inject("storeChartSettings", "storePalette")(observer(PageCustomFillColor));
|
const PageChartCustomFillColor = inject("storeChartSettings", "storePalette")(observer(PageCustomFillColor));
|
||||||
const PageChartBorderColor = inject("storeChartSettings", "storePalette")(observer(PageBorderColor));
|
const PageChartBorderColor = inject("storeChartSettings", "storePalette")(observer(PageBorderColor));
|
||||||
const PageChartCustomBorderColor = inject("storeChartSettings", "storePalette")(observer(PageCustomBorderColor));
|
const PageChartCustomBorderColor = inject("storeChartSettings", "storePalette")(observer(PageCustomBorderColor));
|
||||||
|
@ -392,4 +413,4 @@ export {EditChart,
|
||||||
PageChartBorderColor,
|
PageChartBorderColor,
|
||||||
PageChartCustomBorderColor,
|
PageChartCustomBorderColor,
|
||||||
PageChartWrap,
|
PageChartWrap,
|
||||||
PageReorder as PageChartReorder}
|
PageChartReorder}
|
|
@ -11,13 +11,20 @@ const PageWrap = props => {
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
const storeImageSettings = props.storeImageSettings;
|
const storeImageSettings = props.storeImageSettings;
|
||||||
const imageObject = props.storeFocusObjects.imageObject;
|
const imageObject = props.storeFocusObjects.imageObject;
|
||||||
const wrapType = storeImageSettings.getWrapType(imageObject);
|
let wrapType, align, moveText, overlap, distance;
|
||||||
const align = storeImageSettings.getAlign(imageObject);
|
if (imageObject) {
|
||||||
const moveText = storeImageSettings.getMoveText(imageObject);
|
wrapType = storeImageSettings.getWrapType(imageObject);
|
||||||
const overlap = storeImageSettings.getOverlap(imageObject);
|
align = storeImageSettings.getAlign(imageObject);
|
||||||
const distance = Common.Utils.Metric.fnRecalcFromMM(storeImageSettings.getWrapDistance(imageObject));
|
moveText = storeImageSettings.getMoveText(imageObject);
|
||||||
|
overlap = storeImageSettings.getOverlap(imageObject);
|
||||||
|
distance = Common.Utils.Metric.fnRecalcFromMM(storeImageSettings.getWrapDistance(imageObject));
|
||||||
|
}
|
||||||
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||||
const [stateDistance, setDistance] = useState(distance);
|
const [stateDistance, setDistance] = useState(distance);
|
||||||
|
if (!imageObject && Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textWrap} backLink={_t.textBack} />
|
<Navbar title={_t.textWrap} backLink={_t.textBack} />
|
||||||
|
@ -143,6 +150,11 @@ const PageLinkSettings = props => {
|
||||||
const PageReplace = props => {
|
const PageReplace = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
|
const imageObject = props.storeFocusObjects.imageObject;
|
||||||
|
if (!imageObject && Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textReplace} backLink={_t.textBack} />
|
<Navbar title={_t.textReplace} backLink={_t.textBack} />
|
||||||
|
@ -163,6 +175,11 @@ const PageReplace = props => {
|
||||||
const PageReorder = props => {
|
const PageReorder = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
|
const imageObject = props.storeFocusObjects.imageObject;
|
||||||
|
if (!imageObject && Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textReorder} backLink={_t.textBack} />
|
<Navbar title={_t.textReorder} backLink={_t.textBack} />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, {Fragment, useState} from 'react';
|
import React, {Fragment, useState} from 'react';
|
||||||
import {observer, inject} from "mobx-react";
|
import {observer, inject} from "mobx-react";
|
||||||
import {List, ListItem, Icon, Button, Page, Navbar, Segmented, BlockTitle, Toggle} from 'framework7-react';
|
import {f7, List, ListItem, Icon, Button, Page, Navbar, Segmented, BlockTitle, Toggle} from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {Device} from '../../../../../common/mobile/utils/device';
|
import {Device} from '../../../../../common/mobile/utils/device';
|
||||||
import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
|
import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
|
||||||
|
@ -11,24 +11,31 @@ const PageAdvancedSettings = props => {
|
||||||
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||||
const storeFocusObjects = props.storeFocusObjects;
|
const storeFocusObjects = props.storeFocusObjects;
|
||||||
const paragraphObj = storeFocusObjects.paragraphObject;
|
const paragraphObj = storeFocusObjects.paragraphObject;
|
||||||
if (paragraphObj.get_Ind()===null || paragraphObj.get_Ind()===undefined) {
|
let firstLine, spaceBefore, spaceAfter, spaceBeforeFix, spaceAfterFix, displayBefore, displayAfter, spaceBetween, breakBefore, orphanControl, keepTogether, keepWithNext;
|
||||||
paragraphObj.get_Ind().put_FirstLine(0);
|
if (paragraphObj) {
|
||||||
|
if (paragraphObj.get_Ind()===null || paragraphObj.get_Ind()===undefined) {
|
||||||
|
paragraphObj.get_Ind().put_FirstLine(0);
|
||||||
|
}
|
||||||
|
firstLine = parseFloat(Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Ind().get_FirstLine()).toFixed(2));
|
||||||
|
|
||||||
|
spaceBefore = paragraphObj.get_Spacing().get_Before() < 0 ? paragraphObj.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Spacing().get_Before());
|
||||||
|
spaceAfter = paragraphObj.get_Spacing().get_After() < 0 ? paragraphObj.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Spacing().get_After());
|
||||||
|
spaceBeforeFix = parseFloat(spaceBefore.toFixed(2));
|
||||||
|
spaceAfterFix = parseFloat(spaceAfter.toFixed(2));
|
||||||
|
displayBefore = spaceBefore < 0 ? t('Edit.textAuto') : spaceBeforeFix + ' ' + metricText;
|
||||||
|
displayAfter = spaceAfter < 0 ? t('Edit.textAuto') : spaceAfterFix + ' ' + metricText;
|
||||||
|
|
||||||
|
spaceBetween = paragraphObj.get_ContextualSpacing();
|
||||||
|
breakBefore = paragraphObj.get_PageBreakBefore();
|
||||||
|
orphanControl = paragraphObj.get_WidowControl();
|
||||||
|
keepTogether = paragraphObj.get_KeepLines();
|
||||||
|
keepWithNext = paragraphObj.get_KeepNext();
|
||||||
|
} else {
|
||||||
|
if (Device.phone) {
|
||||||
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const firstLine = parseFloat(Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Ind().get_FirstLine()).toFixed(2));
|
|
||||||
|
|
||||||
const spaceBefore = paragraphObj.get_Spacing().get_Before() < 0 ? paragraphObj.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Spacing().get_Before());
|
|
||||||
const spaceAfter = paragraphObj.get_Spacing().get_After() < 0 ? paragraphObj.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Spacing().get_After());
|
|
||||||
const spaceBeforeFix = parseFloat(spaceBefore.toFixed(2));
|
|
||||||
const spaceAfterFix = parseFloat(spaceAfter.toFixed(2));
|
|
||||||
const displayBefore = spaceBefore < 0 ? t('Edit.textAuto') : spaceBeforeFix + ' ' + metricText;
|
|
||||||
const displayAfter = spaceAfter < 0 ? t('Edit.textAuto') : spaceAfterFix + ' ' + metricText;
|
|
||||||
|
|
||||||
const spaceBetween = paragraphObj.get_ContextualSpacing();
|
|
||||||
const breakBefore = paragraphObj.get_PageBreakBefore();
|
|
||||||
const orphanControl = paragraphObj.get_WidowControl();
|
|
||||||
const keepTogether = paragraphObj.get_KeepLines();
|
|
||||||
const keepWithNext = paragraphObj.get_KeepNext();
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={t('Edit.textAdvanced')} backLink={t('Edit.textBack')} />
|
<Navbar title={t('Edit.textAdvanced')} backLink={t('Edit.textBack')} />
|
||||||
|
|
|
@ -75,13 +75,20 @@ const PageAdditionalFormatting = props => {
|
||||||
const storeTextSettings = props.storeTextSettings;
|
const storeTextSettings = props.storeTextSettings;
|
||||||
const storeFocusObjects = props.storeFocusObjects;
|
const storeFocusObjects = props.storeFocusObjects;
|
||||||
const paragraph = storeFocusObjects.paragraphObject;
|
const paragraph = storeFocusObjects.paragraphObject;
|
||||||
const isStrikeout = paragraph.get_Strikeout();
|
let isStrikeout, isDStrikeout, isSmallCaps, isAllCaps, letterSpacing;
|
||||||
const isDStrikeout = paragraph.get_DStrikeout();
|
if (paragraph) {
|
||||||
|
isStrikeout = paragraph.get_Strikeout();
|
||||||
|
isDStrikeout = paragraph.get_DStrikeout();
|
||||||
|
isSmallCaps = paragraph.get_SmallCaps();
|
||||||
|
isAllCaps = paragraph.get_AllCaps();
|
||||||
|
letterSpacing = Common.Utils.Metric.fnRecalcFromMM(paragraph.get_TextSpacing());
|
||||||
|
}
|
||||||
const isSuperscript = storeTextSettings.isSuperscript;
|
const isSuperscript = storeTextSettings.isSuperscript;
|
||||||
const isSubscript = storeTextSettings.isSubscript;
|
const isSubscript = storeTextSettings.isSubscript;
|
||||||
const isSmallCaps = paragraph.get_SmallCaps();
|
if (!paragraph && Device.phone) {
|
||||||
const isAllCaps = paragraph.get_AllCaps();
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
const letterSpacing = Common.Utils.Metric.fnRecalcFromMM(paragraph.get_TextSpacing());
|
return null;
|
||||||
|
}
|
||||||
return(
|
return(
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={t('Edit.textAdditional')} backLink={t('Edit.textBack')} />
|
<Navbar title={t('Edit.textAdditional')} backLink={t('Edit.textBack')} />
|
||||||
|
|
Loading…
Reference in a new issue