Compare commits
46 Commits
v9.3.0.68
...
cceccae31f
| Author | SHA1 | Date | |
|---|---|---|---|
| cceccae31f | |||
| af1fdf1918 | |||
| 1d6accf87f | |||
| cd8e6d0d9e | |||
| 088d7b3260 | |||
| 8b429c4717 | |||
| f552067151 | |||
| 200420cce1 | |||
| 9cf9e828ee | |||
| 34e68add90 | |||
| 7229fa3290 | |||
| 817736b0bc | |||
| 5037f4f97c | |||
| 79882fa084 | |||
| 144b94a30b | |||
| aafd624e22 | |||
| 37b8c5d95a | |||
| 35929cd342 | |||
| a8d7e13b34 | |||
| 880e34cf65 | |||
| fee828c30f | |||
| 347cc6b5d8 | |||
| 561492b6f3 | |||
| c1ce875f05 | |||
| 82a2d272d1 | |||
| 3fbd5d7afc | |||
| 6fa81f11ec | |||
| e59585ebd8 | |||
| 4d3758f6fc | |||
| 98ef8dedb8 | |||
| d1870a8c53 | |||
| 0a55c49b8c | |||
| 9c74bd6f2c | |||
| 02aee30b80 | |||
| 8273d93a13 | |||
| a1edf5f327 | |||
| 3aacba5138 | |||
| e6b1e12506 | |||
| 15b9c2f0d1 | |||
| fb7684d1d2 | |||
| ffc4ad2de5 | |||
| 4d96be4bf1 | |||
| bc4f531cfb | |||
| 6524009758 | |||
| 5b02adaf7d | |||
| 0fc869470e |
@ -302,8 +302,12 @@ define([
|
||||
elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn );
|
||||
};
|
||||
|
||||
var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
|
||||
addEvent(this.$bar[0], eventname, _.bind(this._onMouseWheel,this));
|
||||
if (Common.Utils.isMac) {
|
||||
this.$bar[0].addEventListener('wheel', _.bind(this._onMouseWheelThrottled, this));
|
||||
} else {
|
||||
var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
|
||||
addEvent(this.$bar[0], eventname, _.bind(this._onMouseWheel,this));
|
||||
}
|
||||
addEvent(this.$bar[0], 'dragstart', _.bind(function (event) {
|
||||
event.dataTransfer.effectAllowed = 'copyMove';
|
||||
}, this));
|
||||
@ -367,6 +371,33 @@ define([
|
||||
Common.NotificationCenter.trigger('hints:clear');
|
||||
},
|
||||
|
||||
_onMouseWheelThrottled: function(e) {
|
||||
var delta = (e.detail && -e.detail) || e.wheelDelta;
|
||||
if (Math.abs(delta) < 10) {
|
||||
return;
|
||||
}
|
||||
|
||||
var now = Date.now();
|
||||
if (this._lastWheelTime && now - this._lastWheelTime < 50) {
|
||||
return;
|
||||
}
|
||||
this._lastWheelTime = now;
|
||||
|
||||
var hidden = this.checkInvisible(true);
|
||||
|
||||
if (delta < 0) {
|
||||
if (hidden.last) {
|
||||
this.setTabVisible('forward');
|
||||
}
|
||||
} else {
|
||||
if (hidden.first) {
|
||||
this.setTabVisible('backward');
|
||||
}
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('hints:clear');
|
||||
},
|
||||
|
||||
onProcessMouse: function(data) {
|
||||
if (data.type == 'mouseup' && this.dragging) {
|
||||
var tab = this.getActive(true);
|
||||
|
||||
@ -167,10 +167,10 @@ define([
|
||||
}
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
setMode: function(mode, tabOptions) {
|
||||
this.appConfig = mode;
|
||||
this.popoverChanges = new Common.Collections.ReviewChanges();
|
||||
this.view = this.createView('Common.Views.ReviewChanges', { mode: mode });
|
||||
this.view = this.createView('Common.Views.ReviewChanges', { mode: mode, tabOptions: (tabOptions || {}) });
|
||||
|
||||
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length || this.appConfig.canRequestSharingSettings) {
|
||||
Common.Gateway.on('showsharingsettings', _.bind(this.changeAccessRights, this));
|
||||
|
||||
@ -598,9 +598,9 @@ define([
|
||||
|
||||
const refresh_theme = function (force, caller) {
|
||||
if ( force || Common.localStorage.getItem('ui-theme-id') != window.uitheme.id ) {
|
||||
const theme_id = Common.localStorage.getItem('ui-theme-id');
|
||||
let theme_id = Common.localStorage.getItem('ui-theme-id');
|
||||
|
||||
if ( theme_id ) {
|
||||
if ( theme_id && (force && (theme_id = 'theme-system')) ) {
|
||||
apply_theme.call(this, theme_id);
|
||||
Common.NotificationCenter.trigger('uitheme:changed', theme_id, caller);
|
||||
}
|
||||
|
||||
@ -271,6 +271,11 @@ define([
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
||||
this.appConfig = options.mode;
|
||||
this.tabOptions = {
|
||||
canCommentResolve: options.tabOptions && options.tabOptions.canCommentResolve != undefined
|
||||
? options.tabOptions.canCommentResolve
|
||||
: true
|
||||
}
|
||||
this.lockedControls = [];
|
||||
var filter = Common.localStorage.getKeysFilter();
|
||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
||||
@ -499,18 +504,20 @@ define([
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnCommentRemove);
|
||||
this.btnCommentResolve = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: this.txtCommentResolve,
|
||||
split: true,
|
||||
iconCls: 'toolbar__icon btn-resolve-all',
|
||||
lock: [_set.previewReviewMode, _set.viewFormMode, _set.hideComments, _set['Objects'], _set.lostConnect, _set.docLockView, _set.docLockForms, _set.viewMode, _set.slideMasterMode],
|
||||
action: 'comment-resolve',
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnCommentResolve);
|
||||
if(this.tabOptions.canCommentResolve) {
|
||||
this.btnCommentResolve = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: this.txtCommentResolve,
|
||||
split: true,
|
||||
iconCls: 'toolbar__icon btn-resolve-all',
|
||||
lock: [_set.previewReviewMode, _set.viewFormMode, _set.hideComments, _set['Objects'], _set.lostConnect, _set.docLockView, _set.docLockForms, _set.viewMode, _set.slideMasterMode],
|
||||
action: 'comment-resolve',
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnCommentResolve);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.appConfig.isEdit && this.appConfig.canCoAuthoring && this.appConfig.canUseMailMerge) {
|
||||
|
||||
BIN
apps/common/main/resources/img/toolbar/1.25x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
apps/common/main/resources/img/toolbar/1.75x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
apps/common/main/resources/img/toolbar/1x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 161 B |
@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 17h10v-2h1v3H4v-3h1zM5 6.5V14H4V7.707l-1.5 1.5-.707-.707 2.353-2.354zm6 7.5H6V6h5zm-4-1h3V7H7zm10 1h-5V6h5zm-4-1h3V7h-3zm3-8h-1V2.996H5V5H4V1.996h12z" fill="#000"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 284 B |
BIN
apps/common/main/resources/img/toolbar/2x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 223 B |
BIN
apps/common/main/resources/img/toolbar/v2/1.25x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 489 B |
BIN
apps/common/main/resources/img/toolbar/v2/1.5x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 475 B |
BIN
apps/common/main/resources/img/toolbar/v2/1.75x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 555 B |
BIN
apps/common/main/resources/img/toolbar/v2/1x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 372 B |
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
||||
<path d="M6.5 6.5V5.496a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1V6.5m-11 11v1a1 1 0 0 0 1 1h9a1 1 0 0 0 1-1v-1" class="icon-stroke-gray-primary"/>
|
||||
<path d="M6.5 15.5v-7l-2 2m12 5a2 2 0 0 1-2-2v-3a2 2 0 1 1 4 0v3a2 2 0 0 1-2 2Zm-6 0a2 2 0 0 1-2-2v-3a2 2 0 1 1 4 0v3a2 2 0 0 1-2 2Z" class="icon-stroke-blue-primary"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 485 B |
BIN
apps/common/main/resources/img/toolbar/v2/2x/btn-zoom-100.png
Normal file
|
After Width: | Height: | Size: 648 B |
@ -36,7 +36,6 @@
|
||||
box-shadow: inset 0 0 0 @scaled-one-px-value-ie @chb-border-normal-ie;
|
||||
box-shadow: inset 0 0 0 @scaled-one-px-value @chb-border-normal;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
svg {
|
||||
|
||||
@ -1739,10 +1739,30 @@ define([
|
||||
onMenuZoomClick: function(menu, item, e){
|
||||
switch ( item.value ) {
|
||||
case 'zoom:page':
|
||||
item.isChecked() ? this.api.zoomFitToPage() : this.api.zoomCustomMode();
|
||||
if (item.isChecked()) {
|
||||
this.api.GetMultipageViewMode() && this.api.SetMultipageViewMode(false);
|
||||
this.api.zoomFitToPage();
|
||||
this.view.mnuZoom.items[2].setChecked(false);
|
||||
} else {
|
||||
this.api.zoomCustomMode();
|
||||
}
|
||||
break;
|
||||
case 'zoom:width':
|
||||
item.isChecked() ? this.api.zoomFitToWidth() : this.api.zoomCustomMode();
|
||||
if (item.isChecked()) {
|
||||
this.api.GetMultipageViewMode() && this.api.SetMultipageViewMode(false);
|
||||
this.api.zoomFitToWidth();
|
||||
this.view.mnuZoom.items[2].setChecked(false);
|
||||
} else {
|
||||
this.api.zoomCustomMode();
|
||||
}
|
||||
break;
|
||||
case 'zoom:multi':
|
||||
if (item.isChecked()) {
|
||||
this.api.zoomCustomMode();
|
||||
this.api.SetMultipageViewMode(true);
|
||||
} else {
|
||||
this.api.SetMultipageViewMode(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -76,6 +76,7 @@ define([
|
||||
items: [
|
||||
{caption: this.textFitToPage, value: 'zoom:page', toggleGroup: 'view-zoom', checkable: true},
|
||||
{caption: this.textFitToWidth, value: 'zoom:width', toggleGroup: 'view-zoom', checkable: true},
|
||||
{caption: this.textMultiplePages, value: 'zoom:multi', checkable: true},
|
||||
(new Common.UI.MenuItem({
|
||||
template: _.template([
|
||||
'<div id="id-menu-zoom" class="menu-zoom" style="height: 26px;" ',
|
||||
|
||||
@ -186,6 +186,7 @@
|
||||
"DE.Views.ApplicationView.textCut": "Cut",
|
||||
"DE.Views.ApplicationView.textFitToPage": "Fit to page",
|
||||
"DE.Views.ApplicationView.textFitToWidth": "Fit to width",
|
||||
"DE.Views.ApplicationView.textMultiplePages": "Multiple pages",
|
||||
"DE.Views.ApplicationView.textNext": "Next field",
|
||||
"DE.Views.ApplicationView.textPaste": "Paste",
|
||||
"DE.Views.ApplicationView.textPrintSel": "Print selection",
|
||||
|
||||
@ -245,10 +245,13 @@ define([], function () {
|
||||
view.menuStyleSaveInTable.on('click', _.bind(me.onMenuSaveStyle, me));
|
||||
view.menuStyleUpdateInTable.on('click', _.bind(me.onMenuUpdateStyle, me));
|
||||
view.menuParagraphAdvanced.on('click', _.bind(me.advancedParagraphClick, me));
|
||||
view.menuEditHyperlinkPic.on('click', _.bind(me.editHyperlink, me));
|
||||
view.menuEditHyperlinkTable.on('click', _.bind(me.editHyperlink, me));
|
||||
view.menuEditHyperlinkPara.on('click', _.bind(me.editHyperlink, me));
|
||||
view.menuRemoveHyperlinkPic.on('click', _.bind(me.onRemoveHyperlink, me));
|
||||
view.menuRemoveHyperlinkTable.on('click', _.bind(me.onRemoveHyperlink, me));
|
||||
view.menuRemoveHyperlinkPara.on('click', _.bind(me.onRemoveHyperlink, me));
|
||||
view.menuAddHyperlinkPic.on('click', _.bind(me.addHyperlink, me));
|
||||
view.menuAddHyperlinkTable.on('click', _.bind(me.addHyperlink, me));
|
||||
view.menuAddHyperlinkPara.on('click', _.bind(me.addHyperlink, me));
|
||||
view.menuAddCommentTable.on('click', _.bind(me.addComment, me));
|
||||
@ -361,8 +364,7 @@ define([], function () {
|
||||
menu_props.imgProps.locked = (elValue) ? elValue.get_Locked() : false;
|
||||
|
||||
noobject = false;
|
||||
if ( (shapeprops===undefined || shapeprops===null) && (chartprops===undefined || chartprops===null) ) // not shape and chart
|
||||
break;
|
||||
|
||||
} else if (Asc.c_oAscTypeSelectElement.Table == elType)
|
||||
{
|
||||
menu_to_show = documentHolder.tableMenu;
|
||||
|
||||
@ -89,6 +89,7 @@ define([
|
||||
'ViewTab': {
|
||||
'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'),
|
||||
'zoom:towidth': _.bind(this.onBtnZoomTo, this, 'towidth'),
|
||||
'zoom:100': _.bind(this.onZoomTo100, this),
|
||||
'rulers:change': _.bind(this.onChangeRulers, this),
|
||||
'darkmode:change': _.bind(this.onChangeDarkMode, this),
|
||||
'macros:click': _.bind(this.onClickMacros, this),
|
||||
@ -360,6 +361,10 @@ define([
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
},
|
||||
|
||||
onZoomTo100: function () {
|
||||
this.api && this.api.zoom(100);
|
||||
},
|
||||
|
||||
onChangeRulers: function (btn, checked) {
|
||||
Common.localStorage.setBool('de-hidden-rulers', !checked);
|
||||
Common.Utils.InternalSettings.set("de-hidden-rulers", !checked);
|
||||
|
||||
@ -831,6 +831,36 @@ define([], function () {
|
||||
caption: me.textEditObject
|
||||
});
|
||||
|
||||
var menuHyperlinkPicSeparator = new Common.UI.MenuItem({
|
||||
caption : '--'
|
||||
});
|
||||
|
||||
me.menuAddHyperlinkPic = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText
|
||||
});
|
||||
|
||||
me.menuEditHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption : me.editHyperlinkText
|
||||
});
|
||||
|
||||
me.menuRemoveHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption : me.removeHyperlinkText
|
||||
});
|
||||
|
||||
var menuHyperlinkPic = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuEditHyperlinkPic,
|
||||
me.menuRemoveHyperlinkPic
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
this.pictureMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
restoreHeightAndTop: true,
|
||||
@ -1011,6 +1041,23 @@ define([], function () {
|
||||
var canEditPoints = me.api && me.api.asc_canEditGeometry();
|
||||
me.menuImgEditPoints.setVisible(canEditPoints);
|
||||
canEditPoints && me.menuImgEditPoints.setDisabled(islocked);
|
||||
|
||||
var text = null;
|
||||
if (me.api) {
|
||||
text = me.api.can_AddHyperlink();
|
||||
}
|
||||
me.menuAddHyperlinkPic.setVisible(value.hyperProps===undefined && text!==false);
|
||||
menuHyperlinkPic.setVisible(value.hyperProps!==undefined);
|
||||
menuHyperlinkPicSeparator.setVisible(me.menuAddHyperlinkPic.isVisible() || menuHyperlinkPic.isVisible());
|
||||
me.menuEditHyperlinkPic.hyperProps = value.hyperProps;
|
||||
me.menuRemoveHyperlinkPic.hyperProps = value.hyperProps;
|
||||
if (text !== false) {
|
||||
me.menuAddHyperlinkPic.hyperProps = {};
|
||||
me.menuAddHyperlinkPic.hyperProps.value = new Asc.CHyperlinkProperty();
|
||||
me.menuAddHyperlinkPic.hyperProps.value.put_Text(text);
|
||||
}
|
||||
me.menuAddHyperlinkPic.setDisabled(islocked);
|
||||
menuHyperlinkPic.setDisabled(islocked || (value.hyperProps!==undefined && value.hyperProps.isSeveralLinks===true));
|
||||
},
|
||||
items: [
|
||||
me.menuImgCut,
|
||||
@ -1039,6 +1086,9 @@ define([], function () {
|
||||
menuInsertCaptionSeparator,
|
||||
me.menuSaveAsPicture,
|
||||
menuSaveAsPictureSeparator,
|
||||
me.menuAddHyperlinkPic,
|
||||
menuHyperlinkPic,
|
||||
menuHyperlinkPicSeparator,
|
||||
me.menuImgCrop,
|
||||
me.menuImgResetCrop,
|
||||
me.menuOriginalSize,
|
||||
|
||||
@ -71,8 +71,13 @@ define([
|
||||
'<span class="btn-slot text slot-btn-ftw" style="text-align: center;"></span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-multiple-pages"></span>' +
|
||||
'<div class="group small">' +
|
||||
'<div class="elset">' +
|
||||
'<span class="btn-slot text" id="slot-btn-zoom-100" style="text-align: center;"></span>' +
|
||||
'</div>' +
|
||||
'<div class="elset">' +
|
||||
'<span class="btn-slot text" id="slot-btn-multiple-pages" style="text-align: center;"></span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group">' +
|
||||
@ -156,6 +161,9 @@ define([
|
||||
me.btnMultiplePages.on('click', _.bind(function (e) {
|
||||
me.fireEvent('pages:multiple', [e.pressed]);
|
||||
}, me));
|
||||
me.btnZoom100.on('click', _.bind(function (e) {
|
||||
me.fireEvent('zoom:100');
|
||||
}, me));
|
||||
me.cmbsZoom.forEach(function (cmb) {
|
||||
cmb.on('combo:focusin', _.bind(me.onComboOpen, this, false));
|
||||
cmb.on('show:after', _.bind(me.onComboOpen, this, true));
|
||||
@ -300,8 +308,8 @@ define([
|
||||
this.lockedControls.push(this.chRulers);
|
||||
|
||||
this.btnMultiplePages = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-big-multiple-pages',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-multiple-pages',
|
||||
lock: [_set.lostConnect, _set.disableOnStart],
|
||||
caption: this.textMultiplePages,
|
||||
enableToggle: true,
|
||||
@ -311,6 +319,17 @@ define([
|
||||
});
|
||||
this.lockedControls.push(this.btnMultiplePages);
|
||||
|
||||
this.btnZoom100 = new Common.UI.Button({
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-zoom-100',
|
||||
lock: [_set.lostConnect, _set.disableOnStart],
|
||||
caption: this.textZoom100,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small',
|
||||
});
|
||||
this.lockedControls.push(this.btnZoom100);
|
||||
|
||||
if (
|
||||
this.appConfig.isEdit &&
|
||||
!(this.appConfig.customization && this.appConfig.customization.macros===false) &&
|
||||
@ -427,6 +446,7 @@ define([
|
||||
this.btnInterfaceTheme.render($host.find('#slot-btn-interface-theme'));
|
||||
this.btnDarkDocument.render($host.find('#slot-btn-dark-document'));
|
||||
this.btnMultiplePages.render($host.find('#slot-btn-multiple-pages'));
|
||||
this.btnZoom100.render($host.find('#slot-btn-zoom-100'));
|
||||
this.chStatusbar.render($host.find('#slot-chk-statusbar'));
|
||||
this.chToolbar.render($host.find('#slot-chk-toolbar'));
|
||||
this.chRulers.render($host.find('#slot-chk-rulers'));
|
||||
@ -461,7 +481,8 @@ define([
|
||||
this.btnNavigation.updateHint(this.tipHeadings);
|
||||
this.btnInterfaceTheme.updateHint(this.tipInterfaceTheme);
|
||||
this.btnDarkDocument.updateHint(this.tipDarkDocument);
|
||||
this.btnMultiplePages.updateHint(this.tipMultiplePages)
|
||||
this.btnMultiplePages.updateHint(this.tipMultiplePages);
|
||||
this.btnZoom100.updateHint(this.tipZoom100);
|
||||
this.btnsFitToPage.forEach(function (btn) {
|
||||
btn.updateHint(me.tipFitToPage);
|
||||
});
|
||||
|
||||
@ -4294,6 +4294,7 @@
|
||||
"DE.Views.ViewTab.textTabStyle": "Tab style",
|
||||
"DE.Views.ViewTab.textZoom": "Zoom",
|
||||
"DE.Views.ViewTab.textMultiplePages": "Multiple Pages",
|
||||
"DE.Views.ViewTab.textZoom100": "Zoom to 100%",
|
||||
"DE.Views.ViewTab.tipDarkDocument": "Dark document",
|
||||
"DE.Views.ViewTab.tipFitToPage": "Fit to page",
|
||||
"DE.Views.ViewTab.tipFitToWidth": "Fit to width",
|
||||
@ -4305,6 +4306,7 @@
|
||||
"DE.Views.ViewTab.tipResumeMacro": "Resume recording",
|
||||
"DE.Views.ViewTab.tipStopMacro": "Stop recording",
|
||||
"DE.Views.ViewTab.tipMultiplePages": "Multiple pages",
|
||||
"DE.Views.ViewTab.tipZoom100": "Zoom to 100%",
|
||||
"DE.Views.WatermarkSettingsDialog.textAuto": "Auto",
|
||||
"DE.Views.WatermarkSettingsDialog.textBold": "Bold",
|
||||
"DE.Views.WatermarkSettingsDialog.textColor": "Text color",
|
||||
|
||||
|
Before Width: | Height: | Size: 301 B |
|
Before Width: | Height: | Size: 336 B |
|
Before Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 276 B |
@ -1,3 +0,0 @@
|
||||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M21 24H7V4H16V8C16 8.55228 16.4477 9 17 9H21V24ZM20.5858 8L17 4.41421V8H20.5858ZM7 25H21C21.5523 25 22 24.5523 22 24V8.41421C22 8.149 21.8946 7.89464 21.7071 7.70711L17.2929 3.29289C17.1054 3.10536 16.851 3 16.5858 3H7C6.44772 3 6 3.44772 6 4V24C6 24.5523 6.44772 25 7 25Z" fill="black"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 441 B |
|
Before Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 298 B |
|
Before Width: | Height: | Size: 204 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
||||
<path d="M15.5 4.5h-8a1 1 0 0 0-1 1v16.996a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9.5m-5-5 5 5m-5-5v4a1 1 0 0 0 1 1h4" class="icon-stroke-gray-primary"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 322 B |
|
Before Width: | Height: | Size: 319 B |
@ -282,32 +282,43 @@ define([
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.mode && this.mode.isEdit && this.mode.isPDFEdit) {
|
||||
var i = -1,
|
||||
in_equation = false,
|
||||
in_chart = false,
|
||||
no_paragraph = true,
|
||||
locked = false;
|
||||
while (++i < selectedElements.length) {
|
||||
var type = selectedElements[i].get_ObjectType();
|
||||
if (type === Asc.c_oAscTypeSelectElement.Math) {
|
||||
in_equation = true;
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
value && (locked = locked || value.get_Locked());
|
||||
no_paragraph = false;
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Shape) { // shape
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
if (value && value.get_FromChart()) {
|
||||
in_chart = true;
|
||||
locked = locked || value.get_Locked();
|
||||
}
|
||||
if (value && !value.get_FromImage() && !value.get_FromChart())
|
||||
no_paragraph = false;
|
||||
} else if (type == Asc.c_oAscTypeSelectElement.Table) {
|
||||
no_paragraph = false;
|
||||
|
||||
var i = -1,
|
||||
in_equation = false,
|
||||
in_chart = false,
|
||||
no_paragraph = true,
|
||||
page_edit_text = false,
|
||||
locked = false;
|
||||
while (++i < selectedElements.length) {
|
||||
var type = selectedElements[i].get_ObjectType();
|
||||
if (type === Asc.c_oAscTypeSelectElement.Math) {
|
||||
in_equation = true;
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
value && (locked = locked || value.get_Locked());
|
||||
no_paragraph = false;
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Shape) { // shape
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
if (value && value.get_FromChart()) {
|
||||
in_chart = true;
|
||||
locked = locked || value.get_Locked();
|
||||
}
|
||||
if (value && !value.get_FromImage() && !value.get_FromChart())
|
||||
no_paragraph = false;
|
||||
} else if (type == Asc.c_oAscTypeSelectElement.Table) {
|
||||
no_paragraph = false;
|
||||
}
|
||||
else if (type == Asc.c_oAscTypeSelectElement.PdfPage) {
|
||||
var value = selectedElements[i].get_ObjectValue();
|
||||
page_edit_text = value.asc_getEditLock();
|
||||
}
|
||||
}
|
||||
if (page_edit_text && me.documentHolder.btnEditText && me.documentHolder.btnEditText.cmpEl) {
|
||||
me.documentHolder.btnEditText.cmpEl.parent().hide().prev('.separator').hide();
|
||||
} else if (!page_edit_text && me.documentHolder.btnEditText && me.documentHolder.btnEditText.cmpEl){
|
||||
me.documentHolder.btnEditText.cmpEl.parent().show().prev('.separator').show();
|
||||
}
|
||||
if (this.mode && this.mode.isEdit && this.mode.isPDFEdit) {
|
||||
if (in_equation) {
|
||||
this._state.equationLocked = locked;
|
||||
this.disableEquationBar();
|
||||
@ -635,9 +646,16 @@ define([
|
||||
|
||||
editText: function() {
|
||||
var me = this;
|
||||
this.mode && !this.mode.isPDFEdit && Common.NotificationCenter.trigger('pdf:mode-apply', 'edit', undefined, function() {
|
||||
me.api && me.mode.isPDFEdit && me.api.asc_EditPage();
|
||||
});
|
||||
|
||||
if (this.mode) {
|
||||
if (this.mode.isPDFEdit) {
|
||||
me.api && me.api.asc_EditPage();
|
||||
} else {
|
||||
Common.NotificationCenter.trigger('pdf:mode-apply', 'edit', undefined, function() {
|
||||
me.api && me.mode.isPDFEdit && me.api.asc_EditPage();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clearSelection: function() {
|
||||
|
||||
@ -1664,7 +1664,11 @@ define([
|
||||
var me = this,
|
||||
application = this.getApplication(),
|
||||
reviewController = application.getController('Common.Controllers.ReviewChanges');
|
||||
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api).loadDocument({doc:me.document});
|
||||
|
||||
reviewController
|
||||
.setMode(me.appOptions, { canCommentResolve: false })
|
||||
.setConfig({config: me.editorConfig}, me.api)
|
||||
.loadDocument({doc:me.document});
|
||||
|
||||
if (this.appOptions.isEdit) {
|
||||
if (me.appOptions.isSignatureSupport || me.appOptions.isPasswordSupport)
|
||||
|
||||
|
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 218 B |
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 240 B |
|
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 194 B |
@ -1,4 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
||||
<path d="M9.5 11v7m0-7 1-.5h1m-2 .5-1-.5h-1m2 7.5 1 .5h1m-2-.5-1 .5h-1" class="icon-stroke-gray-primary"/>
|
||||
<path d="M23.5 20.25V8.75c0-.69-.56-1.25-1.25-1.25H5.75c-.69 0-1.25.56-1.25 1.25v11.5c0 .69.56 1.25 1.25 1.25h16.5c.69 0 1.25-.56 1.25-1.25Z" class="icon-stroke-blue-primary"/>
|
||||
<path d="M8.5 10.5v7m0-7h1m-1 0h-1m1 7h1m-1 0h-1m16-8.75v10.5c0 .69-.56 1.25-1.25 1.25H5.75c-.69 0-1.25-.56-1.25-1.25V8.75c0-.69.56-1.25 1.25-1.25h16.5c.69 0 1.25.56 1.25 1.25Z" class="icon-stroke-gray-primary"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 464 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 269 B |
@ -187,10 +187,13 @@ define([], function () {
|
||||
view.menuTableCut.on('click', _.bind(me.onCutCopyPaste, me));
|
||||
view.menuAddHyperlinkPara.on('click', _.bind(me.addHyperlink, me));
|
||||
view.menuAddHyperlinkTable.on('click', _.bind(me.addHyperlink, me));
|
||||
view.menuAddHyperlinkPic.on('click', _.bind(me.addHyperlink, me));
|
||||
view.menuEditHyperlinkPara.on('click', _.bind(me.editHyperlink, me));
|
||||
view.menuEditHyperlinkTable.on('click', _.bind(me.editHyperlink, me));
|
||||
view.menuEditHyperlinkPic.on('click', _.bind(me.editHyperlink, me));
|
||||
view.menuRemoveHyperlinkPara.on('click', _.bind(me.removeHyperlink, me));
|
||||
view.menuRemoveHyperlinkTable.on('click', _.bind(me.removeHyperlink, me));
|
||||
view.menuRemoveHyperlinkPic.on('click', _.bind(me.removeHyperlink, me));
|
||||
view.menuChartEdit.on('click', _.bind(me.editChartClick, me, undefined));
|
||||
view.menuImgSaveAsPicture.on('click', _.bind(me.saveAsPicture, me));
|
||||
view.menuTableSaveAsPicture.on('click', _.bind(me.saveAsPicture, me));
|
||||
@ -1181,7 +1184,7 @@ define([], function () {
|
||||
elType = selectedElements[i].get_ObjectType();
|
||||
|
||||
if (elType === Asc.c_oAscTypeSelectElement.Chart) {
|
||||
return me.api.asc_getChartSettings();
|
||||
return me.api.asc_getChartSettings(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2194,6 +2194,36 @@ define([], function () {
|
||||
caption: me.textEditObject
|
||||
});
|
||||
|
||||
var menuHyperlinkPicSeparator = new Common.UI.MenuItem({
|
||||
caption : '--'
|
||||
});
|
||||
|
||||
me.menuAddHyperlinkPic = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText
|
||||
});
|
||||
|
||||
me.menuEditHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption : me.editHyperlinkText
|
||||
});
|
||||
|
||||
me.menuRemoveHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption : me.removeHyperlinkText
|
||||
});
|
||||
|
||||
var menuHyperlinkPic = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuEditHyperlinkPic,
|
||||
me.menuRemoveHyperlinkPic
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
me.pictureMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
restoreHeightAndTop: true,
|
||||
@ -2296,6 +2326,23 @@ define([], function () {
|
||||
me.menuImgCut.setDisabled(disabled || !cancopy);
|
||||
me.menuImgPaste.setDisabled(disabled);
|
||||
menuImgShapeArrange.setDisabled(disabled);
|
||||
|
||||
var text = null;
|
||||
if (me.api) {
|
||||
text = me.api.can_AddHyperlink();
|
||||
}
|
||||
me.menuAddHyperlinkPic.setVisible(value.hyperProps===undefined && text!==false);
|
||||
menuHyperlinkPic.setVisible(value.hyperProps!==undefined);
|
||||
menuHyperlinkPicSeparator.setVisible(me.menuAddHyperlinkPic.isVisible() || menuHyperlinkPic.isVisible());
|
||||
me.menuEditHyperlinkPic.hyperProps = value.hyperProps;
|
||||
me.menuRemoveHyperlinkPic.hyperProps = value.hyperProps;
|
||||
if (text !== false) {
|
||||
me.menuAddHyperlinkPic.hyperProps = {};
|
||||
me.menuAddHyperlinkPic.hyperProps.value = new Asc.CHyperlinkProperty();
|
||||
me.menuAddHyperlinkPic.hyperProps.value.put_Text(text);
|
||||
}
|
||||
me.menuAddHyperlinkPic.setDisabled(disabled);
|
||||
menuHyperlinkPic.setDisabled(disabled || (value.hyperProps!==undefined && value.hyperProps.isSeveralLinks===true));
|
||||
},
|
||||
items: [
|
||||
me.menuImgCut,
|
||||
@ -2311,6 +2358,9 @@ define([], function () {
|
||||
menuImgShapeSeparator, //Separator
|
||||
me.menuImgSaveAsPicture,
|
||||
menuImgSaveAsPictureSeparator, //Separator
|
||||
me.menuAddHyperlinkPic,
|
||||
menuHyperlinkPic,
|
||||
menuHyperlinkPicSeparator,
|
||||
me.menuImgCrop,
|
||||
me.menuImgResetCrop,
|
||||
me.menuImgOriginalSize,
|
||||
|
||||
@ -185,6 +185,9 @@ define([], function () {
|
||||
view.menuParagraphBullets.menu.on('show:after', _.bind(me.onBulletMenuShowAfter, me));
|
||||
view.menuAddHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me));
|
||||
view.menuEditHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me));
|
||||
view.menuAddHyperlinkPic.on('click', _.bind(me.onInsHyperlink, me));
|
||||
view.menuEditHyperlinkPic.on('click', _.bind(me.onInsHyperlink, me));
|
||||
view.menuRemoveHyperlinkPic.on('click', _.bind(me.onDelHyperlink, me))
|
||||
view.menuRemoveHyperlinkShape.on('click', _.bind(me.onDelHyperlink, me));
|
||||
view.pmiTextAdvanced.on('click', _.bind(me.onTextAdvanced, me));
|
||||
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
|
||||
@ -2314,6 +2317,14 @@ define([], function () {
|
||||
});
|
||||
}
|
||||
|
||||
var hyperinfo = cellinfo.asc_getHyperlink(),
|
||||
can_add_hyperlink = this.api.asc_canAddShapeHyperlink();
|
||||
documentHolder.menuHyperlinkPic.setVisible((isimagemenu || isshapemenu) && can_add_hyperlink!==false && hyperinfo);
|
||||
documentHolder.menuAddHyperlinkPic.setVisible((isimagemenu || isshapemenu) && can_add_hyperlink!==false && !hyperinfo);
|
||||
documentHolder.menuHyperlinkPicSeparator.setVisible((isimagemenu || isshapemenu) && can_add_hyperlink!==false);
|
||||
documentHolder.menuHyperlinkPic.setDisabled(isObjLocked || this._state.wsProps['InsertHyperlinks']);
|
||||
documentHolder.menuAddHyperlinkPic.setDisabled(isObjLocked || this._state.wsProps['InsertHyperlinks']);
|
||||
|
||||
var objcount = this.api.asc_getSelectedDrawingObjectsCount();
|
||||
documentHolder.menuImageAlign.menu.items[7].setDisabled(objcount<3);
|
||||
documentHolder.menuImageAlign.menu.items[8].setDisabled(objcount<3);
|
||||
|
||||
@ -937,6 +937,7 @@ define([
|
||||
this.disableEditing(true, 'background-open');
|
||||
|
||||
this.getApplication().getController('Statusbar').setStatusCaption(text);
|
||||
this.getApplication().getController('Statusbar').statusbar.updateTabbarBorders();
|
||||
return;
|
||||
|
||||
case Asc.c_oAscAsyncAction['RefreshFile']:
|
||||
@ -962,7 +963,7 @@ define([
|
||||
|
||||
if (!this.isShowOpenDialog) {
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
this.loadMask.show();
|
||||
this.loadMask.show(action.id === Asc.c_oAscAsyncAction['Open']);
|
||||
}
|
||||
} else {
|
||||
this.getApplication().getController('Statusbar').setStatusCaption(text, force, 0, statusCallback);
|
||||
|
||||
@ -317,6 +317,8 @@ define([
|
||||
if (toolbar.cmbNumberFormat.cmpEl)
|
||||
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
|
||||
toolbar.btnEditChartData.on('click', _.bind(this.onEditChartData, this));
|
||||
toolbar.btnTextDir.menu.on('item:click', _.bind(this.onTextDirClick, this));
|
||||
toolbar.btnTextDir.menu.on('show:before', _.bind(this.onUpdateTextDir, this));
|
||||
} else
|
||||
if ( me.appConfig.isEditMailMerge ) {
|
||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||
@ -379,7 +381,6 @@ define([
|
||||
toolbar.btnTextFormatting.menu.on('item:click', _.bind(this.onTextFormattingMenu, this));
|
||||
toolbar.btnHorizontalAlign.menu.on('item:click', _.bind(this.onHorizontalAlignMenu, this));
|
||||
toolbar.btnVerticalAlign.menu.on('item:click', _.bind(this.onVerticalAlignMenu, this));
|
||||
} if ( me.appConfig.isEditDiagram || me.appConfig.isEditOle ){
|
||||
toolbar.btnTextDir.menu.on('item:click', _.bind(this.onTextDirClick, this));
|
||||
toolbar.btnTextDir.menu.on('show:before', _.bind(this.onUpdateTextDir, this));
|
||||
} else {
|
||||
|
||||
@ -185,9 +185,13 @@ define([], function () { 'use strict';
|
||||
var isvalid = true,
|
||||
txtError = '',
|
||||
value;
|
||||
value = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtCellRef.getValue(), true);
|
||||
value = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Solver_CellReference, this.txtCellRef.getValue(), true);
|
||||
if (value != Asc.c_oAscError.ID.No) {
|
||||
txtError = this.txtNotValidRef;
|
||||
if (value === Asc.c_oAscError.ID.TooManyCells) {
|
||||
txtError = this.textTooManyCells;
|
||||
} else {
|
||||
txtError = this.txtNotValidRef;
|
||||
}
|
||||
isvalid = false;
|
||||
}
|
||||
if (!isvalid) {
|
||||
@ -204,6 +208,10 @@ define([], function () { 'use strict';
|
||||
if (value !== Asc.c_oAscError.ID.No) {
|
||||
if (value === Asc.c_oAscError.ID.DataConstraintError) {
|
||||
txtError = this.textDataConstraint;
|
||||
} else if (value === Asc.c_oAscError.ID.TooManyCells) {
|
||||
txtError = this.textTooManyCells;
|
||||
} else if (value === Asc.c_oAscError.ID.UnequalCellsNumber) {
|
||||
txtError = this.textUnequalCellsNumber;
|
||||
}
|
||||
isvalid = false;
|
||||
}
|
||||
|
||||
@ -1572,6 +1572,35 @@ define([], function () {
|
||||
caption: '--'
|
||||
});
|
||||
|
||||
me.menuHyperlinkPicSeparator = new Common.UI.MenuItem({
|
||||
caption: '--'
|
||||
});
|
||||
|
||||
me.menuAddHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption: me.txtInsHyperlink
|
||||
});
|
||||
|
||||
me.menuEditHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption: me.editHyperlinkText
|
||||
});
|
||||
|
||||
me.menuRemoveHyperlinkPic = new Common.UI.MenuItem({
|
||||
caption: me.removeHyperlinkText
|
||||
});
|
||||
|
||||
me.menuHyperlinkPic = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption: me.txtInsHyperlink,
|
||||
menu: new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
me.menuEditHyperlinkPic,
|
||||
me.menuRemoveHyperlinkPic
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
this.imgMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
restoreHeightAndTop: true,
|
||||
@ -1594,6 +1623,9 @@ define([], function () {
|
||||
menuSaveAsPictureSeparator,
|
||||
me.menuSaveAsPicture,
|
||||
me.mnuShapeSeparator,
|
||||
me.menuAddHyperlinkPic,
|
||||
me.menuHyperlinkPic,
|
||||
me.menuHyperlinkPicSeparator,
|
||||
me.menuImgCrop,
|
||||
me.menuImgResetCrop,
|
||||
me.mnuChartData,
|
||||
|
||||
@ -128,9 +128,7 @@ define([
|
||||
hint: this.tipListOfSheets,
|
||||
hintAnchor: 'top'
|
||||
});
|
||||
this.btnSheetList = new Common.UI.Button({
|
||||
el: $('#status-btn-tabslist',this.$el)
|
||||
});
|
||||
this.btnSheetList = $('#status-btn-tabslist',this.$el);
|
||||
this.sheetListMenu = new Common.UI.Menu({
|
||||
style: 'margin-top:-3px;',
|
||||
menuAlign: 'bl-tl',
|
||||
@ -433,7 +431,7 @@ define([
|
||||
this.api && (this.api.asc_isWorkbookLocked() || this.api.isCellEdited) ||
|
||||
this.rangeSelectionMode!=Asc.c_oAscSelectionDialogType.None || !!this.mode.isExternalChart
|
||||
);
|
||||
this.btnSheetList.setDisabled(this.mode.isBackgroundOpen);
|
||||
this.btnSheetList[this.mode.isBackgroundOpen ? 'addClass' : 'removeClass']('disabled');
|
||||
if (this.mode.isEditOle || this.mode.isEditDiagram) { // change hints order
|
||||
this.btnAddWorksheet.$el.find('button').addBack().filter('button').attr('data-hint', '1');
|
||||
this.btnScrollBack.$el.find('button').addBack().filter('button').attr('data-hint', '1');
|
||||
@ -550,7 +548,7 @@ define([
|
||||
me.mode.isDisconnected || me.mode.isBackgroundOpen || me.api.asc_isWorkbookLocked() ||
|
||||
wbprotected || me.api.isCellEdited || !!me.mode.isExternalChart
|
||||
);
|
||||
this.btnSheetList.setDisabled(me.mode.isBackgroundOpen);
|
||||
this.btnSheetList[me.mode.isBackgroundOpen ? 'addClass' : 'removeClass']('disabled');
|
||||
if (this.mode.isEdit) {
|
||||
this.tabbar.addDataHint(_.findIndex(items, function (item) {
|
||||
return item.sheetindex === sindex;
|
||||
|
||||
@ -2791,6 +2791,8 @@
|
||||
"SSE.Views.ConstraintDialog.txtNotValidRef": "Cell reference is empty or contents are not valid.",
|
||||
"SSE.Views.ConstraintDialog.txtTitle": "Add constraint",
|
||||
"SSE.Views.ConstraintDialog.txtTitleChange": "Change constraint",
|
||||
"SSE.Views.ConstraintDialog.textTooManyCells": "Too many cells",
|
||||
"SSE.Views.ConstraintDialog.textUnequalCellsNumber": "Unequal number of cells in Cell Reference and Constraint",
|
||||
"SSE.Views.CreatePivotDialog.textDataRange": "Source data range",
|
||||
"SSE.Views.CreatePivotDialog.textDestination": "Choose where to place the table",
|
||||
"SSE.Views.CreatePivotDialog.textExist": "Existing sheet",
|
||||
|
||||
@ -206,6 +206,8 @@
|
||||
.nav-tabs {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
overscroll-behavior-x: none;
|
||||
scroll-behavior: auto;
|
||||
|
||||
> li {
|
||||
background-color: @background-pane-ie;
|
||||
|
||||
@ -9,10 +9,32 @@ class EditCellController extends Component {
|
||||
super(props);
|
||||
this.dateFormats = this.initFormats(Asc.c_oAscNumFormatType.Date, 38822);
|
||||
this.timeFormats = this.initFormats(Asc.c_oAscNumFormatType.Time, 1.534);
|
||||
this.knownFormats = this.initKnownFormats();
|
||||
|
||||
this.initCustomFormats = this.initCustomFormats.bind(this);
|
||||
this.memorizeCurrentFormat = this.memorizeCurrentFormat.bind(this);
|
||||
this.setCustomFormat = this.setCustomFormat.bind(this);
|
||||
this.onCellFormat = this.onCellFormat.bind(this);
|
||||
this.onAccountingCellFormat = this.onAccountingCellFormat.bind(this);
|
||||
this.onBorderStyle = this.onBorderStyle.bind(this);
|
||||
|
||||
this.initCustomFormats();
|
||||
this.memorizeCurrentFormat();
|
||||
}
|
||||
|
||||
memorizeCurrentFormat() {
|
||||
const api = Common.EditorApi.get();
|
||||
const info = api.asc_getCellInfo();
|
||||
const xfs = info.asc_getXfs();
|
||||
const numFormat = xfs.asc_getNumFormat();
|
||||
this.props.storeCellSettings.setCellFormat(numFormat);
|
||||
|
||||
const formatInfo = xfs.asc_getNumFormatInfo();
|
||||
const formatType = formatInfo.asc_getType();
|
||||
this.props.storeCellSettings.setCellFormatType(formatType);
|
||||
|
||||
const uiFormatType = this.getUiFormatType(numFormat, formatType);
|
||||
this.props.storeCellSettings.setUiFormatType(uiFormatType);
|
||||
}
|
||||
|
||||
initFormats(type, exampleVal) {
|
||||
@ -52,6 +74,61 @@ class EditCellController extends Component {
|
||||
storeCellSettings.initCustomFormats(data);
|
||||
}
|
||||
|
||||
initKnownFormats() {
|
||||
const api = Common.EditorApi.get();
|
||||
|
||||
const simpleFormats = {
|
||||
[Asc.c_oAscNumFormatType.General]: ['General'],
|
||||
[Asc.c_oAscNumFormatType.Number]: ['0.00'],
|
||||
[Asc.c_oAscNumFormatType.Fraction]: ['# ?/?'],
|
||||
[Asc.c_oAscNumFormatType.Scientific]: ['0.00E+00'],
|
||||
[Asc.c_oAscNumFormatType.Percent]: ['0.00%'],
|
||||
[Asc.c_oAscNumFormatType.Text]: ['@'],
|
||||
};
|
||||
|
||||
const accountingSymbols = [1033, 1031, 2057, 1049, 1041]; // $, €, £, ₽, ¥
|
||||
const accountingFormats = accountingSymbols.flatMap(symbol => {
|
||||
const info = new Asc.asc_CFormatCellsInfo();
|
||||
info.asc_setType(Asc.c_oAscNumFormatType.Accounting);
|
||||
info.asc_setSeparator(false);
|
||||
info.asc_setSymbol(symbol);
|
||||
return api.asc_getFormatCells(info) || [];
|
||||
});
|
||||
|
||||
const currencyFormats = [
|
||||
'[$$-409]#,##0.00',
|
||||
'#,##0.00\ [$€-407]',
|
||||
'[$£-809]#,##0.00',
|
||||
'#,##0.00\ [$₽-419]',
|
||||
'[$¥-411]#,##0.00'
|
||||
];
|
||||
|
||||
const dateFormats = this.dateFormats.map(f => f.value);
|
||||
const timeFormats = this.timeFormats.map(f => f.value);
|
||||
|
||||
return {
|
||||
...simpleFormats,
|
||||
[Asc.c_oAscNumFormatType.Accounting]: accountingFormats,
|
||||
[Asc.c_oAscNumFormatType.Currency]: currencyFormats,
|
||||
[Asc.c_oAscNumFormatType.Date]: dateFormats,
|
||||
[Asc.c_oAscNumFormatType.Time]: timeFormats,
|
||||
};
|
||||
}
|
||||
|
||||
getUiFormatType(cellFormat, cellFormatType) {
|
||||
if (cellFormatType === Asc.c_oAscNumFormatType.Custom) {
|
||||
return Asc.c_oAscNumFormatType.Custom;
|
||||
}
|
||||
|
||||
const knownForType = this.knownFormats[cellFormatType];
|
||||
if (!knownForType || !knownForType.includes(cellFormat)) {
|
||||
return Asc.c_oAscNumFormatType.Custom;
|
||||
}
|
||||
|
||||
return cellFormatType;
|
||||
}
|
||||
|
||||
|
||||
setCustomFormat(value) {
|
||||
const api = Common.EditorApi.get();
|
||||
const format = api.asc_convertNumFormatLocal2NumFormat(value);
|
||||
@ -62,6 +139,9 @@ class EditCellController extends Component {
|
||||
format
|
||||
});
|
||||
api.asc_setCellFormat(format);
|
||||
|
||||
storeCellSettings.setCellFormat(format);
|
||||
storeCellSettings.setCellFormatType(Asc.c_oAscNumFormatType.Custom);
|
||||
}
|
||||
|
||||
toggleBold(value) {
|
||||
@ -178,6 +258,8 @@ class EditCellController extends Component {
|
||||
onCellFormat(format) {
|
||||
const api = Common.EditorApi.get();
|
||||
api.asc_setCellFormat(format);
|
||||
|
||||
this.memorizeCurrentFormat();
|
||||
}
|
||||
|
||||
onAccountingCellFormat(value) {
|
||||
@ -190,8 +272,11 @@ class EditCellController extends Component {
|
||||
|
||||
let format = api.asc_getFormatCells(info);
|
||||
|
||||
if (format && format.length > 0)
|
||||
if (format && format.length > 0) {
|
||||
api.asc_setCellFormat(format[0]);
|
||||
this.props.storeCellSettings.setCellFormat(format[0]);
|
||||
this.props.storeCellSettings.setCellFormatType(Asc.c_oAscNumFormatType.Accounting);
|
||||
}
|
||||
}
|
||||
|
||||
onBorderStyle(type, borderInfo) {
|
||||
|
||||
@ -37,7 +37,13 @@ export class storeCellSettings {
|
||||
setAutoColor: action,
|
||||
customFormats: observable,
|
||||
initCustomFormats: action,
|
||||
addCustomFormat: action
|
||||
addCustomFormat: action,
|
||||
cellFormat: observable,
|
||||
setCellFormat: action,
|
||||
cellFormatType: observable,
|
||||
setCellFormatType: action,
|
||||
uiFormatType: observable,
|
||||
setUiFormatType: action,
|
||||
});
|
||||
}
|
||||
|
||||
@ -78,6 +84,22 @@ export class storeCellSettings {
|
||||
|
||||
customFormats;
|
||||
|
||||
cellFormat = 'General';
|
||||
cellFormatType;
|
||||
uiFormatType;
|
||||
|
||||
setCellFormat(format) {
|
||||
this.cellFormat = format;
|
||||
}
|
||||
|
||||
setCellFormatType(type) {
|
||||
this.cellFormatType = type;
|
||||
}
|
||||
|
||||
setUiFormatType(type) {
|
||||
this.uiFormatType = type;
|
||||
}
|
||||
|
||||
initCustomFormats(formatsArr) {
|
||||
this.customFormats = formatsArr;
|
||||
}
|
||||
|
||||
@ -1,9 +1,23 @@
|
||||
import React, {Fragment, useState, useEffect} from 'react';
|
||||
import {observer, inject} from "mobx-react";
|
||||
import {f7, List, ListItem, Icon, Button, Page, Navbar, Segmented, BlockTitle, NavRight, Link, Toggle, ListInput, Block} from 'framework7-react';
|
||||
import React, { Fragment, useEffect, useState } from 'react';
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {
|
||||
Block,
|
||||
BlockTitle,
|
||||
Button,
|
||||
f7,
|
||||
Link,
|
||||
List,
|
||||
ListInput,
|
||||
ListItem,
|
||||
Navbar,
|
||||
NavRight,
|
||||
Page,
|
||||
Segmented,
|
||||
Toggle
|
||||
} 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';
|
||||
import { Device } from '../../../../../common/mobile/utils/device';
|
||||
import { CustomColorPicker, ThemeColorPalette } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
|
||||
import { LocalStorage } from '../../../../../common/mobile/utils/LocalStorage.mjs';
|
||||
import { Swiper, SwiperSlide } from 'swiper/react';
|
||||
import SvgIcon from '@common/lib/component/SvgIcon';
|
||||
@ -39,7 +53,6 @@ import IconTextOrientationRotateup from '@common-icons/icon-text-orientation-rot
|
||||
import IconTextOrientationRotatedown from '@common-icons/icon-text-orientation-rotatedown.svg';
|
||||
import IconTextOrientationAngleclock from '@common-icons/icon-text-orientation-angleclock.svg';
|
||||
import IconTextOrientationVertical from '@common-icons/icon-text-orientation-vertical.svg';
|
||||
import IconPlus from '@common-ios-icons/icon-plus.svg';
|
||||
import IconAddCustomFormat from '@android-icons/icon-add-custom-format.svg';
|
||||
import IconFormatAccounting from '@icons/icon-format-accounting.svg';
|
||||
import IconFormatCurrency from '@icons/icon-format-currency.svg';
|
||||
@ -60,6 +73,37 @@ import IconTextItalic from '@common-icons/icon-text-italic.svg'
|
||||
import IconTextUnderline from '@common-icons/icon-text-underline.svg'
|
||||
import IconTextStrikethrough from '@common-icons/icon-text-strikethrough.svg'
|
||||
|
||||
const getFormatIcon = (cellFormat, cellFormatType) => {
|
||||
const exactFormatMap = {
|
||||
'General': IconFormatGeneral.id,
|
||||
'0.00': IconFormatNumber.id,
|
||||
'# ?/?': IconFormatInteger.id,
|
||||
'0.00E+00': IconFormatScientific.id,
|
||||
'0.00%': IconFormatPercentage.id,
|
||||
'@': IconFormatText.id
|
||||
};
|
||||
|
||||
if (exactFormatMap[cellFormat]) {
|
||||
return exactFormatMap[cellFormat];
|
||||
}
|
||||
|
||||
const typeMap = {
|
||||
[Asc.c_oAscNumFormatType.General]: IconFormatGeneral.id,
|
||||
[Asc.c_oAscNumFormatType.Number]: IconFormatNumber.id,
|
||||
[Asc.c_oAscNumFormatType.Scientific]: IconFormatScientific.id,
|
||||
[Asc.c_oAscNumFormatType.Accounting]: IconFormatAccounting.id,
|
||||
[Asc.c_oAscNumFormatType.Currency]: IconFormatCurrency.id,
|
||||
[Asc.c_oAscNumFormatType.Date]: IconFormatDate.id,
|
||||
[Asc.c_oAscNumFormatType.Time]: IconFormatTime.id,
|
||||
[Asc.c_oAscNumFormatType.Percent]: IconFormatPercentage.id,
|
||||
[Asc.c_oAscNumFormatType.Fraction]: IconFormatInteger.id,
|
||||
[Asc.c_oAscNumFormatType.Text]: IconFormatText.id,
|
||||
[Asc.c_oAscNumFormatType.Custom]: IconAddCustomFormat.id
|
||||
};
|
||||
|
||||
return typeMap[cellFormatType] ?? IconAddCustomFormat.id;
|
||||
};
|
||||
|
||||
const EditCell = props => {
|
||||
const isAndroid = Device.android;
|
||||
const { t } = useTranslation();
|
||||
@ -91,6 +135,8 @@ const EditCell = props => {
|
||||
<span className="color-preview" style={{ background: `#${(typeof fillColor === "object" ? fillColor.color : fillColor)}`}}></span> :
|
||||
<span className="color-preview"></span>;
|
||||
|
||||
const formatIconId = getFormatIcon(storeCellSettings.cellFormat, storeCellSettings.uiFormatType);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<List>
|
||||
@ -170,9 +216,7 @@ const EditCell = props => {
|
||||
timeFormats: props.timeFormats,
|
||||
setCustomFormat: props.setCustomFormat
|
||||
}}>
|
||||
{!isAndroid ?
|
||||
<SvgIcon slot="media" symbolId={IconFormatGeneral.id} className={'icon icon-svg'} /> : null
|
||||
}
|
||||
<SvgIcon slot="media" symbolId={formatIconId} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
</List>
|
||||
<List>
|
||||
@ -659,7 +703,6 @@ const PageTextFormatCell = props => {
|
||||
const PageTextOrientationCell = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const isAndroid = Device.android;
|
||||
const storeCellSettings = props.storeCellSettings;
|
||||
const orientationStr = storeCellSettings.orientationStr;
|
||||
|
||||
@ -1004,7 +1047,7 @@ const PageBorderSizeCell = props => {
|
||||
const PageFormatCell = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const isIos = Device.ios;
|
||||
const { cellFormat, uiFormatType: cellFormatType } = props.storeCellSettings;
|
||||
|
||||
return (
|
||||
<Page>
|
||||
@ -1021,55 +1064,112 @@ const PageFormatCell = props => {
|
||||
}
|
||||
</Navbar>
|
||||
<List>
|
||||
<ListItem link='/custom-format/' className='no-indicator' title={t('View.Edit.textCustomFormat')} routeProps={{
|
||||
setCustomFormat: props.setCustomFormat,
|
||||
onCellFormat: props.onCellFormat
|
||||
}}>
|
||||
{isIos ?
|
||||
<SvgIcon slot="media" symbolId={IconPlus.id} className={'icon icon-svg'} /> :
|
||||
<SvgIcon slot="media" symbolId={IconAddCustomFormat.id} className={'icon icon-svg'} />
|
||||
}
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textGeneral} onClick={() => props.onCellFormat('General')}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatGeneral.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textNumber} onClick={() => props.onCellFormat('0.00')}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatNumber.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textFraction} onClick={() => props.onCellFormat('# ?/?')}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatInteger.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textScientific} onClick={() => props.onCellFormat('0.00E+00')}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatScientific.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem title={_t.textAccounting} link="/edit-accounting-format-cell/" routeProps={{
|
||||
onAccountingCellFormat: props.onAccountingCellFormat
|
||||
}}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatAccounting.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem title={_t.textCurrency} link="/edit-currency-format-cell/" routeProps={{
|
||||
onCellFormat: props.onCellFormat
|
||||
}}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatCurrency.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem title={_t.textDate} link='/edit-date-format-cell/' routeProps={{
|
||||
onCellFormat: props.onCellFormat,
|
||||
dateFormats: props.dateFormats
|
||||
}}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatDate.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem title={_t.textTime} link='/edit-time-format-cell/' routeProps={{
|
||||
onCellFormat: props.onCellFormat,
|
||||
timeFormats: props.timeFormats
|
||||
}}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatTime.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textPercentage} onClick={() => props.onCellFormat('0.00%')}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatPercentage.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textText} onClick={() => props.onCellFormat('@')}>
|
||||
<SvgIcon slot="media" symbolId={IconFormatText.id} className={'icon icon-svg'} />
|
||||
</ListItem>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textGeneral}
|
||||
checked={cellFormat === 'General'}
|
||||
onChange={() => props.onCellFormat('General')}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textNumber}
|
||||
checked={cellFormat === '0.00'}
|
||||
onChange={() => props.onCellFormat('0.00')}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textFraction}
|
||||
checked={cellFormat === '# ?/?'}
|
||||
onChange={() => props.onCellFormat('# ?/?')}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textScientific}
|
||||
checked={cellFormat === '0.00E+00'}
|
||||
onChange={() => props.onCellFormat('0.00E+00')}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textAccounting}
|
||||
checked={cellFormatType === Asc.c_oAscNumFormatType.Accounting}
|
||||
link="/edit-accounting-format-cell/"
|
||||
routeProps={{
|
||||
onAccountingCellFormat: props.onAccountingCellFormat
|
||||
}}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textCurrency}
|
||||
checked={cellFormatType === Asc.c_oAscNumFormatType.Currency}
|
||||
link="/edit-currency-format-cell/"
|
||||
routeProps={{
|
||||
onCellFormat: props.onCellFormat
|
||||
}}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textDate}
|
||||
checked={cellFormatType === Asc.c_oAscNumFormatType.Date}
|
||||
link="/edit-date-format-cell/"
|
||||
routeProps={{
|
||||
onCellFormat: props.onCellFormat,
|
||||
dateFormats: props.dateFormats
|
||||
}}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textTime}
|
||||
checked={cellFormatType === Asc.c_oAscNumFormatType.Time}
|
||||
link="/edit-time-format-cell/"
|
||||
routeProps={{
|
||||
onCellFormat: props.onCellFormat,
|
||||
timeFormats: props.timeFormats
|
||||
}}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textPercentage}
|
||||
checked={cellFormat === '0.00%'}
|
||||
onChange={() => props.onCellFormat('0.00%')}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textText}
|
||||
checked={cellFormat === '@'}
|
||||
onChange={() => props.onCellFormat('@')}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="cell-format"
|
||||
title={_t.textCustomFormat}
|
||||
checked={cellFormatType === Asc.c_oAscNumFormatType.Custom}
|
||||
link="/custom-format/"
|
||||
routeProps={{
|
||||
onCellFormat: props.onCellFormat,
|
||||
setCustomFormat: props.setCustomFormat
|
||||
}}
|
||||
/>
|
||||
</List>
|
||||
</Page>
|
||||
)
|
||||
@ -1111,18 +1211,20 @@ const PageCustomFormats = props => {
|
||||
<ListItem title={t('View.Edit.textCreateCustomFormat')} link="/create-custom-format/" className='no-indicator' routeProps={{
|
||||
setCustomFormat: props.setCustomFormat,
|
||||
customFormats: props.customFormats
|
||||
}}></ListItem>
|
||||
}}/>
|
||||
</List>
|
||||
{renderList && (
|
||||
<List>
|
||||
{customFormats.map((item, idx) => (
|
||||
<ListItem
|
||||
link='#'
|
||||
className='no-indicator'
|
||||
key={idx}
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="custom-format"
|
||||
title={item.format}
|
||||
value={item.value}
|
||||
onClick={() => handleCellFormatClick(item.value)}
|
||||
checked={item.value === storeCellSettings.cellFormat}
|
||||
onChange={() => handleCellFormatClick(item.value)}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
@ -1169,9 +1271,23 @@ const PageCreationCustomFormat = observer(props => {
|
||||
)
|
||||
});
|
||||
|
||||
const PageAccountingFormatCell = observer(props => {
|
||||
const PageAccountingFormatCell = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const { cellFormat } = props.storeCellSettings;
|
||||
|
||||
// todo: number type
|
||||
|
||||
const isAccountingFormat = (symbol) => {
|
||||
const symbolMap = {
|
||||
1033: '$',
|
||||
1031: '€',
|
||||
2057: '£',
|
||||
1049: '₽',
|
||||
1041: '¥'
|
||||
};
|
||||
return cellFormat.includes(symbolMap[symbol]);
|
||||
};
|
||||
|
||||
return (
|
||||
<Page>
|
||||
@ -1188,29 +1304,55 @@ const PageAccountingFormatCell = observer(props => {
|
||||
}
|
||||
</Navbar>
|
||||
<List>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textDollar} after='$'
|
||||
onClick={() => props.onAccountingCellFormat(1033)}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textEuro} after='€'
|
||||
onClick={() => props.onAccountingCellFormat(1031)}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textPound} after='£'
|
||||
onClick={() => props.onAccountingCellFormat(2057)}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textRouble} after='₽'
|
||||
onClick={() => props.onAccountingCellFormat(1049)}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textYen} after='¥'
|
||||
onClick={() => props.onAccountingCellFormat(1041)}>
|
||||
</ListItem>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="accounting-format"
|
||||
title={_t.textDollar}
|
||||
checked={isAccountingFormat(1033)}
|
||||
onChange={() => props.onAccountingCellFormat(1033)}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="accounting-format"
|
||||
title={_t.textEuro}
|
||||
checked={isAccountingFormat(1031)}
|
||||
onChange={() => props.onAccountingCellFormat(1031)}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="accounting-format"
|
||||
title={_t.textPound}
|
||||
checked={isAccountingFormat(2057)}
|
||||
onChange={() => props.onAccountingCellFormat(2057)}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="accounting-format"
|
||||
title={_t.textRouble}
|
||||
checked={isAccountingFormat(1049)}
|
||||
onChange={() => props.onAccountingCellFormat(1049)}
|
||||
/>
|
||||
<ListItem
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="accounting-format"
|
||||
title={_t.textYen}
|
||||
checked={isAccountingFormat(1041)}
|
||||
onChange={() => props.onAccountingCellFormat(1041)}
|
||||
/>
|
||||
</List>
|
||||
</Page>
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
const PageCurrencyFormatCell = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const _t = t('View.Edit', { returnObjects: true });
|
||||
const { cellFormat } = props.storeCellSettings;
|
||||
|
||||
return (
|
||||
<Page>
|
||||
@ -1227,21 +1369,46 @@ const PageCurrencyFormatCell = props => {
|
||||
}
|
||||
</Navbar>
|
||||
<List>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textDollar} after='$'
|
||||
onClick={() => props.onCellFormat('[$$-409]#,##0.00')}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textEuro} after='€'
|
||||
onClick={() => props.onCellFormat('#,##0.00\ [$€-407]')}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textPound} after='£'
|
||||
onClick={() => props.onCellFormat('[$£-809]#,##0.00')}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textRouble} after='₽'
|
||||
onClick={() => props.onCellFormat('#,##0.00\ [$₽-419]')}>
|
||||
</ListItem>
|
||||
<ListItem link='#' className='no-indicator' title={_t.textYen} after='¥'
|
||||
onClick={() => props.onCellFormat('[$¥-411]#,##0.00')}>
|
||||
</ListItem>
|
||||
<ListItem
|
||||
title={_t.textDollar}
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="currency-format"
|
||||
checked={cellFormat === '[$$-409]#,##0.00'}
|
||||
onChange={() => props.onCellFormat('[$$-409]#,##0.00')}
|
||||
/>
|
||||
<ListItem
|
||||
title={_t.textEuro}
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="currency-format"
|
||||
checked={cellFormat === '#,##0.00\ [$€-407]'}
|
||||
onChange={() => props.onCellFormat('#,##0.00\ [$€-407]')}
|
||||
/>
|
||||
<ListItem
|
||||
title={_t.textPound}
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="currency-format"
|
||||
checked={cellFormat === '[$£-809]#,##0.00'}
|
||||
onChange={() => props.onCellFormat('[$£-809]#,##0.00')}
|
||||
/>
|
||||
<ListItem
|
||||
title={_t.textRouble}
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="currency-format"
|
||||
checked={cellFormat === '#,##0.00\ [$₽-419]'}
|
||||
onChange={() => props.onCellFormat('#,##0.00\ [$₽-419]')}
|
||||
/>
|
||||
<ListItem
|
||||
title={_t.textYen}
|
||||
radio
|
||||
radioIcon="start"
|
||||
name="currency-format"
|
||||
checked={cellFormat === '[$¥-411]#,##0.00'}
|
||||
onChange={() => props.onCellFormat('[$¥-411]#,##0.00')}
|
||||
/>
|
||||
</List>
|
||||
</Page>
|
||||
)
|
||||
@ -1251,6 +1418,7 @@ const PageDateFormatCell = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const dateFormats = props.dateFormats;
|
||||
const { cellFormat } = props.storeCellSettings;
|
||||
|
||||
return (
|
||||
<Page>
|
||||
@ -1269,8 +1437,15 @@ const PageDateFormatCell = props => {
|
||||
<List>
|
||||
{dateFormats.map((format, index) => {
|
||||
return (
|
||||
<ListItem link='#' key={index} className='no-indicator' title={format.displayValue}
|
||||
onClick={() => props.onCellFormat(format.value)}></ListItem>
|
||||
<ListItem
|
||||
key={index}
|
||||
radio
|
||||
radioIcon='start'
|
||||
name='cell-format-date'
|
||||
title={format.displayValue}
|
||||
checked={cellFormat === format.value}
|
||||
onChange={() => props.onCellFormat(format.value)}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</List>
|
||||
@ -1282,6 +1457,7 @@ const PageTimeFormatCell = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const timeFormats = props.timeFormats;
|
||||
const { cellFormat } = props.storeCellSettings;
|
||||
|
||||
return (
|
||||
<Page>
|
||||
@ -1300,8 +1476,15 @@ const PageTimeFormatCell = props => {
|
||||
<List>
|
||||
{timeFormats.map((format, index) => {
|
||||
return (
|
||||
<ListItem link='#' key={index} className='no-indicator' title={format.displayValue}
|
||||
onClick={() => props.onCellFormat(format.value)}></ListItem>
|
||||
<ListItem
|
||||
key={index}
|
||||
radio
|
||||
radioIcon='start'
|
||||
name='cell-format-time'
|
||||
title={format.displayValue}
|
||||
checked={cellFormat === format.value}
|
||||
onChange={() => props.onCellFormat(format.value)}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</List>
|
||||
@ -1375,6 +1558,11 @@ const BorderSizeCell = inject("storeCellSettings")(observer(PageBorderSizeCell))
|
||||
const CellStyle = inject("storeCellSettings")(observer(PageCellStyle));
|
||||
const CustomFormats = inject("storeCellSettings")(observer(PageCustomFormats));
|
||||
const PageCellTextDirection = inject("storeCellSettings")(observer(PageCellDirection));
|
||||
const FormatCell = inject("storeCellSettings")(observer(PageFormatCell));
|
||||
const AccountingFormatCell = inject("storeCellSettings")(observer(PageAccountingFormatCell));
|
||||
const CurrencyFormatCell = inject("storeCellSettings")(observer(PageCurrencyFormatCell));
|
||||
const DateFormatCell = inject("storeCellSettings")(observer(PageDateFormatCell));
|
||||
const TimeFormatCell = inject("storeCellSettings")(observer(PageTimeFormatCell));
|
||||
|
||||
export {
|
||||
PageEditCell as EditCell,
|
||||
@ -1389,11 +1577,11 @@ export {
|
||||
BorderColorCell,
|
||||
CustomBorderColorCell,
|
||||
BorderSizeCell,
|
||||
PageFormatCell,
|
||||
PageAccountingFormatCell,
|
||||
PageCurrencyFormatCell,
|
||||
PageDateFormatCell,
|
||||
PageTimeFormatCell,
|
||||
FormatCell as PageFormatCell,
|
||||
AccountingFormatCell as PageAccountingFormatCell,
|
||||
CurrencyFormatCell as PageCurrencyFormatCell,
|
||||
DateFormatCell as PageDateFormatCell,
|
||||
TimeFormatCell as PageTimeFormatCell,
|
||||
CellStyle,
|
||||
CustomFormats,
|
||||
PageCreationCustomFormat,
|
||||
|
||||
@ -382,7 +382,9 @@ define([
|
||||
},
|
||||
|
||||
clickToolbarPrint: function () {
|
||||
if (this.mode.canPrint)
|
||||
if (this.mode.canPreviewPrint)
|
||||
this.leftMenu.showMenu('file:printpreview');
|
||||
else if (this.mode.canPrint)
|
||||
this.clickMenuFileItem(null, 'print');
|
||||
},
|
||||
|
||||
|
||||