Compare commits

...

46 Commits

Author SHA1 Message Date
cceccae31f Merge pull request 'Fix btnTextDir subscription for “Diagram” and “OLE” modes' (#968) from fix/btnTextDir into release/v9.3.0 2026-02-09 20:11:14 +00:00
af1fdf1918 Merge pull request 'feature/form-multi-page' (#965) from feature/form-multi-page into release/v9.3.0 2026-02-09 19:55:40 +00:00
1d6accf87f Fix btnTextDir subscription for “Diagram” and “OLE” modes 2026-02-09 18:19:39 +03:00
cd8e6d0d9e Merge pull request 'fix/bug-79647' (#967) from fix/bug-79647 into release/v9.3.0 2026-02-09 14:57:22 +00:00
088d7b3260 Merge pull request '[PDFE] Hide review resolve button. For bug 79596)' (#962) from fix/hide-review-resolve-for-pdf into release/v9.3.0 2026-02-09 14:56:04 +00:00
8b429c4717 [desktop] fix bug 64448 2026-02-09 17:27:19 +03:00
f552067151 Fix: missing hyperlink props in picture context menu 2026-02-09 16:04:37 +03:00
200420cce1 Refactoring 2026-02-09 11:22:54 +03:00
9cf9e828ee [SSE] fix bug 79617 2026-02-09 01:18:09 +03:00
34e68add90 fix 2026-02-08 23:29:53 +03:00
7229fa3290 added multi page btn 2026-02-08 23:28:04 +03:00
817736b0bc Merge pull request 'fix bugs: 67695, 76519' (#953) from fix/custom-format-refactor into release/v9.3.0 2026-02-08 19:42:37 +00:00
5037f4f97c Merge pull request '[VE] Fix bug 79695' (#963) from fix/bug-79695 into release/v9.3.0 2026-02-07 09:00:56 +00:00
79882fa084 [SSE] Added “link” item to the context menu 2026-02-06 13:07:30 +03:00
144b94a30b [PDFE] Hide review resolve button. For bug 79596) 2026-02-06 10:39:01 +03:00
aafd624e22 fix bug 79647 2026-02-05 18:01:57 +03:00
37b8c5d95a Merge pull request 'fix/bug79770' (#961) from fix/bug79770 into release/v9.3.0 2026-02-05 12:27:24 +00:00
35929cd342 added error for cell reference 2026-02-05 12:04:51 +03:00
a8d7e13b34 fixed bug 79770 2026-02-05 01:43:27 +03:00
880e34cf65 Merge pull request 'Fix bug 76359' (#959) from fix/bug76359 into release/v9.3.0 2026-02-04 20:16:52 +00:00
fee828c30f Merge pull request 'fixed edit text btn in edit mode' (#942) from fix/annot-edit-text into release/v9.3.0 2026-02-04 20:02:15 +00:00
347cc6b5d8 Fix bug 76359 2026-02-04 13:58:51 +03:00
561492b6f3 added btn edit text hiding 2026-02-04 13:41:12 +03:00
c1ce875f05 Merge pull request '[SSE] Fix status caption position' (#944) from fix/status-caption into release/v9.3.0 2026-02-03 08:17:20 +00:00
82a2d272d1 [VE] Fix bug 79695 2026-02-02 12:51:50 +03:00
3fbd5d7afc Merge pull request 'fix bug 79281' (#920) from fix/bug-79281 into release/v9.3.0 2026-02-01 20:38:18 +00:00
6fa81f11ec Merge pull request 'fix/zoom-btns' (#956) from fix/zoom-btns into release/v9.3.0 2026-01-30 10:29:53 +00:00
e59585ebd8 [icons] upload 2026-01-30 14:51:35 +05:00
4d3758f6fc fixed zoom btns ui 2026-01-30 11:51:57 +03:00
98ef8dedb8 Refactoring 2026-01-30 00:53:44 +03:00
d1870a8c53 Merge pull request 'fix: disable elastic scrolling for TabBar.js' (#933) from fix/sheets-tabbar-scroll into release/v9.3.0 2026-01-29 21:45:10 +00:00
0a55c49b8c Merge pull request 'added zoom to 100% btn' (#948) from feature/zoom-to-100 into release/v9.3.0 2026-01-29 08:30:40 +00:00
9c74bd6f2c Merge pull request 'fix-pdf-text-field-icon-color' (#951) from fix/pdf-text-field-icon-color into release/v9.3.0 2026-01-28 07:59:51 +00:00
02aee30b80 [icons] text field fix 2026-01-28 12:56:13 +05:00
8273d93a13 Merge pull request 'fix bug 79555, 77436' (#950) from fix/bug-79555 into release/v9.3.0 2026-01-27 13:28:03 +00:00
a1edf5f327 fix bug 79555, 77436 2026-01-27 16:20:30 +03:00
3aacba5138 Merge pull request '[SSE] Fix bug 79564' (#949) from fix/bug-79564 into release/v9.3.0 2026-01-27 09:52:57 +00:00
e6b1e12506 [SSE] Fix bug 79564 2026-01-27 12:43:19 +03:00
15b9c2f0d1 added zoom to 100% btn 2026-01-26 15:07:16 +03:00
fb7684d1d2 [SSE] Fix status caption position 2026-01-23 13:33:33 +03:00
ffc4ad2de5 fixed edit text btn in edit mode 2026-01-23 12:27:20 +03:00
4d96be4bf1 fix: current format show in custom format selection menu 2026-01-22 13:31:50 +05:00
bc4f531cfb fix: show ui format type 2026-01-22 13:28:02 +05:00
6524009758 fix: disable elastic scrolling for TabBar.js 2026-01-21 02:41:10 +05:00
5b02adaf7d feature: add radiobutton in format selection menu 2026-01-15 13:50:43 +05:00
0fc869470e fix bug 79281 2026-01-14 20:04:02 +05:00
59 changed files with 749 additions and 183 deletions

View File

@ -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);

View File

@ -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));

View File

@ -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);
}

View File

@ -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) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;" ',

View File

@ -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",

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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);
});

View File

@ -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",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

View File

@ -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() {

View File

@ -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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 194 B

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 269 B

View File

@ -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);
}
}
}

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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 {

View File

@ -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;
}

View File

@ -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,

View File

@ -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;

View File

@ -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",

View File

@ -206,6 +206,8 @@
.nav-tabs {
height: 100%;
display: flex;
overscroll-behavior-x: none;
scroll-behavior: auto;
> li {
background-color: @background-pane-ie;

View File

@ -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) {

View File

@ -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;
}

View File

@ -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,

View File

@ -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');
},