Merge branch 'feature/develop-fixes' into develop

This commit is contained in:
JuliaSvinareva 2021-05-27 12:58:19 +03:00
commit 5c51353d23
10 changed files with 116 additions and 75 deletions

View file

@ -485,6 +485,9 @@
&, li { &, li {
margin-bottom: 12px; margin-bottom: 12px;
} }
li, div {
box-shadow: 0 0 0 1px @gray;
}
} }
li, li,

View file

@ -104,12 +104,19 @@ export class storeChartSettings {
{ type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'chart-03.png'}, { type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'chart-03.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'chart-02.png'}, { type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'chart-02.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'chart-01.png'}, { type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'chart-01.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'chart-17.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'chart-18.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'chart-19.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'chart-20.png'},
{ type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'chart-06.png'}, { type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'chart-06.png'},
{ type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'chart-05.png'}, { type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'chart-05.png'},
{ type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'chart-04.png'}, { type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'chart-04.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'chart-09.png'}, { type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'chart-09.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'chart-08.png'}, { type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'chart-08.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'chart-07.png'}, { type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'chart-07.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'chart-25.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'chart-24.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'chart-23.png'},
{ type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'chart-12.png'}, { type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'chart-12.png'},
{ type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'chart-11.png'}, { type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'chart-11.png'},
{ type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'chart-10.png'}, { type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'chart-10.png'},
@ -119,13 +126,6 @@ export class storeChartSettings {
{ type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'chart-15.png'}, { type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'chart-15.png'},
{ type: Asc.c_oAscChartTypeSettings.stock, thumb: 'chart-16.png'}, { type: Asc.c_oAscChartTypeSettings.stock, thumb: 'chart-16.png'},
{ type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'chart-21.png'}, { type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'chart-21.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'chart-17.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'chart-18.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'chart-19.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'chart-25.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'chart-24.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'chart-23.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'chart-20.png'}
]; ];
const columns = 3; const columns = 3;
const arr = []; const arr = [];

View file

@ -52,12 +52,19 @@ export class storeChartSettings {
{ type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'chart-03.png'}, { type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'chart-03.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'chart-02.png'}, { type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'chart-02.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'chart-01.png'}, { type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'chart-01.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'chart-17.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'chart-18.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'chart-19.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'chart-20.png'},
{ type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'chart-06.png'}, { type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'chart-06.png'},
{ type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'chart-05.png'}, { type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'chart-05.png'},
{ type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'chart-04.png'}, { type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'chart-04.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'chart-09.png'}, { type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'chart-09.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'chart-08.png'}, { type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'chart-08.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'chart-07.png'}, { type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'chart-07.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'chart-25.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'chart-24.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'chart-23.png'},
{ type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'chart-12.png'}, { type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'chart-12.png'},
{ type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'chart-11.png'}, { type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'chart-11.png'},
{ type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'chart-10.png'}, { type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'chart-10.png'},
@ -67,13 +74,6 @@ export class storeChartSettings {
{ type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'chart-15.png'}, { type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'chart-15.png'},
{ type: Asc.c_oAscChartTypeSettings.stock, thumb: 'chart-16.png'}, { type: Asc.c_oAscChartTypeSettings.stock, thumb: 'chart-16.png'},
{ type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'chart-21.png'}, { type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'chart-21.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'chart-17.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'chart-18.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'chart-19.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'chart-25.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'chart-24.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'chart-23.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'chart-20.png'}
]; ];
const columns = 3; const columns = 3;
const arr = []; const arr = [];

View file

@ -90,7 +90,7 @@
"loadingDocumentTitleText": "Loading document", "loadingDocumentTitleText": "Loading document",
"loadingDocumentTextText": "Loading document...", "loadingDocumentTextText": "Loading document...",
"textLoadingDocument": "Loading document", "textLoadingDocument": "Loading document",
"textYes": "Yes",
"notcriticalErrorTitle": "Warning", "notcriticalErrorTitle": "Warning",
"textOk": "Ok", "textOk": "Ok",
"textNo": "No", "textNo": "No",

View file

@ -22,6 +22,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
api.asc_registerCallback('asc_onWorksheetLocked', onWorksheetLocked); api.asc_registerCallback('asc_onWorksheetLocked', onWorksheetLocked);
api.asc_registerCallback('asc_onSheetsChanged', onApiSheetsChanged); api.asc_registerCallback('asc_onSheetsChanged', onApiSheetsChanged);
api.asc_registerCallback('asc_onHidePopMenu', onApiHideTabContextMenu); api.asc_registerCallback('asc_onHidePopMenu', onApiHideTabContextMenu);
api.asc_registerCallback('asc_onActiveSheetChanged', onApiActiveSheetChanged);
}; };
if ( !Common.EditorApi ) { if ( !Common.EditorApi ) {
Common.Notifications.on('document:ready', onDocumentReady); Common.Notifications.on('document:ready', onDocumentReady);
@ -48,11 +49,18 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
api.asc_unregisterCallback('asc_onWorksheetLocked', onWorksheetLocked); api.asc_unregisterCallback('asc_onWorksheetLocked', onWorksheetLocked);
api.asc_unregisterCallback('asc_onSheetsChanged', onApiSheetsChanged); api.asc_unregisterCallback('asc_onSheetsChanged', onApiSheetsChanged);
api.asc_unregisterCallback('asc_onHidePopMenu', onApiHideTabContextMenu); api.asc_unregisterCallback('asc_onHidePopMenu', onApiHideTabContextMenu);
api.asc_unregisterCallback('asc_onActiveSheetChanged', onApiActiveSheetChanged);
$$('.view-main').off('click', on_main_view_click); $$('.view-main').off('click', on_main_view_click);
}; };
}, []); }, []);
const onApiActiveSheetChanged = (index) => {
// console.log(index);
sheets.setActiveWorksheet(index);
Common.Notifications.trigger('sheet:active', index);
}
const onApiHideTabContextMenu = () => { const onApiHideTabContextMenu = () => {
f7.popover.close('.document-menu.modal-in', false); f7.popover.close('.document-menu.modal-in', false);
} }

View file

@ -18,27 +18,20 @@ class EditLinkController extends Component {
this.linkInfo = cellInfo.asc_getHyperlink(); this.linkInfo = cellInfo.asc_getHyperlink();
this.isLock = cellInfo.asc_getLockText(); this.isLock = cellInfo.asc_getLockText();
this.currentSheet = api.asc_getWorksheetName(api.asc_getActiveWorksheetIndex()); this.currentSheet = api.asc_getWorksheetName(api.asc_getActiveWorksheetIndex());
// Sheets // Sheets
let items = []; let items = [];
let wsc = api.asc_getWorksheetsCount(); let wsc = api.asc_getWorksheetsCount();
const aws = api.asc_getActiveWorksheetIndex();
if (wsc > 0) { if (wsc > 0) {
items = []; items = [];
while ( !(--wsc < 0) ) { while (!(--wsc < 0)) {
if ( !api.asc_isWorksheetHidden(wsc) ) { if (!api.asc_isWorksheetHidden(wsc)) {
items.unshift({ items.unshift({
value: wsc, value: wsc,
caption: api.asc_getWorksheetName(wsc) caption: api.asc_getWorksheetName(wsc)
}); });
if (wsc === aws) {
this.activeSheet = {
value: wsc,
caption: api.asc_getWorksheetName(wsc)
}
}
} }
} }
this.sheets = items; this.sheets = items;
@ -131,7 +124,6 @@ class EditLinkController extends Component {
linkInfo={this.linkInfo} linkInfo={this.linkInfo}
isLock={this.isLock} isLock={this.isLock}
sheets={this.sheets} sheets={this.sheets}
activeSheet={this.activeSheet}
currentSheet={this.currentSheet} currentSheet={this.currentSheet}
onEditLink={this.onEditLink} onEditLink={this.onEditLink}
onRemoveLink={this.onRemoveLink} onRemoveLink={this.onRemoveLink}

View file

@ -10,21 +10,11 @@ class DownloadController extends Component {
this.onSaveFormat = this.onSaveFormat.bind(this); this.onSaveFormat = this.onSaveFormat.bind(this);
} }
closeModal() {
if (Device.phone) {
f7.sheet.close('.settings-popup', true);
} else {
f7.popover.close('#settings-popover');
}
}
onSaveFormat(format) { onSaveFormat(format) {
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
const { t } = this.props; const { t } = this.props;
const _t = t("View.Settings", {returnObjects: true}); const _t = t("View.Settings", {returnObjects: true});
this.closeModal();
if (format) { if (format) {
if (format == Asc.c_oAscFileType.CSV) { if (format == Asc.c_oAscFileType.CSV) {
f7.dialog.confirm( f7.dialog.confirm(

View file

@ -78,12 +78,19 @@ export class storeChartSettings {
{ type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'bar-normal'}, { type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'bar-normal'},
{ type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'bar-stacked'}, { type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'bar-stacked'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'bar-pstacked'}, { type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'bar-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'bar3dnormal'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'bar3dstack'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'bar3dpstack'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'bar3dpsnormal'},
{ type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'line-normal'}, { type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'line-normal'},
{ type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'line-stacked'}, { type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'line-stacked'},
{ type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'line-pstacked'}, { type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'line-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'hbar-normal'}, { type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'hbar-normal'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'hbar-stacked'}, { type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'hbar-stacked'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'hbar-pstacked'}, { type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'hbar-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'hbar3dnormal'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'hbar3dstack'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'hbar3dpstack'},
{ type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'area-normal'}, { type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'area-normal'},
{ type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'area-stacked'}, { type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'area-stacked'},
{ type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'area-pstacked'}, { type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'area-pstacked'},
@ -93,13 +100,6 @@ export class storeChartSettings {
{ type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'scatter'}, { type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'scatter'},
{ type: Asc.c_oAscChartTypeSettings.stock, thumb: 'stock'}, { type: Asc.c_oAscChartTypeSettings.stock, thumb: 'stock'},
{ type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'line3d'}, { type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'line3d'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'bar3dnormal'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'bar3dstack'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'bar3dpstack'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'hbar3dnormal'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'hbar3dstack'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'hbar3dpstack'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'bar3dpsnormal'}
]; ];
const columns = 3; const columns = 3;
let row = -1; let row = -1;

View file

@ -360,7 +360,9 @@ const PageLayout = props => {
chartType == Asc.c_oAscChartTypeSettings.lineStacked || chartType == Asc.c_oAscChartTypeSettings.lineStacked ||
chartType == Asc.c_oAscChartTypeSettings.lineStackedPer || chartType == Asc.c_oAscChartTypeSettings.lineStackedPer ||
chartType == Asc.c_oAscChartTypeSettings.stock || chartType == Asc.c_oAscChartTypeSettings.stock ||
chartType == Asc.c_oAscChartTypeSettings.scatter) { chartType == Asc.c_oAscChartTypeSettings.scatter ||
chartType == Asc.c_oAscChartTypeSettings.scatterSmoothMarker || chartType == Asc.c_oAscChartTypeSettings.scatterSmooth ||
chartType == Asc.c_oAscChartTypeSettings.scatterLineMarker || chartType == Asc.c_oAscChartTypeSettings.scatterLine) {
dataLabelPos.push( dataLabelPos.push(
{ value: Asc.c_oAscChartDataLabelsPos.l, displayValue: _t.textLeft }, { value: Asc.c_oAscChartDataLabelsPos.l, displayValue: _t.textLeft },
{ value: Asc.c_oAscChartDataLabelsPos.r, displayValue: _t.textRight }, { value: Asc.c_oAscChartDataLabelsPos.r, displayValue: _t.textRight },
@ -375,7 +377,7 @@ const PageLayout = props => {
); );
} }
const disableSetting = props.disableSetting; const disableEditAxis = props.disableEditAxis;
const chartLayoutTitles = { const chartLayoutTitles = {
0: `${_t.textNone}`, 0: `${_t.textNone}`,
@ -461,7 +463,7 @@ const PageLayout = props => {
<BlockTitle>{_t.textAxisTitle}</BlockTitle> <BlockTitle>{_t.textAxisTitle}</BlockTitle>
<List> <List>
<ListItem title={_t.textHorizontal} link="/edit-horizontal-axis-title/" <ListItem title={_t.textHorizontal} link="/edit-horizontal-axis-title/"
after={chartLayoutAxisTitleHorizontal[chartAxisHorTitle]} disabled={disableSetting} routeProps={{ after={chartLayoutAxisTitleHorizontal[chartAxisHorTitle]} disabled={disableEditAxis} routeProps={{
chartLayoutAxisTitleHorizontal, chartLayoutAxisTitleHorizontal,
setLayoutProperty: props.setLayoutProperty, setLayoutProperty: props.setLayoutProperty,
chartAxisHorTitle, chartAxisHorTitle,
@ -469,7 +471,7 @@ const PageLayout = props => {
}}> }}>
</ListItem> </ListItem>
<ListItem title={_t.textVertical} link="/edit-vertical-axis-title/" <ListItem title={_t.textVertical} link="/edit-vertical-axis-title/"
after={chartLayoutAxisTitleVertical[chartAxisVertTitle]} disabled={disableSetting} routeProps={{ after={chartLayoutAxisTitleVertical[chartAxisVertTitle]} disabled={disableEditAxis} routeProps={{
chartLayoutAxisTitleVertical, chartLayoutAxisTitleVertical,
setLayoutProperty: props.setLayoutProperty, setLayoutProperty: props.setLayoutProperty,
chartAxisVertTitle, chartAxisVertTitle,
@ -480,7 +482,7 @@ const PageLayout = props => {
<BlockTitle>{_t.textGridlines}</BlockTitle> <BlockTitle>{_t.textGridlines}</BlockTitle>
<List> <List>
<ListItem title={_t.textHorizontal} link="/edit-horizontal-gridlines/" <ListItem title={_t.textHorizontal} link="/edit-horizontal-gridlines/"
after={chartLayoutGridlinesHorizontal[chartHorGridlines]} disabled={disableSetting} routeProps={{ after={chartLayoutGridlinesHorizontal[chartHorGridlines]} disabled={disableEditAxis} routeProps={{
chartLayoutGridlinesHorizontal, chartLayoutGridlinesHorizontal,
setLayoutProperty: props.setLayoutProperty, setLayoutProperty: props.setLayoutProperty,
chartHorGridlines, chartHorGridlines,
@ -488,7 +490,7 @@ const PageLayout = props => {
}}> }}>
</ListItem> </ListItem>
<ListItem title={_t.textVertical} link="/edit-vertical-gridlines/" <ListItem title={_t.textVertical} link="/edit-vertical-gridlines/"
after={chartLayoutGridlinesVertical[chartVertGridlines]} disabled={disableSetting} routeProps={{ after={chartLayoutGridlinesVertical[chartVertGridlines]} disabled={disableEditAxis} routeProps={{
chartLayoutGridlinesVertical, chartLayoutGridlinesVertical,
setLayoutProperty: props.setLayoutProperty, setLayoutProperty: props.setLayoutProperty,
chartVertGridlines, chartVertGridlines,
@ -1155,12 +1157,14 @@ const PageHorizontalAxis = props => {
) : null} ) : null}
</List> </List>
<List> <List>
<ListItem title={_t.textAxisPosition} link="/edit-hor-axis-position/" after={axisPosition.display} routeProps={{ {!props.disableAxisPos ?
horAxisPosition, <ListItem title={_t.textAxisPosition} link="/edit-hor-axis-position/" after={axisPosition.display} routeProps={{
onHorAxisPos: props.onHorAxisPos, horAxisPosition,
axisPosition, onHorAxisPos: props.onHorAxisPos,
setAxisPosition axisPosition,
}}></ListItem> setAxisPosition
}}></ListItem>
: null}
<ListItem title={_t.textValuesInReverseOrder}> <ListItem title={_t.textValuesInReverseOrder}>
<div slot="after"> <div slot="after">
<Toggle checked={valuesReverseOrder} <Toggle checked={valuesReverseOrder}
@ -1376,12 +1380,31 @@ const EditChart = props => {
const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties();
const chartType = chartProperties && chartProperties.getType(); const chartType = chartProperties && chartProperties.getType();
const disableSetting = ( const disableEditAxis = (
chartType == Asc.c_oAscChartTypeSettings.pie || chartType == Asc.c_oAscChartTypeSettings.pie ||
chartType == Asc.c_oAscChartTypeSettings.doughnut || chartType == Asc.c_oAscChartTypeSettings.doughnut ||
chartType == Asc.c_oAscChartTypeSettings.pie3d chartType == Asc.c_oAscChartTypeSettings.pie3d
); );
const disableAxisPos = (
chartType == Asc.c_oAscChartTypeSettings.barNormal3d ||
chartType == Asc.c_oAscChartTypeSettings.barStacked3d ||
chartType == Asc.c_oAscChartTypeSettings.barStackedPer3d ||
chartType == Asc.c_oAscChartTypeSettings.hBarNormal3d ||
chartType == Asc.c_oAscChartTypeSettings.hBarStacked3d ||
chartType == Asc.c_oAscChartTypeSettings.hBarStackedPer3d ||
chartType == Asc.c_oAscChartTypeSettings.barNormal3dPerspective
);
const needReverse = (
chartType == Asc.c_oAscChartTypeSettings.hBarNormal ||
chartType == Asc.c_oAscChartTypeSettings.hBarStacked ||
chartType == Asc.c_oAscChartTypeSettings.hBarStackedPer ||
chartType == Asc.c_oAscChartTypeSettings.hBarNormal3d ||
chartType == Asc.c_oAscChartTypeSettings.hBarStacked3d ||
chartType == Asc.c_oAscChartTypeSettings.hBarStackedPer3d
);
return ( return (
<Fragment> <Fragment>
<List> <List>
@ -1393,11 +1416,21 @@ const EditChart = props => {
onBorderSize: props.onBorderSize onBorderSize: props.onBorderSize
}}></ListItem> }}></ListItem>
<ListItem title={_t.textLayout} link='/edit-chart-layout/' routeProps={{ <ListItem title={_t.textLayout} link='/edit-chart-layout/' routeProps={{
disableSetting, disableEditAxis,
setLayoutProperty: props.setLayoutProperty, setLayoutProperty: props.setLayoutProperty,
initChartLayout: props.initChartLayout initChartLayout: props.initChartLayout
}}></ListItem> }}></ListItem>
<ListItem title={_t.textVerticalAxis} link='/edit-chart-vertical-axis/' disabled={disableSetting} routeProps={{ <ListItem title={_t.textVerticalAxis} link={needReverse ? '/edit-chart-horizontal-axis/' : '/edit-chart-vertical-axis/'} disabled={disableEditAxis} routeProps={needReverse ? {
onHorAxisCrossType: props.onHorAxisCrossType,
onHorAxisCrossValue: props.onHorAxisCrossValue,
onHorAxisPos: props.onHorAxisPos,
onHorAxisReverse: props.onHorAxisReverse,
onHorAxisTickMajor: props.onHorAxisTickMajor,
onHorAxisTickMinor: props.onHorAxisTickMinor,
onHorAxisLabelPos: props.onHorAxisLabelPos,
disableAxisPos,
needReverse
} : {
onVerAxisMinValue: props.onVerAxisMinValue, onVerAxisMinValue: props.onVerAxisMinValue,
onVerAxisMaxValue: props.onVerAxisMaxValue, onVerAxisMaxValue: props.onVerAxisMaxValue,
onVerAxisCrossType: props.onVerAxisCrossType, onVerAxisCrossType: props.onVerAxisCrossType,
@ -1408,14 +1441,26 @@ const EditChart = props => {
onVerAxisTickMinor: props.onVerAxisTickMinor, onVerAxisTickMinor: props.onVerAxisTickMinor,
onVerAxisLabelPos: props.onVerAxisLabelPos onVerAxisLabelPos: props.onVerAxisLabelPos
}}></ListItem> }}></ListItem>
<ListItem title={_t.textHorizontalAxis} link='/edit-chart-horizontal-axis/' disabled={disableSetting} routeProps={{ <ListItem title={_t.textHorizontalAxis} link={needReverse || chartType == Asc.c_oAscChartTypeSettings.scatter ? '/edit-chart-vertical-axis/' : '/edit-chart-horizontal-axis/'} disabled={disableEditAxis} routeProps={needReverse || chartType == Asc.c_oAscChartTypeSettings.scatter ? {
onVerAxisMinValue: props.onVerAxisMinValue,
onVerAxisMaxValue: props.onVerAxisMaxValue,
onVerAxisCrossType: props.onVerAxisCrossType,
onVerAxisCrossValue: props.onVerAxisCrossValue,
onVerAxisDisplayUnits: props.onVerAxisDisplayUnits,
onVerAxisReverse: props.onVerAxisReverse,
onVerAxisTickMajor: props.onVerAxisTickMajor,
onVerAxisTickMinor: props.onVerAxisTickMinor,
onVerAxisLabelPos: props.onVerAxisLabelPos
} : {
onHorAxisCrossType: props.onHorAxisCrossType, onHorAxisCrossType: props.onHorAxisCrossType,
onHorAxisCrossValue: props.onHorAxisCrossValue, onHorAxisCrossValue: props.onHorAxisCrossValue,
onHorAxisPos: props.onHorAxisPos, onHorAxisPos: props.onHorAxisPos,
onHorAxisReverse: props.onHorAxisReverse, onHorAxisReverse: props.onHorAxisReverse,
onHorAxisTickMajor: props.onHorAxisTickMajor, onHorAxisTickMajor: props.onHorAxisTickMajor,
onHorAxisTickMinor: props.onHorAxisTickMinor, onHorAxisTickMinor: props.onHorAxisTickMinor,
onHorAxisLabelPos: props.onHorAxisLabelPos onHorAxisLabelPos: props.onHorAxisLabelPos,
disableAxisPos,
needReverse
}}></ListItem> }}></ListItem>
<ListItem title={_t.textReorder} link='/edit-chart-reorder/' routeProps={{ <ListItem title={_t.textReorder} link='/edit-chart-reorder/' routeProps={{
onReorder: props.onReorder onReorder: props.onReorder

View file

@ -35,7 +35,7 @@ const PageTypeLink = ({curType, changeType, storeFocusObjects}) => {
const PageSheet = ({curSheet, sheets, changeSheet, storeFocusObjects}) => { const PageSheet = ({curSheet, sheets, changeSheet, storeFocusObjects}) => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('View.Edit', {returnObjects: true}); const _t = t('View.Edit', {returnObjects: true});
const [stateSheet, setSheet] = useState(curSheet.value); const [stateSheet, setSheet] = useState(curSheet);
const settings = !storeFocusObjects.focusOn ? [] : (storeFocusObjects.focusOn === 'obj' ? storeFocusObjects.objects : storeFocusObjects.selections); const settings = !storeFocusObjects.focusOn ? [] : (storeFocusObjects.focusOn === 'obj' ? storeFocusObjects.objects : storeFocusObjects.selections);
if (storeFocusObjects.focusOn === 'obj' || settings.indexOf('hyperlink') === -1) { if (storeFocusObjects.focusOn === 'obj' || settings.indexOf('hyperlink') === -1) {
@ -59,10 +59,10 @@ const PageSheet = ({curSheet, sheets, changeSheet, storeFocusObjects}) => {
key={`sheet-${sheet.value}`} key={`sheet-${sheet.value}`}
title={sheet.caption} title={sheet.caption}
radio radio
checked={stateSheet === sheet.value} checked={stateSheet === sheet.caption}
onClick={() => { onChange={() => {
setSheet(sheet.value); setSheet(sheet.caption);
changeSheet(sheet); changeSheet(sheet.caption);
}} }}
/> />
) )
@ -80,13 +80,15 @@ const EditLink = props => {
const linkInfo = props.linkInfo; const linkInfo = props.linkInfo;
const isLock = props.isLock; const isLock = props.isLock;
const sheets = props.sheets; const sheets = props.sheets;
const activeSheet = props.activeSheet;
const currentSheet = props.currentSheet; const currentSheet = props.currentSheet;
const valueLinkInfo = linkInfo.asc_getType(); const valueTypeLink = linkInfo.asc_getType();
const linkSheet = (valueLinkInfo == Asc.c_oAscHyperlinkType.RangeLink) ? linkInfo.asc_getSheet() : currentSheet; const valueLinkSheet = linkInfo.asc_getSheet();
const getLinkSheet = () => sheets.find(sheet => sheet.caption === valueLinkSheet);
const [typeLink, setTypeLink] = useState(valueLinkInfo); const linkSheet = (valueTypeLink == Asc.c_oAscHyperlinkType.RangeLink) ? getLinkSheet() ? getLinkSheet().caption : '' : currentSheet;
const [typeLink, setTypeLink] = useState(valueTypeLink);
const textType = typeLink != Asc.c_oAscHyperlinkType.RangeLink ? _t.textExternalLink : _t.textInternalDataRange; const textType = typeLink != Asc.c_oAscHyperlinkType.RangeLink ? _t.textExternalLink : _t.textInternalDataRange;
const changeType = (newType) => { const changeType = (newType) => {
setTypeLink(newType); setTypeLink(newType);
}; };
@ -98,7 +100,8 @@ const EditLink = props => {
const [screenTip, setScreenTip] = useState(linkInfo.asc_getTooltip()); const [screenTip, setScreenTip] = useState(linkInfo.asc_getTooltip());
const [curSheet, setSheet] = useState(activeSheet); const [curSheet, setSheet] = useState(linkSheet);
const changeSheet = (sheet) => { const changeSheet = (sheet) => {
setSheet(sheet); setSheet(sheet);
}; };
@ -123,8 +126,8 @@ const EditLink = props => {
/> />
} }
{typeLink == Asc.c_oAscHyperlinkType.RangeLink && {typeLink == Asc.c_oAscHyperlinkType.RangeLink &&
<ListItem link={'/edit-link-sheet/'} title={_t.textSheet} after={linkSheet} routeProps={{ <ListItem link={'/edit-link-sheet/'} title={_t.textSheet} after={curSheet} routeProps={{
changeSheet: changeSheet, changeSheet,
sheets, sheets,
curSheet curSheet
}}/> }}/>
@ -156,10 +159,10 @@ const EditLink = props => {
</List> </List>
<List> <List>
<ListButton title={_t.textEditLink} <ListButton title={_t.textEditLink}
className={`button-fill button-raised${(typeLink === 'ext' && link.length < 1 || typeLink === 'int' && range.length < 1) && ' disabled'}`} className={`button-fill button-raised${(typeLink === 'ext' && link.length < 1 || typeLink === 'int' || range.length < 1 || !curSheet.length) && ' disabled'}`}
onClick={() => {props.onEditLink(typeLink === 1 ? onClick={() => {props.onEditLink(typeLink === 1 ?
{type: 1, url: link, text: stateDisplayText, tooltip: screenTip} : {type: 1, url: link, text: stateDisplayText, tooltip: screenTip} :
{type: 2, url: range, sheet: curSheet.caption, text: stateDisplayText, tooltip: screenTip})}} {type: 2, url: range, sheet: curSheet, text: stateDisplayText, tooltip: screenTip})}}
/> />
<ListButton title={_t.textRemoveLink} <ListButton title={_t.textRemoveLink}
className={`button-fill button-red`} className={`button-fill button-red`}