Merge branch 'develop' into feature/gradient-fill

This commit is contained in:
JuliaSvinareva 2020-07-22 13:02:09 +03:00
commit b89a1c784c
69 changed files with 1925 additions and 166 deletions

View file

@ -48,7 +48,8 @@
comment: <can comment in view mode> // default = edit,
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
modifyContentControl: <can modify content controls in documenteditor> // default = true
fillForms: <can edit forms in view mode> // default = edit || review
fillForms: <can edit forms in view mode> // default = edit || review,
copy: <can copy data> // default = true
}
},
editorConfig: {

View file

@ -152,6 +152,7 @@ define([
alias: 'Window',
cls: '',
toolclose: 'close',
help: false,
maxwidth: undefined,
maxheight: undefined,
minwidth: 0,
@ -162,9 +163,14 @@ define([
var template = '<div class="asc-window<%= modal?" modal":"" %><%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' +
'<% if (header==true) { %>' +
'<div class="header">' +
'<div class="tools">' +
'<% if (closable!==false) %>' +
'<div class="tool close img-commonctrl"></div>' +
'<% %>' +
'<% if (help===true) %>' +
'<div class="tool help">?</div>' +
'<% %>' +
'</div>' +
'<div class="title"><%= title %></div> ' +
'</div>' +
'<% } %>' +
@ -284,7 +290,7 @@ define([
/* window drag's functions */
function _dragstart(event) {
if ( $(event.target).hasClass('close') ) return;
if ( $(event.target).hasClass('close') || $(event.target).hasClass('help') ) return;
Common.UI.Menu.Manager.hideAll();
var zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1;
this.dragging.enabled = true;
@ -635,8 +641,13 @@ define([
else
(this.initConfig.toolclose=='hide') ? this.hide() : this.close();
};
var dohelp = function() {
if ( this.$window.find('.tool.help').hasClass('disabled') ) return;
this.fireEvent('help',this);
};
this.$window.find('.header').on('mousedown', this.binding.dragStart);
this.$window.find('.tool.close').on('click', _.bind(doclose, this));
this.$window.find('.tool.help').on('click', _.bind(dohelp, this));
if (!this.initConfig.modal)
Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this));
@ -951,6 +962,13 @@ define([
this.$window.find('.resize-border').remove();
}
this.resizable = resizable;
} else {
if (resizable) {
(minSize && minSize.length>1) && (this.initConfig.minwidth = minSize[0]);
(minSize && minSize.length>1) && (this.initConfig.minheight = minSize[1]);
(maxSize && maxSize.length>1) && (this.initConfig.maxwidth = maxSize[0]);
(maxSize && maxSize.length>1) && (this.initConfig.maxheight = maxSize[1]);
}
}
},

View file

@ -225,6 +225,7 @@ define([
variation.set_Size(itemVar.get('size'));
variation.set_InitOnSelectionChanged(itemVar.get('initOnSelectionChanged'));
variation.set_Events(itemVar.get('events'));
variation.set_Help(itemVar.get('help'));
variationsArr.push(variation);
});
@ -380,6 +381,7 @@ define([
});
}
var help = variation.get_Help();
me.pluginDlg = new Common.Views.PluginDlg({
cls: isCustomWindow ? 'plain' : '',
header: !isCustomWindow,
@ -389,7 +391,8 @@ define([
url: url,
frameId : frameId,
buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this)
toolcallback: _.bind(this.onToolClose, this),
help: !!help
});
me.pluginDlg.on({
'render:after': function(obj){
@ -404,6 +407,9 @@ define([
},
'resize': function(args){
me.api.asc_pluginEnableMouseEvents(args[1]=='start');
},
'help': function(){
help && window.open(help, '_blank');
}
});
@ -535,7 +541,8 @@ define([
url: itemVar.url,
icons: itemVar.icons,
buttons: itemVar.buttons,
visible: visible
visible: visible,
help: itemVar.help
});
variationsArr.push(model);

View file

@ -309,7 +309,7 @@
&:not(.icon-top)
.caption:not(:empty) {
padding: 0 2px;
padding: 0 5px;
}
.icon {

View file

@ -59,6 +59,12 @@
cursor: move;
.tools {
position: absolute;
right: 0;
padding-right: 6px;
}
.tool {
float: right;
width: 16px;
@ -80,6 +86,25 @@
cursor: default;
}
}
&.help {
width: 20px;
margin-right:0;
line-height: 14px;
font-size: 14px;
font-weight: bold;
color: #444;
opacity: 0.7;
&:hover {
opacity: 1;
}
&.disabled {
opacity: 0.3;
cursor: default;
}
}
}
&.resizing {

View file

@ -2376,7 +2376,7 @@ define([
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink, toolbar.btnInsertTable]});
this._state.inpivot = !!info.asc_getPivotTableInfo();
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsClearAutofilter, toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort,
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnCustomSort,
toolbar.btnMerge, toolbar.btnInsertHyperlink, toolbar.btnInsertTable, toolbar.btnRemoveDuplicates)});
toolbar.lockToolbar(SSE.enumLock.noSlicerSource, !(this._state.inpivot || formatTableInfo), { array: [toolbar.btnInsertSlicer]});

View file

@ -9,27 +9,27 @@
</tr>
</table>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr>
<td>
<label class="header"><%= scope.textDataRange %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="200">
<div id="chart-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<label class="input-label"><%= scope.textDataSeries %></label>
<div id="chart-dlg-combo-range" class="input-group-nr" style="width:120px;"></div>
</td>
</tr>
</table>
</div>
<!--<div class="separator horizontal padding-large"></div>-->
<!--<div class="inner-content">-->
<!--<table cols="1" style="width: 100%;">-->
<!--<tr>-->
<!--<td>-->
<!--<label class="header"><%= scope.textDataRange %></label>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="padding-small" width="200">-->
<!--<div id="chart-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="padding-small">-->
<!--<label class="input-label"><%= scope.textDataSeries %></label>-->
<!--<div id="chart-dlg-combo-range" class="input-group-nr" style="width:120px;"></div>-->
<!--</td>-->
<!--</tr>-->
<!--</table>-->
<!--</div>-->
</div>
<div id="id-chart-settings-dlg-layout" class="settings-panel">
<div class="inner-content">

View file

@ -30,7 +30,7 @@
<button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon toolbar__icon btn-menu-chart">&nbsp;</i></button>
<button id="id-right-menu-text" class="btn btn-category arrow-left" content-target="id-paragraph-settings"><i class="icon toolbar__icon btn-paragraph">&nbsp;</i></button>
<button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon toolbar__icon btn-menu-textart">&nbsp;</i></button>
<button id="id-right-menu-pivot" class="btn btn-category arrow-left" content-target="id-pivot-settings"><i class="icon toolbar__icon btn-menu-pivot">&nbsp;</i></button>
<button id="id-right-menu-pivot" class="btn btn-category arrow-left" content-target="id-pivot-settings"><i class="icon toolbar__icon btn-pivot-sum">&nbsp;</i></button>
<button id="id-right-menu-slicer" class="btn btn-category arrow-left" content-target="id-slicer-settings"><i class="icon toolbar__icon btn-slicer">&nbsp;</i></button>
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" content-target="id-signature-settings"><i class="icon toolbar__icon btn-menu-signature">&nbsp;</i></button>
</div>

View file

@ -75,22 +75,34 @@
</tr>
<tr>
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="table-btn-convert-range" style="width:100%;"><%= scope.textConvertRange %></button>
<div class="separator horizontal"></div>
</td>
</tr>
</table>
<table cols="2">
<tr>
<td class="padding-small" colspan=2>
<label class="header"><%= scope.textActions %></label>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="table-btn-rem-duplicates" style="width:100%;"><%= scope.textRemDuplicates %></button>
<div id="table-btn-rem-duplicates" style="width:100%;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="table-btn-slicer" style="width:100%;"><%= scope.textSlicer %></button>
<div id="table-btn-convert-range" style="width:100%;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div id="table-btn-slicer" style="width:100%;"></div>
</td>
</tr>
<tr class="pivot-only">
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="table-btn-pivot" style="width:100%;"><%= scope.textPivot %></button>
<div id="table-btn-pivot" style="width:100%;"></div>
</td>
</tr>
<tr>

View file

@ -83,7 +83,7 @@ define([
'</div>',
'</div>',
'<div class="separator horizontal" style="width:100%"></div>',
'<div class="footer right" style="margin-left:-15px;">',
'<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok">', t.okButtonText, '</button>',
'<button class="btn normal dlg-btn" result="cancel">', t.cancelButtonText, '</button>',
'</div>'
@ -303,8 +303,10 @@ define([
initialize: function (options) {
var t = this, _options = {};
this.type = options.type;
_.extend(_options, {
width : 318,
width : (this.type=='value') ? 450 : 318,
height : 160,
contentWidth : 180,
header : true,
@ -318,17 +320,13 @@ define([
this.template = options.template || [
'<div class="box" style="height:' + (_options.height - 85) + 'px;">',
'<div class="content-panel" >',
'<div style="margin-right:15px; display: inline-block; vertical-align: middle;">',
'<label class="input-label">', t.textType, '</label>',
'<div id="id-top10-type-combo" style=""></div>',
'</div>',
'<div style="margin-right:15px; display: inline-block; vertical-align: middle;">',
'<label class="input-label"></label>',
'<div id="id-top10-count-spin" class="input-group-nr" style=""></div>',
'</div>',
'<div style="display: inline-block; vertical-align: middle;">',
'<label class="input-label"></label>',
'<div id="id-top10-item-combo" class="input-group-nr" style=""></div>',
'<label>', t.textType, '</label>',
'<div>',
'<div id="id-top10-type-combo" style="margin-right:10px; display: inline-block; vertical-align: middle;"></div>',
'<div id="id-top10-count-spin" class="input-group-nr" style="margin-right:10px; display: inline-block; vertical-align: middle;"></div>',
'<div id="id-top10-item-combo" class="input-group-nr" style="display: inline-block; vertical-align: middle;"></div>',
'<label id="id-top10-lblby" class="input-group-nr" style="min-width: 40px; text-align: center; display: inline-block; vertical-align: middle;">'+ t.txtBy +'</label>',
'<div id="id-top10-fields-combo" class="input-group-nr" style="width:100px;display: inline-block; vertical-align: middle;"></div>',
'</div>',
'</div>',
'</div>',
@ -358,15 +356,18 @@ define([
});
this.cmbType.setValue(true);
var data = [
{ value: false, displayValue: this.txtItems },
{ value: true, displayValue: this.txtPercent }
];
(this.type=='value') && data.push({ value: 0, displayValue: this.txtSum });
this.cmbItem = new Common.UI.ComboBox({
el : $('#id-top10-item-combo', this.$window),
style : 'width: 85px;',
menuStyle : 'min-width: 85px;',
cls : 'input-group-nr',
data : [
{ value: false, displayValue: this.txtItems },
{ value: true, displayValue: this.txtPercent }
],
data : data,
editable : false
});
this.cmbItem.setValue(false);
@ -384,6 +385,18 @@ define([
minValue: 1
});
this.cmbFields = new Common.UI.ComboBox({
el : $('#id-top10-fields-combo', this.$window),
menuStyle : 'min-width: 100%;max-height: 135px;',
style : 'width:100%;',
cls : 'input-group-nr',
data : [],
scrollAlwaysVisible: true,
editable : false
});
this.cmbFields.setVisible(this.type=='value');
(this.type!=='value') && this.$window.find('#id-top10-lblby').addClass('hidden');
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.loadDefaults();
@ -422,6 +435,23 @@ define([
loadDefaults: function () {
if (this.properties) {
var isTop10Sum = false;
if (this.type == 'value') {
var pivotObj = this.properties.asc_getPivotObj(),
idx = pivotObj.asc_getDataFieldIndexFilter(),
fields = pivotObj.asc_getDataFields();
isTop10Sum = pivotObj.asc_getIsTop10Sum();
this.setTitle(this.txtValueTitle + ' (' + fields[0] + ')');
fields.shift();
var arr = [];
fields && fields.forEach(function (item, index) {
item && arr.push({value: index, displayValue: item});
});
this.cmbFields.setData(arr);
this.cmbFields.setValue((idx!==0) ? idx-1 : 0);
}
var filterObj = this.properties.asc_getFilterObj();
if (filterObj.asc_getType() == Asc.c_oAscAutoFilterTypes.Top10) {
var top10Filter = filterObj.asc_getFilter(),
@ -429,8 +459,8 @@ define([
percent = top10Filter.asc_getPercent();
this.cmbType.setValue(type || type===null);
this.cmbItem.setValue(percent || percent===null);
this.spnCount.setDefaultUnit((percent || percent===null) ? '%' : '');
this.cmbItem.setValue(isTop10Sum ? 0 : (percent || percent===null));
this.spnCount.setDefaultUnit((percent || percent===null) && !isTop10Sum ? '%' : '');
this.spnCount.setValue(top10Filter.asc_getVal());
}
}
@ -444,9 +474,15 @@ define([
var top10Filter = filterObj.asc_getFilter();
top10Filter.asc_setTop(this.cmbType.getValue());
top10Filter.asc_setPercent(this.cmbItem.getValue());
top10Filter.asc_setPercent(this.cmbItem.getValue()===true);
top10Filter.asc_setVal(this.spnCount.getNumberValue());
if (this.type == 'value') {
var pivotObj = this.properties.asc_getPivotObj();
pivotObj.asc_setIsTop10Sum(this.cmbItem.getValue()===0);
pivotObj.asc_setDataFieldIndexFilter((this.type == 'value') ? this.cmbFields.getValue()+1 : 0);
}
this.api.asc_applyAutoFilter(this.properties);
}
},
@ -462,14 +498,449 @@ define([
txtTop : 'Top',
txtBottom : 'Bottom',
txtItems : 'Item',
txtPercent : 'Percent'
txtPercent : 'Percent',
txtValueTitle: 'Top 10 Filter',
txtSum: 'Sum',
txtBy: 'by'
}, SSE.Views.Top10FilterDialog || {}));
SSE.Views.PivotDigitalFilterDialog = Common.UI.Window.extend(_.extend({
initialize: function (options) {
var t = this, _options = {};
_.extend(_options, {
width : 501,
height : 210,
contentWidth : 180,
header : true,
cls : 'filter-dlg',
contentTemplate : '',
title : (options.type=='label') ? t.txtTitleLabel : t.txtTitleValue,
items : []
}, options);
this.api = options.api;
this.handler = options.handler;
this.type = options.type || 'value';
this.template = options.template || [
'<div class="box" style="height:' + (_options.height - 85) + 'px;">',
'<div class="content-panel" >',
'<label class="header">', ((t.type=='label') ? t.textShowLabel : t.textShowValue), '</label>',
'<div style="margin-top:15px;">',
'<div id="id-field-digital-combo" class="input-group-nr" style="vertical-align:middle;width:110px;display:inline-block;margin-right:10px;"></div>',
'<div id="id-cond-digital-combo" class="input-group-nr" style="vertical-align:middle;width:' + ((t.type=='label') ? 225 : 110) + 'px;display:inline-block;margin-right:10px;"></div>',
'<div id="id-input-digital-value1" class="" style="vertical-align: middle; width:225px;display:inline-block;"></div>',
'<label id="id-label-digital-and" style="vertical-align: middle;margin-left: 5px;">'+ this.txtAnd +'</label>',
'<div id="id-input-digital-value2" class="" style="vertical-align: middle; width:100px;display:inline-block;margin-left: 5px;"></div>',
'</div>',
'<div style="margin-top:10px;">',
'<label style="display:block;">' + t.textUse1 + '</label>',
'<label style="display:block;">' + t.textUse2 + '</label>',
'</div>',
'</div>',
'</div>',
'<div class="separator horizontal" style="width:100%"></div>',
'<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok">', t.okButtonText, '</button>',
'<button class="btn normal dlg-btn" result="cancel">', t.cancelButtonText, '</button>',
'</div>'
].join('');
_options.tpl = _.template(this.template)(_options);
Common.UI.Window.prototype.initialize.call(this, _options);
},
render: function () {
Common.UI.Window.prototype.render.call(this);
this.conditions = [
{value: Asc.c_oAscCustomAutoFilter.equals, displayValue: this.capCondition1},
{value: Asc.c_oAscCustomAutoFilter.doesNotEqual, displayValue: this.capCondition2},
{value: Asc.c_oAscCustomAutoFilter.isGreaterThan, displayValue: this.capCondition3},
{value: Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo, displayValue: this.capCondition4},
{value: Asc.c_oAscCustomAutoFilter.isLessThan, displayValue: this.capCondition5},
{value: Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo, displayValue: this.capCondition6},
{value: -2, displayValue: this.capCondition13},
{value: -3, displayValue: this.capCondition14}
];
if (this.type=='label') this.conditions = this.conditions.concat([
{value: Asc.c_oAscCustomAutoFilter.beginsWith, displayValue: this.capCondition7},
{value: Asc.c_oAscCustomAutoFilter.doesNotBeginWith, displayValue: this.capCondition8},
{value: Asc.c_oAscCustomAutoFilter.endsWith, displayValue: this.capCondition9},
{value: Asc.c_oAscCustomAutoFilter.doesNotEndWith, displayValue: this.capCondition10},
{value: Asc.c_oAscCustomAutoFilter.contains, displayValue: this.capCondition11},
{value: Asc.c_oAscCustomAutoFilter.doesNotContain, displayValue: this.capCondition12}
]);
this.cmbCondition1 = new Common.UI.ComboBox({
el : $('#id-cond-digital-combo', this.$window),
menuStyle : 'min-width: 100%;max-height: 135px;',
style : 'width:100%;',
cls : 'input-group-nr',
data : this.conditions,
scrollAlwaysVisible: true,
editable : false
});
this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals);
this.cmbCondition1.on('selected', _.bind(function(combo, record) {
var isBetween = record.value == -2 || record.value == -3;
this.inputValue2.setVisible(isBetween);
this.lblAnd.toggleClass('hidden', !isBetween);
this.inputValue.$el.width(isBetween ? 100 : 225);
var me = this;
_.defer(function () {
if (me.inputValue) {
me.inputValue._input.focus();
}
}, 10);
}, this));
this.cmbFields = new Common.UI.ComboBox({
el : $('#id-field-digital-combo', this.$window),
menuStyle : 'min-width: 100%;max-height: 135px;',
style : 'width:100%;',
cls : 'input-group-nr',
data : [],
scrollAlwaysVisible: true,
editable : false
});
this.cmbFields.setVisible(this.type=='value');
this.cmbFields.on('selected', _.bind(function(combo, record) {
var me = this;
_.defer(function () {
if (me.inputValue) {
me.inputValue._input.focus();
}
}, 10);
}, this));
this.inputValue = new Common.UI.InputField({
el : $('#id-input-digital-value1'),
allowBlank : false,
style : 'width: 100%;',
validateOnBlur: false
});
this.inputValue2 = new Common.UI.InputField({
el : $('#id-input-digital-value2'),
allowBlank : false,
style : 'width: 100%;',
validateOnBlur: false
});
this.lblAnd = this.$window.find('#id-label-digital-and');
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.loadDefaults();
},
show: function () {
Common.UI.Window.prototype.show.call(this);
var me = this;
_.defer(function () {
if (me.inputValue) {
me.inputValue._input.focus();
}
}, 500);
},
close: function () {
if (this.api) {
this.api.asc_enableKeyEvents(true);
}
Common.UI.Window.prototype.close.call(this);
},
onBtnClick: function (event) {
if (event.currentTarget.attributes && event.currentTarget.attributes.result) {
if ('ok' === event.currentTarget.attributes.result.value) {
this.save();
}
this.close();
}
},
setSettings: function (properties) {
this.properties = properties;
},
loadDefaults: function () {
if (this.properties && this.cmbCondition1 && this.cmbFields && this.inputValue) {
var pivotObj = this.properties.asc_getPivotObj(),
idx = pivotObj.asc_getDataFieldIndexFilter(),
fields = pivotObj.asc_getDataFields();
this.setTitle(this.options.title + ' (' + fields[0] + ')');
if (this.type == 'value') {
fields.shift();
var arr = [];
fields && fields.forEach(function (item, index) {
item && arr.push({value: index, displayValue: item});
});
this.cmbFields.setData(arr);
this.cmbFields.setValue((idx!==0) ? idx-1 : 0);
}
var filterObj = this.properties.asc_getFilterObj();
if (filterObj.asc_getType() == Asc.c_oAscAutoFilterTypes.CustomFilters) {
var customFilter = filterObj.asc_getFilter(),
customFilters = customFilter.asc_getCustomFilters(),
value = customFilters[0].asc_getOperator();
if ((customFilters.length>1)) {
var isAnd = customFilter.asc_getAnd();
var isBetween = (customFilters[0].asc_getOperator() == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && customFilters[1].asc_getOperator() == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo),
isNotBetween = (customFilters[0].asc_getOperator() == Asc.c_oAscCustomAutoFilter.isLessThan && customFilters[1].asc_getOperator() == Asc.c_oAscCustomAutoFilter.isGreaterThan);
if (isAnd && isBetween)
value = -2;
else if (!isAnd && isNotBetween)
value = -3;
}
this.cmbCondition1.setValue(value || Asc.c_oAscCustomAutoFilter.equals);
this.inputValue.setValue(null === customFilters[0].asc_getVal() ? '' : customFilters[0].asc_getVal());
this.inputValue.$el.width((value==-2 || value==-3) ? 100 : 225);
this.lblAnd.toggleClass('hidden', !(value==-2 || value==-3));
this.inputValue2.setVisible(value==-2 || value==-3);
this.inputValue2.setValue((customFilters.length>1) ? (null === customFilters[1].asc_getVal() ? '' : customFilters[1].asc_getVal()) : '');
}
}
},
save: function () {
if (this.api && this.properties && this.cmbCondition1 && this.cmbFields && this.inputValue) {
var filterObj = this.properties.asc_getFilterObj();
filterObj.asc_setFilter(new Asc.CustomFilters());
filterObj.asc_setType(Asc.c_oAscAutoFilterTypes.CustomFilters);
var customFilter = filterObj.asc_getFilter(),
type = this.cmbCondition1.getValue();
if (type==-2) {
customFilter.asc_setCustomFilters([new Asc.CustomFilter(), new Asc.CustomFilter()]);
customFilter.asc_setAnd(true);
var customFilters = customFilter.asc_getCustomFilters();
customFilters[0].asc_setOperator(Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo);
customFilters[0].asc_setVal(this.inputValue.getValue());
customFilters[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo);
customFilters[1].asc_setVal(this.inputValue2.getValue());
} else if (type==-3) {
customFilter.asc_setCustomFilters([new Asc.CustomFilter(), new Asc.CustomFilter()]);
customFilter.asc_setAnd(false);
var customFilters = customFilter.asc_getCustomFilters();
customFilters[0].asc_setOperator(Asc.c_oAscCustomAutoFilter.isLessThan);
customFilters[0].asc_setVal(this.inputValue.getValue());
customFilters[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isGreaterThan);
customFilters[1].asc_setVal(this.inputValue2.getValue());
} else {
customFilter.asc_setCustomFilters([new Asc.CustomFilter()]);
customFilter.asc_setAnd(true);
var customFilters = customFilter.asc_getCustomFilters();
customFilters[0].asc_setOperator(this.cmbCondition1.getValue());
customFilters[0].asc_setVal(this.inputValue.getValue());
}
var pivotObj = this.properties.asc_getPivotObj();
pivotObj.asc_setDataFieldIndexFilter((this.type == 'value') ? this.cmbFields.getValue()+1 : 0);
this.api.asc_applyAutoFilter(this.properties);
}
},
onPrimary: function() {
this.save();
this.close();
return false;
},
capCondition1 : "equals",
capCondition10 : "does not end with",
capCondition11 : "contains",
capCondition12 : "does not contain",
capCondition2 : "does not equal",
capCondition3 : "is greater than",
capCondition4 : "is greater than or equal to",
capCondition5 : "is less than",
capCondition6 : "is less than or equal to",
capCondition7 : "begins with",
capCondition8 : "does not begin with",
capCondition9 : "ends with",
textShowLabel : "Show items for which the label:",
textShowValue : "Show items for which:",
textUse1 : "Use ? to present any single character",
textUse2 : "Use * to present any series of character",
txtTitleValue: 'Value Filter',
txtTitleLabel: 'Label Filter',
capCondition13: 'between',
capCondition14: 'not between',
txtAnd: 'and'
}, SSE.Views.PivotDigitalFilterDialog || {}));
SSE.Views.SortFilterDialog = Common.UI.Window.extend(_.extend({
initialize: function (options) {
var t = this, _options = {};
this.type = options.type;
_.extend(_options, {
width : 215,
height : 215,
contentWidth : 180,
header : true,
cls : 'filter-dlg',
contentTemplate : '',
title : t.txtTitle,
items : [],
buttons: ['ok', 'cancel']
}, options);
this.template = options.template || [
'<div class="box" style="height:' + (_options.height - 85) + 'px;">',
'<div class="content-panel" >',
'<div id="id-sort-filter-radio-asc" style="margin-bottom: 4px;"></div>',
'<div id="id-sort-filter-fields-asc" class="input-group-nr" style="width:150px;margin-bottom: 10px;margin-left: 22px;"></div>',
'<div id="id-sort-filter-radio-desc" style="margin-bottom: 4px;"></div>',
'<div id="id-sort-filter-fields-desc" class="input-group-nr" style="width:150px;margin-left: 22px;"></div>',
'</div>',
'</div>',
'<div class="separator horizontal" style="width:100%"></div>'
].join('');
this.api = options.api;
this.handler = options.handler;
_options.tpl = _.template(this.template)(_options);
Common.UI.Window.prototype.initialize.call(this, _options);
},
render: function () {
Common.UI.Window.prototype.render.call(this);
this.radioAsc = new Common.UI.RadioBox({
el: $('#id-sort-filter-radio-asc'),
labelText: this.textAsc,
name: 'asc-radio-sort',
checked: true
});
this.radioAsc.on('change', _.bind(function(field, newValue) {
newValue && this.cmbFieldsAsc.setDisabled(false);
newValue && this.cmbFieldsDesc.setDisabled(true);
}, this));
this.radioDesc = new Common.UI.RadioBox({
el: $('#id-sort-filter-radio-desc'),
labelText: this.textDesc,
name: 'asc-radio-sort'
});
this.radioDesc.on('change', _.bind(function(field, newValue) {
newValue && this.cmbFieldsAsc.setDisabled(true);
newValue && this.cmbFieldsDesc.setDisabled(false);
}, this));
this.cmbFieldsAsc = new Common.UI.ComboBox({
el : $('#id-sort-filter-fields-asc', this.$window),
menuStyle : 'min-width: 100%;max-height: 135px;',
style : 'width:100%;',
cls : 'input-group-nr',
data : [],
scrollAlwaysVisible: true,
editable : false
});
this.cmbFieldsDesc = new Common.UI.ComboBox({
el : $('#id-sort-filter-fields-desc', this.$window),
menuStyle : 'min-width: 100%;max-height: 135px;',
style : 'width:100%;',
cls : 'input-group-nr',
data : [],
scrollAlwaysVisible: true,
editable : false,
disabled: true
});
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.loadDefaults();
},
show: function () {
Common.UI.Window.prototype.show.call(this);
},
close: function () {
if (this.api) {
this.api.asc_enableKeyEvents(true);
}
Common.UI.Window.prototype.close.call(this);
},
onBtnClick: function (event) {
if (event.currentTarget.attributes && event.currentTarget.attributes.result) {
if ('ok' === event.currentTarget.attributes.result.value) {
this.save();
}
this.close();
}
},
setSettings: function (properties) {
this.properties = properties;
},
loadDefaults: function () {
if (this.properties) {
var pivotObj = this.properties.asc_getPivotObj(),
idx = pivotObj.asc_getDataFieldIndexSorting(),
fields = pivotObj.asc_getDataFields(),
sort = this.properties.asc_getSortState();
this.setTitle(this.txtTitle + ' (' + fields[0] + ')');
var arr = [];
fields && fields.forEach(function (item, index) {
item && arr.push({value: index, displayValue: item});
});
this.cmbFieldsAsc.setData(arr);
this.cmbFieldsAsc.setValue((idx>=0) ? idx : 0);
this.cmbFieldsDesc.setData(arr);
this.cmbFieldsDesc.setValue((idx>=0) ? idx : 0);
this.radioDesc.setValue(sort == Asc.c_oAscSortOptions.Descending, true);
this.cmbFieldsDesc.setDisabled(sort !== Asc.c_oAscSortOptions.Descending);
}
},
save: function () {
if (this.api && this.properties) {
var combo = this.radioAsc.getValue() ? this.cmbFieldsAsc : this.cmbFieldsDesc;
var pivotObj = this.properties.asc_getPivotObj();
pivotObj.asc_setDataFieldIndexSorting(combo.getValue());
this.properties.asc_setSortState(this.radioAsc.getValue() ? Asc.c_oAscSortOptions.Ascending : Asc.c_oAscSortOptions.Descending);
this.api.asc_applyAutoFilter(this.properties);
}
},
onPrimary: function() {
this.save();
this.close();
return false;
},
txtTitle: "Sort",
textAsc: 'Ascenging (A to Z) by',
textDesc: 'Descending (Z to A) by'
}, SSE.Views.SortFilterDialog || {}));
SSE.Views.AutoFilterDialog = Common.UI.Window.extend(_.extend({
initialize: function (options) {
var t = this, _options = {}, width = undefined, height = undefined;
var t = this, _options = {}, width = 450, height = undefined;
if (Common.Utils.InternalSettings.get('sse-settings-size-filter-window')) {
width = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[0];
height = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[1];
@ -505,7 +976,7 @@ define([
'<button class="btn normal dlg-btn" result="cancel">', t.cancelButtonText, '</button>',
'</div>',
'</div>',
'<div class="menu-panel" style="width: 195px; float: right;">',
'<div class="menu-panel" style="float: right;">',
'<div id="menu-container-filters" style=""><div class="dropdown-toggle" data-toggle="dropdown"></div></div>',
'</div>',
'</div>'
@ -567,6 +1038,11 @@ define([
});
this.miSortHigh2Low.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
this.miSortOptions = new Common.UI.MenuItem({
caption : this.txtSortOption
});
this.miSortOptions.on('click', _.bind(this.onSortOptions, this));
this.miSortCellColor = new Common.UI.MenuItem({
caption : this.txtSortCellColor,
toggleGroup : 'menufiltersort',
@ -685,19 +1161,75 @@ define([
});
this.miReapply.on('click', _.bind(this.onReapply, this));
this.miReapplySeparator = new Common.UI.MenuItem({ caption: '--' });
// pivot
this.miValueFilter = new Common.UI.MenuItem({
caption : this.txtValueFilter,
toggleGroup : 'menufilterfilter',
checkable : true,
checked : false,
menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items: [
{value: Asc.c_oAscCustomAutoFilter.equals, caption: this.txtEquals, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: Asc.c_oAscCustomAutoFilter.doesNotEqual, caption: this.txtNotEquals, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: Asc.c_oAscCustomAutoFilter.isGreaterThan, caption: this.txtGreater, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo, caption: this.txtGreaterEquals,checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: Asc.c_oAscCustomAutoFilter.isLessThan, caption: this.txtLess, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo, caption: this.txtLessEquals, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: -2, caption: this.txtBetween, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: -3, caption: this.txtNotBetween, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'value'},
{value: Asc.c_oAscCustomAutoFilter.top10, caption: this.txtTop10, checkable: true, type: Asc.c_oAscAutoFilterTypes.Top10, pivottype: 'value'}
]
})
});
this.miValueFilter.menu.on('item:click', _.bind(this.onValueFilterMenuClick, this));
this.miLabelFilter = new Common.UI.MenuItem({
caption : this.txtLabelFilter,
toggleGroup : 'menufilterfilter',
checkable : true,
checked : false,
menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items: [
{value: Asc.c_oAscCustomAutoFilter.equals, caption: this.txtEquals, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.doesNotEqual, caption: this.txtNotEquals, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.beginsWith, caption: this.txtBegins, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.doesNotBeginWith, caption: this.txtNotBegins, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.endsWith, caption: this.txtEnds, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.doesNotEndWith, caption: this.txtNotEnds, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.contains, caption: this.txtContains, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.doesNotContain, caption: this.txtNotContains, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{caption: '--'},
{value: Asc.c_oAscCustomAutoFilter.isGreaterThan, caption: this.txtGreater, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo, caption: this.txtGreaterEquals,checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.isLessThan, caption: this.txtLess, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo, caption: this.txtLessEquals, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: -2, caption: this.txtBetween, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'},
{value: -3, caption: this.txtNotBetween, checkable: true, type: Asc.c_oAscAutoFilterTypes.CustomFilters, pivottype: 'label'}
]
})
});
this.miLabelFilter.menu.on('item:click', _.bind(this.onLabelFilterMenuClick, this));
this.filtersMenu = new Common.UI.Menu({
items: [
this.miSortLow2High,
this.miSortHigh2Low,
this.miSortOptions,
this.miSortCellColor,
this.miSortFontColor,
{caption : '--'},
this.miLabelFilter,
this.miValueFilter,
this.miNumFilter,
this.miTextFilter,
this.miFilterCellColor,
this.miFilterFontColor,
this.miClear,
{caption : '--'},
this.miReapplySeparator,
this.miReapply
]
});
@ -847,6 +1379,19 @@ define([
this.close();
},
onSortOptions: function () {
var me = this,
dlgSort = new SSE.Views.SortFilterDialog({api:this.api}).on({
'close': function() {
me.close();
}
});
this.close();
dlgSort.setSettings(this.configTo);
dlgSort.show();
},
onNumCustomFilterItemClick: function(item) {
var filterObj = this.configTo.asc_getFilterObj(),
value1 = '', value2 = '',
@ -866,10 +1411,10 @@ define([
if (item.value!==-1) {
var newCustomFilter = new Asc.CustomFilters();
newCustomFilter.asc_setCustomFilters((item.value == -2) ? [new Asc.CustomFilter(), new Asc.CustomFilter()]: [new Asc.CustomFilter()]);
newCustomFilter.asc_setCustomFilters((item.value == -2 || item.value == -3) ? [new Asc.CustomFilter(), new Asc.CustomFilter()]: [new Asc.CustomFilter()]);
var newCustomFilters = newCustomFilter.asc_getCustomFilters();
newCustomFilters[0].asc_setOperator((item.value == -2) ? Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo : item.value);
newCustomFilters[0].asc_setOperator((item.value == -2) ? Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo : ((item.value == -3) ? Asc.c_oAscCustomAutoFilter.isLessThan : item.value));
if (item.value == -2) {
var isBetween = (cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo);
@ -877,6 +1422,12 @@ define([
newCustomFilters[0].asc_setVal(isBetween ? value1 : '');
newCustomFilters[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo);
newCustomFilters[1].asc_setVal(isBetween ? value2 : '');
} else if (item.value == -3) {
var isNotBetween = (cond1 == Asc.c_oAscCustomAutoFilter.isLessThan && cond2 == Asc.c_oAscCustomAutoFilter.isGreaterThan);
newCustomFilter.asc_setAnd(isNotBetween ? isAnd : false);
newCustomFilters[0].asc_setVal(isNotBetween ? value1 : '');
newCustomFilters[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isGreaterThan);
newCustomFilters[1].asc_setVal(isNotBetween ? value2 : '');
} else {
newCustomFilter.asc_setAnd(true);
newCustomFilters[0].asc_setVal((item.value == cond1) ? value1 : '');
@ -887,6 +1438,14 @@ define([
}
var me = this,
dlgDigitalFilter;
if (item.options.pivottype == 'label' || item.options.pivottype == 'value')
dlgDigitalFilter = new SSE.Views.PivotDigitalFilterDialog({api:this.api, type: item.options.pivottype}).on({
'close': function() {
me.close();
}
});
else
dlgDigitalFilter = new SSE.Views.DigitalFilterDialog({api:this.api, type: 'number'}).on({
'close': function() {
me.close();
@ -930,12 +1489,19 @@ define([
}
var me = this,
dlgDigitalFilter;
if (item.options.pivottype == 'label' || item.options.pivottype == 'value')
dlgDigitalFilter = new SSE.Views.PivotDigitalFilterDialog({api:this.api, type: item.options.pivottype}).on({
'close': function() {
me.close();
}
});
else
dlgDigitalFilter = new SSE.Views.DigitalFilterDialog({api:this.api, type: 'text'}).on({
'close': function() {
me.close();
}
});
this.close();
dlgDigitalFilter.setSettings(this.configTo);
@ -956,9 +1522,9 @@ define([
this.close();
},
onTop10FilterItemClick: function(menu, item) {
onTop10FilterItemClick: function(item) {
var me = this,
dlgTop10Filter = new SSE.Views.Top10FilterDialog({api:this.api}).on({
dlgTop10Filter = new SSE.Views.Top10FilterDialog({api:this.api, type: item.options.pivottype}).on({
'close': function() {
me.close();
}
@ -969,6 +1535,35 @@ define([
dlgTop10Filter.show();
},
onLabelFilterMenuClick: function(menu, item) {
if (item.value == Asc.c_oAscCustomAutoFilter.isGreaterThan || item.value == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo || item.value == Asc.c_oAscCustomAutoFilter.isLessThan ||
item.value == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo || item.value == -2 || item.value == -3)
this.onNumCustomFilterItemClick(item);
else
this.onTextFilterMenuClick(menu, item);
},
onValueFilterMenuClick: function(menu, item) {
var me = this;
var pivotObj = this.configTo.asc_getPivotObj(),
fields = pivotObj.asc_getDataFields();
if (fields.length<2) {
Common.UI.warning({title: this.textWarning,
msg: this.warnFilterError,
callback: function() {
_.delay(function () {
me.close();
}, 10);
}
});
} else {
if (item.options.type == Asc.c_oAscAutoFilterTypes.CustomFilters)
this.onNumCustomFilterItemClick(item);
else
this.onTop10FilterItemClick(item);
}
},
onFilterColorSelect: function(isCellColor, picker, color) {
var filterObj = this.configTo.asc_getFilterObj();
if (filterObj.asc_getType() !== Asc.c_oAscAutoFilterTypes.ColorFilter) {
@ -1098,6 +1693,34 @@ define([
_setDefaults: function() {
this.initialFilterType = this.configTo.asc_getFilterObj().asc_getType();
var menuPanel = this.$window.find('.menu-panel');
this.menuPanelWidth = menuPanel.innerWidth();
var width = this.getWidth();
if (Common.Utils.InternalSettings.get('sse-settings-size-filter-window')) {
width = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[0] + this.menuPanelWidth;
}
var pivotObj = this.configTo.asc_getPivotObj(),
isPivot = !!pivotObj,
isValueFilter = false;
this.miValueFilter.setVisible(isPivot);
this.miLabelFilter.setVisible(isPivot);
this.miSortOptions.setVisible(isPivot);
if (isPivot) {
if (pivotObj.asc_getIsPageFilter()) {
this.setResizable(true, [this.initConfig.minwidth - this.menuPanelWidth, this.initConfig.minheight]);
menuPanel.addClass('hidden');
width -= this.menuPanelWidth;
this.menuPanelWidth = 0;
}
this.miReapplySeparator.setVisible(false);
this.miReapply.setVisible(false);
isValueFilter = (pivotObj.asc_getDataFieldIndexFilter()!==0);
}
this.setSize(width, this.getHeight());
var filterObj = this.configTo.asc_getFilterObj(),
isCustomFilter = (this.initialFilterType === Asc.c_oAscAutoFilterTypes.CustomFilters),
@ -1111,17 +1734,20 @@ define([
if (sortColor) sortColor = Common.Utils.ThemeColor.getHexColor(sortColor.get_r(), sortColor.get_g(), sortColor.get_b()).toLocaleUpperCase();
this.miTextFilter.setVisible(isTextFilter);
this.miNumFilter.setVisible(!isTextFilter);
this.miTextFilter.setVisible(!isPivot && isTextFilter);
this.miNumFilter.setVisible(!isPivot && !isTextFilter);
this.miTextFilter.setChecked(isCustomFilter && isTextFilter, true);
this.miNumFilter.setChecked((isCustomFilter || isDynamicFilter || isTop10) && !isTextFilter, true);
this.miValueFilter.setChecked(isPivot && isValueFilter, true);
this.miLabelFilter.setChecked(isPivot && !isValueFilter && (isCustomFilter || isTop10), true);
this.miSortLow2High.setChecked(sort == Asc.c_oAscSortOptions.Ascending, true);
this.miSortHigh2Low.setChecked(sort == Asc.c_oAscSortOptions.Descending, true);
var hasColors = (colorsFont && colorsFont.length>0);
this.miSortFontColor.setVisible(hasColors);
this.miFilterFontColor.setVisible(hasColors);
this.miFilterFontColor.setVisible(!isPivot && hasColors);
if (hasColors) {
var colors = [];
colorsFont.forEach(function(item, index) {
@ -1141,7 +1767,7 @@ define([
hasColors = (colorsFill && colorsFill.length>0);
this.miSortCellColor.setVisible(hasColors);
this.miFilterCellColor.setVisible(hasColors);
this.miFilterCellColor.setVisible(!isPivot && hasColors);
if (hasColors) {
var colors = [];
colorsFill.forEach(function(item, index) {
@ -1165,7 +1791,7 @@ define([
isAnd = (customFilter.asc_getAnd()),
cond1 = customFilters[0].asc_getOperator(),
cond2 = ((customFilters.length>1) ? (customFilters[1].asc_getOperator() || 0) : 0),
items = (isTextFilter) ? this.miTextFilter.menu.items : this.miNumFilter.menu.items,
items = isPivot ? (isValueFilter ? this.miValueFilter.menu.items : this.miLabelFilter.menu.items) : ((isTextFilter) ? this.miTextFilter.menu.items : this.miNumFilter.menu.items),
isCustomConditions = true;
if (customFilters.length==1)
@ -1174,7 +1800,7 @@ define([
item.setChecked(checked, true);
if (checked) isCustomConditions = false;
});
else if (!isTextFilter && (cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo ||
else if ((isPivot || !isTextFilter) && (cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo ||
cond1 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo)){
items[6].setChecked(true, true); // between filter
isCustomConditions = false;
@ -1195,7 +1821,7 @@ define([
}
} else if (isDynamicFilter || isTop10) {
var dynType = (isDynamicFilter) ? filterObj.asc_getFilter().asc_getType() : null,
items = this.miNumFilter.menu.items;
items = isPivot ? this.miValueFilter.menu.items : this.miNumFilter.menu.items;
items.forEach(function(item){
item.setChecked(isDynamicFilter && (item.options.type == Asc.c_oAscAutoFilterTypes.DynamicFilter) && (item.value == dynType) ||
isTop10 && (item.options.type == Asc.c_oAscAutoFilterTypes.Top10), true);
@ -1360,6 +1986,9 @@ define([
isValid = true;
}
if (isValid) {
var pivotObj = this.configTo.asc_getPivotObj();
if (pivotObj && pivotObj.asc_getIsPageFilter())
pivotObj.asc_setIsMultipleItemSelectionAllowed(true);
this.configTo.asc_getFilterObj().asc_setType(Asc.c_oAscAutoFilterTypes.Filters);
this.api.asc_applyAutoFilter(this.configTo);
}
@ -1394,6 +2023,7 @@ define([
this.$window.find('.combo-values').css({'height': size[1] - 100 + 'px'});
this.curSize.height = size[1];
}
size[0] -= this.menuPanelWidth;
Common.Utils.InternalSettings.set('sse-settings-size-filter-window', size);
},
@ -1438,7 +2068,12 @@ define([
txtContains : "Contains...",
txtNotContains : "Does not contain...",
textSelectAllResults: 'Select All Search Results',
textAddSelection : 'Add current selection to filter'
textAddSelection : 'Add current selection to filter',
txtValueFilter: 'Value filter',
txtLabelFilter: 'Label filter',
warnFilterError: 'You need at least one field in the Values area in order to apply a value filter.',
txtNotBetween: 'Not between...',
txtSortOption: 'More sort options...'
}, SSE.Views.AutoFilterDialog || {}));
});

View file

@ -0,0 +1,565 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* ChartDataDialog.js
*
* Created by Julia Radzhabova on 06.07.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
define([
'common/main/lib/util/utils',
'common/main/lib/component/MetricSpinner',
'common/main/lib/component/ComboBox',
'common/main/lib/component/ListView',
'common/main/lib/view/AdvancedSettingsWindow'
], function () { 'use strict';
SSE.Views.ChartDataDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
options: {
contentWidth: 370,
height: 490
},
initialize : function(options) {
var me = this;
_.extend(this.options, {
title: this.textTitle,
template: [
'<div class="box" style="height:' + (me.options.height - 85) + 'px;">',
'<div class="content-panel" style="padding: 0 10px;"><div class="inner-content">',
'<div class="settings-panel active">',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td>',
'<label class="input-label">', me.textData, '</label>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small" width="200">',
'<div id="chart-dlg-txt-range" class="input-row" style=""></div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small">',
'<label class="input-label">', me.textSeries, '</label>',
'<div id="chart-dlg-series-list" class="" style="width:100%; height: 93px;"></div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-large">',
'<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-add" style="min-width: 70px;margin-right:5px;">', me.textAdd, '</button>',
'<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-edit" style="min-width: 70px;margin-right:5px;">', me.textEdit, '</button>',
'<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-delete" style="min-width: 70px;margin-right:5px;">', me.textDelete, '</button>',
'<div style="display: inline-block; float: right;">',
'<div id="chart-dlg-btn-up" style="display: inline-block;border: 1px solid #cfcfcf;border-radius: 1px;margin-right: 2px;"></div>',
'<div id="chart-dlg-btn-down" style="display: inline-block;border: 1px solid #cfcfcf;border-radius: 1px;"></div>',
'</div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-large">',
'<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-switch" style="min-width: 70px;margin-right:5px;">', me.textSwitch, '</button>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small">',
'<label class="input-label">', me.textCategory, '</label>',
'<div id="chart-dlg-category-list" class="" style="width:100%; height: 93px;"></div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small">',
'<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-category-edit" style="min-width: 70px;margin-right:5px;">', me.textEdit, '</button>',
'</td>',
'</tr>',
'</table>',
'</div></div>',
'</div>',
'</div>',
'<div class="separator horizontal"></div>'
].join('')
}, options);
this.handler = options.handler;
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
this._noApply = true;
this._changedProps = null;
this.api = this.options.api;
this.chartSettings = this.options.chartSettings;
this.currentChartType = Asc.c_oAscChartTypeSettings.barNormal;
},
render: function() {
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
var me = this;
this.txtDataRange = new Common.UI.InputFieldBtn({
el : $('#chart-dlg-txt-range'),
name : 'range',
style : 'width: 100%;',
btnHint : this.textSelectData,
allowBlank : true
// validateOnChange: true
});
this.txtDataRange.on('button:click', _.bind(this.onSelectData, this));
this.txtDataRange.on('changed:after', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
me.changeChartRange(newValue);
});
// Chart data
this.seriesList = new Common.UI.ListView({
el: $('#chart-dlg-series-list', this.$window),
store: new Common.UI.DataViewStore(),
emptyText: '',
scrollAlwaysVisible: true,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="min-height: 15px;"><%= value %></div>')
});
this.seriesList.onKeyDown = _.bind(this.onListKeyDown, this, 'series');
this.seriesList.on('item:select', _.bind(this.onSelectSeries, this));
this.seriesList.store.comparator = function(rec) {
return rec.get("order");
};
this.btnAdd = new Common.UI.Button({
el: $('#chart-dlg-btn-add')
});
this.btnAdd.on('click', _.bind(this.onAddSeries, this, false));
this.btnDelete = new Common.UI.Button({
el: $('#chart-dlg-btn-delete')
});
this.btnDelete.on('click', _.bind(this.onDeleteSeries, this));
this.btnEdit = new Common.UI.Button({
el: $('#chart-dlg-btn-edit')
});
this.btnEdit.on('click', _.bind(this.onEditSeries, this, false));
this.btnUp = new Common.UI.Button({
parentEl: $('#chart-dlg-btn-up'),
cls: 'btn-toolbar',
iconCls: 'caret-up',
hint: this.textUp
});
this.btnUp.on('click', _.bind(this.onMoveClick, this, true));
this.btnDown = new Common.UI.Button({
parentEl: $('#chart-dlg-btn-down'),
cls: 'btn-toolbar',
iconCls: 'caret-down',
hint: this.textDown
});
this.btnDown.on('click', _.bind(this.onMoveClick, this, false));
this.btnSwitch = new Common.UI.Button({
el: $('#chart-dlg-btn-switch')
});
this.btnSwitch.on('click', _.bind(this.onSwitch, this));
this.categoryList = new Common.UI.ListView({
el: $('#chart-dlg-category-list', this.$window),
store: new Common.UI.DataViewStore(),
emptyText: '',
scrollAlwaysVisible: true,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="min-height: 15px;"><%= value %></div>')
});
this.btnEditCategory = new Common.UI.Button({
el: $('#chart-dlg-btn-category-edit')
});
this.btnEditCategory.on('click', _.bind(this.onEditCategory, this, false));
this.afterRender();
},
afterRender: function() {
this._setDefaults(this.chartSettings);
},
show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.txtDataRange.cmpEl.find('input').focus();
},50);
},
close: function () {
this.api.asc_onCloseChartFrame();
Common.Views.AdvancedSettingsWindow.prototype.close.apply(this, arguments);
},
_setDefaults: function (props) {
var me = this;
if (props ){
this.chartSettings = props;
this.currentChartType = props.getType();
var value = props.getRange();
this.txtDataRange.setValue((value) ? value : '');
this.txtDataRange.validation = function(value) {
return true;
};
this.updateSeriesList(props.getSeries(), 0);
this.updateCategoryList(props.getCatValues());
}
this.updateButtons();
},
getSettings: function () {
return { chartSettings: this.chartSettings};
},
onDlgBtnClick: function(event) {
var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
if (state == 'ok') {
if (!this.isRangeValid()) return;
this.handler && this.handler.call(this, state, (state == 'ok') ? this.getSettings() : undefined);
}
this.close();
},
onPrimary: function() {
this.onDlgBtnClick('ok');
return false;
},
isRangeValid: function() {
var isvalid;
isvalid = this.chartSettings.isValidRange(this.txtDataRange.getValue());
if (isvalid === true || isvalid == Asc.c_oAscError.ID.No)
return true;
var error = this.textInvalidRange;
switch (isvalid) {
case Asc.c_oAscError.ID.StockChartError:
error = this.errorStockChart;
break;
case Asc.c_oAscError.ID.MaxDataSeriesError:
error = this.errorMaxRows;
break;
case Asc.c_oAscError.ID.MaxDataPointsError:
error = this.errorMaxPoints;
break;
case Asc.c_oAscError.ID.ErrorInFormula:
error = this.errorInFormula;
break;
case Asc.c_oAscError.ID.InvalidReference:
error = this.errorInvalidReference;
break;
case Asc.c_oAscError.ID.NoSingleRowCol:
error = this.errorNoSingleRowCol;
break;
case Asc.c_oAscError.ID.NoValues:
error = this.errorNoValues;
break;
}
Common.UI.warning({msg: error, maxwidth: 600});
return false;
},
changeChartRange: function(settings) {
var me = this;
if (me.isRangeValid(settings)) {
me.txtDataRange.checkValidate();
me.chartSettings.setRange(settings);
me.updateSeriesList(me.chartSettings.getSeries(), 0);
me.updateCategoryList(me.chartSettings.getCatValues());
me.updateButtons();
}
},
onSelectData: function(input) {
var me = this;
if (me.api) {
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
input.setValue(dlg.getSettings());
_.delay(function(){
me.changeChartRange(dlg.getSettings());
},10);
}
};
var win = new SSE.Views.CellRangeDialog({
handler: handlerDlg
}).on('close', function() {
me.show();
});
var xy = me.$window.offset();
me.hide();
win.show(xy.left + 160, xy.top + 125);
win.setSettings({
api : me.api,
range : me.txtDataRange.getValue(),
type : Asc.c_oAscSelectionDialogType.Chart,
validation: function() {return true;}
});
}
},
onListKeyDown: function (type, e, data) {
var record = null, listView = this.seriesList;
if (listView.disabled) return;
if (_.isUndefined(undefined)) data = e;
if (data.keyCode==Common.UI.Keys.DELETE && !this.btnDelete.isDisabled()) {
// this.onDeleteSeries();
} else {
Common.UI.DataView.prototype.onKeyDown.call(listView, e, data);
}
},
onSelectSeries: function(lisvView, itemView, record) {
this.updateMoveButtons();
},
updateRange: function() {
this.txtDataRange.setValue(this.chartSettings.getRange() || '');
},
updateButtons: function() {
this.btnEdit.setDisabled(this.seriesList.store.length<1);
this.btnDelete.setDisabled(this.seriesList.store.length<1);
this.btnSwitch.setDisabled(this.seriesList.store.length<1 || !this.chartSettings.getRange());
this.updateMoveButtons();
},
updateMoveButtons: function() {
var rec = this.seriesList.getSelectedRec(),
index = rec ? this.seriesList.store.indexOf(rec) : -1;
this.btnUp.setDisabled(index<1);
this.btnDown.setDisabled(index<0 || index==this.seriesList.store.length-1);
},
onAddSeries: function() {
var rec = (this.seriesList.store.length>0) ? this.seriesList.store.at(this.seriesList.store.length-1) : null,
isScatter = false,
me = this;
rec && (isScatter = rec.get('series').asc_IsScatter());
me.chartSettings.startEditData();
var series;
if (isScatter) {
series = me.chartSettings.addScatterSeries();
} else {
series = me.chartSettings.addSeries();
}
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
me.updateRange();
me.updateSeriesList(me.chartSettings.getSeries(), me.seriesList.store.length-1);
me.updateCategoryList(me.chartSettings.getCatValues());
me.updateButtons();
me.chartSettings.endEditData();
me._isEditRanges = false;
}
};
this.changeDataRange(1, {series: series, isScatter: isScatter}, handlerDlg);
},
onDeleteSeries: function() {
var rec = this.seriesList.getSelectedRec();
if (rec) {
var order = rec.get('order');
rec.get('series').asc_Remove();
this.updateRange();
this.updateSeriesList(this.chartSettings.getSeries(), order);
this.updateCategoryList(this.chartSettings.getCatValues());
this.updateButtons();
}
},
onEditSeries: function() {
var rec = this.seriesList.getSelectedRec();
if (rec) {
var series = rec.get('series'),
isScatter = series.asc_IsScatter(),
me = this;
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
rec.set('value', series.asc_getSeriesName());
me.updateRange();
me.updateCategoryList(me.chartSettings.getCatValues());
me.updateButtons();
me.chartSettings.endEditData();
me._isEditRanges = false;
}
};
me.chartSettings.startEditData();
this.changeDataRange(1, {series: series, isScatter: isScatter }, handlerDlg);
}
},
onEditCategory: function() {
var me = this;
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
me.updateCategoryList(me.chartSettings.getCatValues());
me.updateRange();
me.updateButtons();
me.chartSettings.endEditData();
me._isEditRanges = false;
}
};
me.chartSettings.startEditData();
this.changeDataRange(0, {category: this.chartSettings.getCatFormula(), values: this.chartSettings.getCatValues()}, handlerDlg);
},
changeDataRange: function(type, props, handlerDlg) {
var me = this;
var win = new SSE.Views.ChartDataRangeDialog({
type: type, //series
isScatter: !!props.isScatter,
handler: handlerDlg
}).on('close', function() {
me._isEditRanges && me.chartSettings.cancelEditData();
me._isEditRanges = false;
me.show();
});
me._isEditRanges = true;
var xy = me.$window.offset();
me.hide();
win.show(xy.left + 160, xy.top + 125);
win.setSettings({
api : me.api,
props : props,
chartSettings: me.chartSettings
});
},
onMoveClick: function(up) {
var store = this.seriesList.store,
length = store.length,
rec = this.seriesList.getSelectedRec();
if (rec) {
var index = store.indexOf(rec),
order = rec.get('order'),
newindex = up ? Math.max(0, index-1) : Math.min(length-1, index+1),
newrec = store.at(newindex),
neworder = newrec.get('order');
store.add(store.remove(rec), {at: newindex});
rec.set('order', neworder);
newrec.set('order', order);
up ? rec.get('series').asc_MoveUp() : rec.get('series').asc_MoveDown();
this.seriesList.selectRecord(rec);
this.seriesList.scrollToRecord(rec);
this.updateRange();
this.updateCategoryList(this.chartSettings.getCatValues());
this.updateButtons();
}
},
updateSeriesList: function(series, index) {
this.btnEditCategory.setDisabled(series && series.length>0 ? series[0].asc_IsScatter() : false);
var arr = [];
var store = this.seriesList.store;
for (var i = 0, len = series.length; i < len; i++)
{
var item = series[i],
rec = new Common.UI.DataViewModel();
rec.set({
value: item.asc_getSeriesName(),
index: item.asc_getIdx(),
order: item.asc_getOrder(),
series: item
});
arr.push(rec);
}
store.reset(arr);
(len>0) && this.seriesList.selectByIndex(Math.min(index || 0, store.length-1));
},
updateCategoryList: function(categories) {
var arr = [];
var store = this.categoryList.store;
for (var i = 0, len = categories.length; i < len; i++)
{
var item = categories[i],
rec = new Common.UI.DataViewModel();
rec.set({
value: item
});
arr.push(rec);
}
store.reset(arr);
(len>0) && this.categoryList.selectByIndex(0);
},
onSwitch: function() {
this.chartSettings.switchRowCol();
this.updateSeriesList(this.chartSettings.getSeries(), 0);
this.updateCategoryList(this.chartSettings.getCatValues());
this.updateRange();
this.updateButtons();
},
textTitle: 'Chart Data',
textInvalidRange: 'Invalid cells range',
textSelectData: 'Select data',
errorMaxRows: 'The maximum number of data series per chart is 255.',
errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.',
errorMaxPoints: 'The maximum number of points in series per chart is 4096.',
textSeries: 'Legend Entries (Series)',
textAdd: 'Add',
textEdit: 'Edit',
textDelete: 'Remove',
textSwitch: 'Switch Row/Column',
textCategory: 'Horizontal (Category) Axis Labels',
textUp: 'Up',
textDown: 'Down',
textData: 'Chart data range',
errorInFormula: "There's an error in formula you entered.",
errorInvalidReference: 'The reference is not valid. Reference must be to an open worksheet.',
errorNoSingleRowCol: 'The reference is not valid. References for titles, values, sizes, or data labels must be a single cell, row, or column.',
errorNoValues: 'To create a chart, the series must contain at least one value.'
}, SSE.Views.ChartDataDialog || {}))
});

View file

@ -0,0 +1,380 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* ChartDataRangeDialog.js
*
* Created by Julia Radzhabova on 02.07.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([
'common/main/lib/component/InputField',
'common/main/lib/component/Window'
], function () { 'use strict';
SSE.Views.ChartDataRangeDialog = Common.UI.Window.extend(_.extend({
options: {
type: 0, // 0 - category, 1 - series
width : 350,
cls : 'modal-dlg',
buttons: ['ok', 'cancel']
},
initialize : function(options) {
this.type = options.type || 0;
this.isScatter = options.isScatter;
_.extend(this.options, {
title: this.type==1 ? this.txtTitleSeries : this.txtTitleCategory
}, options);
this.template = [
'<div class="box">',
'<table cols="2" style="width: 100%;">',
'<tr>',
'<td colspan="2">',
'<label>' + (this.type==1 ? this.txtSeriesName : this.txtAxisLabel) + '</label>',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-bottom: 8px;width: 100%;">',
'<div id="id-dlg-chart-range-range1"></div>',
'</td>',
'<td style="padding-bottom: 8px;">',
'<label id="id-dlg-chart-range-lbl1" style="width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 5px;margin-top: 4px;">' + this.txtChoose + '</label>',
'</td>',
'</tr>',
'<% if (type==1) { %>',
'<tr>',
'<td colspan="2">',
'<label>' + (this.isScatter ? this.txtXValues : this.txtValues) + '</label>',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-bottom: 8px;width: 100%;">',
'<div id="id-dlg-chart-range-range2"></div>',
'</td>',
'<td style="padding-bottom: 8px;">',
'<label id="id-dlg-chart-range-lbl2" style="width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 5px;margin-top: 4px;"></label>',
'</td>',
'</tr>',
'<% if (isScatter) { %>',
'<tr>',
'<td colspan="2">',
'<label>' + this.txtYValues + '</label>',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-bottom: 8px;width: 100%;">',
'<div id="id-dlg-chart-range-range3"></div>',
'</td>',
'<td style="padding-bottom: 8px;">',
'<label id="id-dlg-chart-range-lbl3" style="width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 5px;margin-top: 4px;"></label>',
'</td>',
'</tr>',
'<% } %>',
'<% } %>',
'</table>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
var $window = this.getChild(),
me = this;
me.inputRange1 = new Common.UI.InputFieldBtn({
el: $('#id-dlg-chart-range-range1'),
style: '100%',
textSelectData: 'Select data',
// validateOnChange: true,
validateOnBlur: false
}).on('changed:after', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
me.updateRangeData(1, newValue);
}).on('changing', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
// me.onInputChanging(input, newValue, oldValue);
}).on('button:click', _.bind(this.onSelectData, this, 1));
this.lblRange1 = $window.find('#id-dlg-chart-range-lbl1');
me.inputRange2 = new Common.UI.InputFieldBtn({
el: $('#id-dlg-chart-range-range2'),
style: '100%',
textSelectData: 'Select data',
// validateOnChange: true,
validateOnBlur: false
}).on('changed:after', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
me.updateRangeData(2, newValue);
}).on('changing', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
// me.onInputChanging(input, newValue, oldValue);
}).on('button:click', _.bind(this.onSelectData, this, 2));
this.lblRange2 = $window.find('#id-dlg-chart-range-lbl2');
me.inputRange3 = new Common.UI.InputFieldBtn({
el: $('#id-dlg-chart-range-range3'),
style: '100%',
textSelectData: 'Select data',
// validateOnChange: true,
validateOnBlur: false
}).on('changed:after', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
me.updateRangeData(3, newValue);
}).on('changing', function(input, newValue, oldValue, e) {
if (newValue == oldValue) return;
// me.onInputChanging(input, newValue, oldValue);
}).on('button:click', _.bind(this.onSelectData, this, 3));
this.lblRange3 = $window.find('#id-dlg-chart-range-lbl3');
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
_.defer(function(){
me.inputRange1.cmpEl.find('input').focus();
}, 10);
},
onPrimary: function() {
this._handleInput('ok');
return false;
},
setSettings: function(settings) {
var me = this;
this.api = settings.api;
this.props = settings.props;
this.chartSettings = settings.chartSettings;
if (this.type==1) {
if (this.props.series) {
var series = this.props.series;
this.inputRange1.setValue(series.asc_getName());
this.lblRange1.html((this.inputRange1.getValue()!=='') ? ('= ' + (series.asc_getNameVal() || '')) : this.txtChoose);
if (this.props.isScatter) {
var arr = series.asc_getXValuesArr();
this.inputRange2.setValue(series.asc_getXValues());
this.lblRange2.html((this.inputRange2.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
this.inputRange3.setValue(series.asc_getYValues());
arr = series.asc_getYValuesArr();
this.lblRange3.html((this.inputRange3.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
} else {
var arr = series.asc_getValuesArr();
this.inputRange2.setValue(series.asc_getValues());
this.lblRange2.html((this.inputRange2.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
}
}
} else {
var arr = this.props.values;
this.inputRange1.setValue(this.props.category || '');
this.lblRange1.html((this.inputRange1.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
}
},
getSettings: function () {
return {name: this.inputRange1.getValue(), valuesX: this.inputRange2.getValue(), valuesY: this.inputRange3.getValue()};
},
onSelectData: function(type, input) {
var me = this;
if (me.api) {
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
input.setValue(dlg.getSettings());
_.delay(function(){
me.updateRangeData(type, dlg.getSettings());
},10);
}
};
var win = new SSE.Views.CellRangeDialog({
allowBlank: true,
handler: handlerDlg
}).on('close', function() {
// me.onInputChanging(input);
me.show();
_.delay(function(){
me._noApply = true;
input.cmpEl.find('input').focus();
me._noApply = false;
},1);
});
var xy = me.$window.offset();
me.hide();
win.show(xy.left + 65, xy.top + 77);
win.setSettings({
api : me.api,
range : !_.isEmpty(input.getValue()) ? input.getValue() : '',
type : Asc.c_oAscSelectionDialogType.Chart,
validation: function() {return true;}
});
}
},
isRangeValid: function(type, value) {
var isvalid;
switch (type) {
case 1:
if (this.props.series) {
isvalid = this.props.series.asc_IsValidName(value);
} else {
isvalid = this.chartSettings.isValidCatFormula(value);
}
break;
case 2:
if (this.props.isScatter) {
isvalid = this.props.series.asc_IsValidXValues(value);
} else {
isvalid = this.props.series.asc_IsValidValues(value);
}
break;
case 3:
isvalid = this.props.series.asc_IsValidYValues(value);
break;
}
if (isvalid === true || isvalid == Asc.c_oAscError.ID.No)
return true;
var error = this.textInvalidRange;
switch (isvalid) {
case Asc.c_oAscError.ID.StockChartError:
error = this.errorStockChart;
break;
case Asc.c_oAscError.ID.MaxDataSeriesError:
error = this.errorMaxRows;
break;
case Asc.c_oAscError.ID.MaxDataPointsError:
error = this.errorMaxPoints;
break;
case Asc.c_oAscError.ID.ErrorInFormula:
error = this.errorInFormula;
break;
case Asc.c_oAscError.ID.InvalidReference:
error = this.errorInvalidReference;
break;
case Asc.c_oAscError.ID.NoSingleRowCol:
error = this.errorNoSingleRowCol;
break;
case Asc.c_oAscError.ID.NoValues:
error = this.errorNoValues;
break;
}
Common.UI.warning({msg: error, maxwidth: 600});
return false;
},
updateRangeData: function(type, value) {
if (!this.isRangeValid(type, value)) return;
if (this.props.series) {
var series = this.props.series;
switch (type) {
case 1:
series.asc_setName(value);
this.lblRange1.html((this.inputRange1.getValue()!=='') ? ('= ' + (series.asc_getNameVal() || '')) : this.txtChoose);
break;
case 2:
if (this.isScatter) {
var arr = series.asc_getXValuesArr();
series.asc_setXValues(value);
this.lblRange2.html((this.inputRange2.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
} else {
var arr = series.asc_getValuesArr();
series.asc_setValues(value);
this.lblRange2.html((this.inputRange2.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
}
break;
case 3:
var arr = series.asc_getYValuesArr();
series.asc_setYValues(value);
this.lblRange3.html((this.inputRange3.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
break;
}
} else {
this.chartSettings.setCatFormula(value);
var arr = this.chartSettings.getCatValues();
this.lblRange1.html((this.inputRange1.getValue()!=='') ? ('= ' + (arr ? arr.join('; ') : '')) : this.txtChoose);
}
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
_handleInput: function(state) {
if (this.options.handler) {
if (state == 'ok') {
if (!this.isRangeValid(1, this.inputRange1.getValue())) return;
if (this.type==1 && !this.isRangeValid(2, this.inputRange2.getValue())) return;
if (this.type==1 && this.isScatter && !this.isRangeValid(3, this.inputRange3.getValue())) return;
}
if (this.options.handler.call(this, this, state))
return;
}
this.close();
},
txtTitleSeries: 'Edit Series',
txtTitleCategory: 'Axis Labels',
txtSeriesName: 'Series name',
txtValues: 'Values',
txtXValues: 'X Values',
txtYValues: 'Y Values',
txtAxisLabel: 'Axis label range',
txtChoose: 'Choose range',
textSelectData: 'Select data',
textInvalidRange: 'Invalid cells range',
errorMaxRows: 'The maximum number of data series per chart is 255.',
errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.',
errorMaxPoints: 'The maximum number of points in series per chart is 4096.',
errorInFormula: "There's an error in formula you entered.",
errorInvalidReference: 'The reference is not valid. Reference must be to an open worksheet.',
errorNoSingleRowCol: 'The reference is not valid. References for titles, values, sizes, or data labels must be a single cell, row, or column.',
errorNoValues: 'To create a chart, the series must contain at least one value.'
}, SSE.Views.ChartDataRangeDialog || {}))
});

View file

@ -46,7 +46,8 @@ define([
'common/main/lib/component/Button',
'common/main/lib/component/MetricSpinner',
'common/main/lib/component/ComboDataView',
'spreadsheeteditor/main/app/view/ChartSettingsDlg'
'spreadsheeteditor/main/app/view/ChartSettingsDlg',
'spreadsheeteditor/main/app/view/ChartDataDialog'
], function (menuTemplate, $, _, Backbone) {
'use strict';
@ -851,7 +852,7 @@ define([
}
},
onSelectData: function() {
onSelectData_simple: function() {
var me = this;
if (me.api) {
var props = me.api.asc_getChartObject(),
@ -895,7 +896,34 @@ define([
});
}
},
onSelectData: function() {
var me = this;
var props;
if (me.api){
props = me.api.asc_getChartObject();
if (props) {
me._isEditRanges = true;
props.startEdit();
var win = new SSE.Views.ChartDataDialog({
chartSettings: props,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
props.endEdit();
me._isEditRanges = false;
}
Common.NotificationCenter.trigger('edit:complete', me);
}
}).on('close', function() {
me._isEditRanges && props.cancelEdit();
me._isEditRanges = false;
});
win.show();
}
}
},
onSelectType: function(btn, picker, itemView, record) {
if (this._noApply) return;

View file

@ -42,7 +42,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
'common/main/lib/view/AdvancedSettingsWindow',
'common/main/lib/component/CheckBox',
'common/main/lib/component/InputField',
'spreadsheeteditor/main/app/view/CellRangeDialog'
'spreadsheeteditor/main/app/view/CellRangeDialog',
'spreadsheeteditor/main/app/view/ChartDataRangeDialog'
], function (contentTemplate) {
'use strict';
@ -58,7 +59,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
_.extend(this.options, {
title: this.textTitle,
items: [
{panelId: 'id-chart-settings-dlg-style', panelCaption: this.textTypeData},
{panelId: 'id-chart-settings-dlg-style', panelCaption: this.textType},
{panelId: 'id-chart-settings-dlg-layout', panelCaption: this.textLayout},
{panelId: 'id-chart-settings-dlg-vert', panelCaption: this.textVertAxis},
{panelId: 'id-chart-settings-dlg-hor', panelCaption: this.textHorAxis},
@ -137,26 +138,26 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.btnChartType.render($('#chart-dlg-button-type'));
this.mnuChartTypePicker.on('item:click', _.bind(this.onSelectType, this, this.btnChartType));
this.cmbDataDirect = new Common.UI.ComboBox({
el : $('#chart-dlg-combo-range'),
menuStyle : 'min-width: 120px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 0, displayValue: this.textDataRows },
{ value: 1, displayValue: this.textDataColumns }
]
});
this.txtDataRange = new Common.UI.InputFieldBtn({
el : $('#chart-dlg-txt-range'),
name : 'range',
style : 'width: 100%;',
btnHint : this.textSelectData,
allowBlank : true,
validateOnChange: true
});
this.txtDataRange.on('button:click', _.bind(this.onSelectData, this));
// this.cmbDataDirect = new Common.UI.ComboBox({
// el : $('#chart-dlg-combo-range'),
// menuStyle : 'min-width: 120px;',
// editable : false,
// cls : 'input-group-nr',
// data : [
// { value: 0, displayValue: this.textDataRows },
// { value: 1, displayValue: this.textDataColumns }
// ]
// });
//
// this.txtDataRange = new Common.UI.InputFieldBtn({
// el : $('#chart-dlg-txt-range'),
// name : 'range',
// style : 'width: 100%;',
// btnHint : this.textSelectData,
// allowBlank : true,
// validateOnChange: true
// });
// this.txtDataRange.on('button:click', _.bind(this.onSelectData, this));
this.cmbChartTitle = new Common.UI.ComboBox({
el : $('#chart-dlg-combo-chart-title'),
@ -1292,24 +1293,24 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this._noApply = false;
var value = props.getRange();
this.txtDataRange.setValue((value) ? value : '');
this.dataRangeValid = value;
this.txtDataRange.validation = function(value) {
if (_.isEmpty(value)) {
if (!me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(true);
return true;
}
if (me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(false);
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
};
this.cmbDataDirect.setDisabled(value===null);
this.cmbDataDirect.setValue(props.getInColumns() ? 1 : 0);
// var value = props.getRange();
// this.txtDataRange.setValue((value) ? value : '');
// this.dataRangeValid = value;
//
// this.txtDataRange.validation = function(value) {
// if (_.isEmpty(value)) {
// if (!me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(true);
// return true;
// }
//
// if (me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(false);
//
// var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false);
// return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
// };
//
// this.cmbDataDirect.setDisabled(value===null);
// this.cmbDataDirect.setValue(props.getInColumns() ? 1 : 0);
this.cmbChartTitle.setValue(props.getTitle());
this.cmbLegendPos.setValue(props.getLegendPos());
@ -1320,7 +1321,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true);
this.chValue.setValue(this.chartSettings.getShowVal(), true);
value = props.getSeparator();
var value = props.getSeparator();
this.txtSeparator.setValue((value) ? value : '');
// Vertical Axis
@ -1422,8 +1423,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.chartSettings.putType(type);
this.chartSettings.putInColumns(this.cmbDataDirect.getValue()==1);
this.chartSettings.putRange(this.txtDataRange.getValue());
// this.chartSettings.putInColumns(this.cmbDataDirect.getValue()==1);
// this.chartSettings.putRange(this.txtDataRange.getValue());
this.chartSettings.putTitle(this.cmbChartTitle.getValue());
this.chartSettings.putLegendPos(this.cmbLegendPos.getValue());
@ -1484,12 +1485,13 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
isRangeValid: function() {
if (this.isChart) {
var isvalid;
if (!_.isEmpty(this.txtDataRange.getValue())) {
var isvalid,
range = this.chartSettings.getRange();
if (!_.isEmpty(range)) {
var rec = this.mnuChartTypePicker.getSelectedRec(),
type = (rec) ? rec.get('type') : this.currentChartType;
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtDataRange.getValue(), true, this.cmbDataDirect.getValue()==0, type);
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, !this.chartSettings.getInColumns(), type);
if (isvalid == Asc.c_oAscError.ID.No)
return true;
} else
@ -1502,44 +1504,42 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
Common.UI.warning({msg: this.errorMaxRows});
} else if (isvalid == Asc.c_oAscError.ID.MaxDataPointsError)
Common.UI.warning({msg: this.errorMaxPoints});
else
this.txtDataRange.cmpEl.find('input').focus();
return false;
} else
return true;
},
onSelectData: function() {
var me = this;
if (me.api) {
me.btnChartType.menu.options.additionalAlign = me.menuAddAlign;
me.btnSparkType.menu.options.additionalAlign = me.menuAddAlign;
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
me.dataRangeValid = dlg.getSettings();
me.txtDataRange.setValue(me.dataRangeValid);
me.txtDataRange.checkValidate();
}
};
var win = new SSE.Views.CellRangeDialog({
handler: handlerDlg
}).on('close', function() {
me.show();
});
var xy = me.$window.offset();
me.hide();
win.show(xy.left + 160, xy.top + 125);
win.setSettings({
api : me.api,
isRows : (me.cmbDataDirect.getValue()==0),
range : (!_.isEmpty(me.txtDataRange.getValue()) && (me.txtDataRange.checkValidate()==true)) ? me.txtDataRange.getValue() : me.dataRangeValid,
type : Asc.c_oAscSelectionDialogType.Chart
});
}
},
// onSelectData: function() {
// var me = this;
// if (me.api) {
// me.btnChartType.menu.options.additionalAlign = me.menuAddAlign;
// me.btnSparkType.menu.options.additionalAlign = me.menuAddAlign;
//
// var handlerDlg = function(dlg, result) {
// if (result == 'ok') {
// me.dataRangeValid = dlg.getSettings();
// me.txtDataRange.setValue(me.dataRangeValid);
// me.txtDataRange.checkValidate();
// }
// };
//
// var win = new SSE.Views.CellRangeDialog({
// handler: handlerDlg
// }).on('close', function() {
// me.show();
// });
//
// var xy = me.$window.offset();
// me.hide();
// win.show(xy.left + 160, xy.top + 125);
// win.setSettings({
// api : me.api,
// isRows : (me.cmbDataDirect.getValue()==0),
// range : (!_.isEmpty(me.txtDataRange.getValue()) && (me.txtDataRange.checkValidate()==true)) ? me.txtDataRange.getValue() : me.dataRangeValid,
// type : Asc.c_oAscSelectionDialogType.Chart
// });
// }
// },
onSelectDataLabels: function(obj, rec, e) {
var disable = rec.value == Asc.c_oAscChartDataLabelsPos.none;
@ -1613,10 +1613,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.txtDataRange.cmpEl.find('input').focus();
},50);
// var me = this;
// _.delay(function(){
// me.txtDataRange.cmpEl.find('input').focus();
// },50);
},
close: function () {

View file

@ -190,17 +190,17 @@ define([
this.lockedControls.push(this.btnCustomSort);
this.btnsSortDown = Common.Utils.injectButtons($host.find('.slot-sortdesc'), '', 'toolbar__icon btn-sort-down', '',
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter, _set.sheetLock]);
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.cantModifyFilter, _set.sheetLock]);
this.btnsSortUp = Common.Utils.injectButtons($host.find('.slot-sortasc'), '', 'toolbar__icon btn-sort-up', '',
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter, _set.sheetLock]);
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.cantModifyFilter, _set.sheetLock]);
this.btnsSetAutofilter = Common.Utils.injectButtons($host.find('.slot-btn-setfilter'), '', 'toolbar__icon btn-autofilter', '',
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter],
false, false, true);
this.btnsClearAutofilter = Common.Utils.injectButtons($host.find('.slot-btn-clear-filter'), '', 'toolbar__icon btn-clear-filter', '',
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter, _set.editPivot]);
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter]);
Array.prototype.push.apply(this.lockedControls, this.btnsSortDown.concat(this.btnsSortUp, this.btnsSetAutofilter,this.btnsClearAutofilter));

View file

@ -180,7 +180,7 @@ define([
this.btnAddPivot = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-add-pivot',
iconCls: 'toolbar__icon btn-pivot-sum',
caption: this.txtCreate,
disabled : false,
lock : [_set.lostConnect, _set.coAuth, _set.editPivot, _set.selRangeEdit, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer]

View file

@ -294,8 +294,13 @@ define([
this.lockedControls.push(this.btnEdit);
this.btnConvertRange = new Common.UI.Button({
el: $('#table-btn-convert-range')
parentEl: $('#table-btn-convert-range'),
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-convert-to-range',
caption : this.textConvertRange,
style : 'width: 100%;text-align: left;'
});
this.btnConvertRange.on('click', _.bind(function(btn){
if (this.api) this.api.asc_convertTableToRange(this._state.TableName);
Common.NotificationCenter.trigger('edit:complete', this);
@ -303,7 +308,11 @@ define([
this.lockedControls.push(this.btnConvertRange);
this.btnRemDuplicates = new Common.UI.Button({
el: $('#table-btn-rem-duplicates')
parentEl: $('#table-btn-rem-duplicates'),
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-remove-duplicates',
caption : this.textRemDuplicates,
style : 'width: 100%;text-align: left;'
});
this.btnRemDuplicates.on('click', _.bind(function(btn){
Common.NotificationCenter.trigger('data:remduplicates', this);
@ -311,13 +320,21 @@ define([
this.lockedControls.push(this.btnRemDuplicates);
this.btnSlicer = new Common.UI.Button({
el: $('#table-btn-slicer')
parentEl: $('#table-btn-slicer'),
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-slicer',
caption : this.textSlicer,
style : 'width: 100%;text-align: left;'
});
this.btnSlicer.on('click', _.bind(this.onInsertSlicerClick, this));
this.lockedControls.push(this.btnSlicer);
this.btnPivot = new Common.UI.Button({
el: $('#table-btn-pivot')
parentEl: $('#table-btn-pivot'),
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-pivot-sum',
caption : this.textPivot,
style : 'width: 100%;text-align: left;'
});
this.btnPivot.on('click', _.bind(this.onInsertPivotClick, this));
this.lockedControls.push(this.btnPivot);
@ -626,7 +643,8 @@ define([
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?',
textRemDuplicates: 'Remove duplicates',
textSlicer: 'Insert slicer',
textPivot: 'Insert pivot table'
textPivot: 'Insert pivot table',
textActions: 'Table actions'
}, SSE.Views.TableSettings || {}));
});

View file

@ -1236,6 +1236,11 @@
"SSE.Views.AutoFilterDialog.txtTitle": "Filter",
"SSE.Views.AutoFilterDialog.txtTop10": "Top 10",
"SSE.Views.AutoFilterDialog.warnNoSelected": "You must choose at least one value",
"SSE.Views.AutoFilterDialog.txtValueFilter": "Value filter",
"SSE.Views.AutoFilterDialog.txtLabelFilter": "Label filter",
"SSE.Views.AutoFilterDialog.warnFilterError": "You need at least one field in the Values area in order to apply a value filter.",
"SSE.Views.AutoFilterDialog.txtNotBetween": "Not between...",
"SSE.Views.AutoFilterDialog.txtSortOption": "More sort options...",
"SSE.Views.CellEditor.textManager": "Name Manager",
"SSE.Views.CellEditor.tipFormula": "Insert function",
"SSE.Views.CellRangeDialog.errorMaxRows": "ERROR! The maximum number of data series per chart is 255",
@ -1280,6 +1285,42 @@
"SSE.Views.CellSettings.textPosition": "Position",
"SSE.Views.CellSettings.tipAddGradientPoint": "Add gradient point",
"SSE.Views.CellSettings.tipRemoveGradientPoint": "Remove gradient point",
"SSE.Views.ChartDataDialog.textTitle": "Chart Data",
"SSE.Views.ChartDataDialog.textInvalidRange": "Invalid cells range",
"SSE.Views.ChartDataDialog.textSelectData": "Select data",
"SSE.Views.ChartDataDialog.errorMaxRows": "The maximum number of data series per chart is 255.",
"SSE.Views.ChartDataDialog.errorStockChart": "Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.",
"SSE.Views.ChartDataDialog.errorMaxPoints": "The maximum number of points in series per chart is 4096.",
"SSE.Views.ChartDataDialog.textSeries": "Legend Entries (Series)",
"SSE.Views.ChartDataDialog.textAdd": "Add",
"SSE.Views.ChartDataDialog.textEdit": "Edit",
"SSE.Views.ChartDataDialog.textDelete": "Remove",
"SSE.Views.ChartDataDialog.textSwitch": "Switch Row/Column",
"SSE.Views.ChartDataDialog.textCategory": "Horizontal (Category) Axis Labels",
"SSE.Views.ChartDataDialog.textUp": "Up",
"SSE.Views.ChartDataDialog.textDown": "Down",
"SSE.Views.ChartDataDialog.textData": "Chart data range",
"SSE.Views.ChartDataDialog.errorInFormula": "There's an error in formula you entered.",
"SSE.Views.ChartDataDialog.errorInvalidReference": "The reference is not valid. Reference must be to an open worksheet.",
"SSE.Views.ChartDataDialog.errorNoSingleRowCol": "The reference is not valid. References for titles, values, sizes, or data labels must be a single cell, row, or column.",
"SSE.Views.ChartDataDialog.errorNoValues": "To create a chart, the series must contain at least one value.",
"SSE.Views.ChartDataRangeDialog.txtTitleSeries": "Edit Series",
"SSE.Views.ChartDataRangeDialog.txtTitleCategory": "Axis Labels",
"SSE.Views.ChartDataRangeDialog.txtSeriesName": "Series name",
"SSE.Views.ChartDataRangeDialog.txtValues": "Values",
"SSE.Views.ChartDataRangeDialog.txtXValues": "X Values",
"SSE.Views.ChartDataRangeDialog.txtYValues": "Y Values",
"SSE.Views.ChartDataRangeDialog.txtAxisLabel": "Axis label range",
"SSE.Views.ChartDataRangeDialog.txtChoose": "Choose range",
"SSE.Views.ChartDataRangeDialog.textInvalidRange": "Invalid cells range",
"SSE.Views.ChartDataRangeDialog.textSelectData": "Select data",
"SSE.Views.ChartDataRangeDialog.errorMaxRows": "The maximum number of data series per chart is 255.",
"SSE.Views.ChartDataRangeDialog.errorStockChart": "Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.",
"SSE.Views.ChartDataRangeDialog.errorMaxPoints": "The maximum number of points in series per chart is 4096.",
"SSE.Views.ChartDataRangeDialog.errorInFormula": "There's an error in formula you entered.",
"SSE.Views.ChartDataRangeDialog.errorInvalidReference": "The reference is not valid. Reference must be to an open worksheet.",
"SSE.Views.ChartDataRangeDialog.errorNoSingleRowCol": "The reference is not valid. References for titles, values, sizes, or data labels must be a single cell, row, or column.",
"SSE.Views.ChartDataRangeDialog.errorNoValues": "To create a chart, the series must contain at least one value.",
"SSE.Views.ChartSettings.strLineWeight": "Line Weight",
"SSE.Views.ChartSettings.strSparkColor": "Color",
"SSE.Views.ChartSettings.strTemplate": "Template",
@ -2019,6 +2060,27 @@
"SSE.Views.ParagraphSettingsAdvanced.textTabRight": "Right",
"SSE.Views.ParagraphSettingsAdvanced.textTitle": "Paragraph - Advanced Settings",
"SSE.Views.ParagraphSettingsAdvanced.txtAutoText": "Auto",
"SSE.Views.PivotDigitalFilterDialog.capCondition1": "equals",
"SSE.Views.PivotDigitalFilterDialog.capCondition10": "does not end with",
"SSE.Views.PivotDigitalFilterDialog.capCondition11": "contains",
"SSE.Views.PivotDigitalFilterDialog.capCondition12": "does not contain",
"SSE.Views.PivotDigitalFilterDialog.capCondition2": "does not equal",
"SSE.Views.PivotDigitalFilterDialog.capCondition3": "is greater than",
"SSE.Views.PivotDigitalFilterDialog.capCondition4": "is greater than or equal to",
"SSE.Views.PivotDigitalFilterDialog.capCondition5": "is less than",
"SSE.Views.PivotDigitalFilterDialog.capCondition6": "is less than or equal to",
"SSE.Views.PivotDigitalFilterDialog.capCondition7": "begins with",
"SSE.Views.PivotDigitalFilterDialog.capCondition8": "does not begin with",
"SSE.Views.PivotDigitalFilterDialog.capCondition9": "ends with",
"SSE.Views.PivotDigitalFilterDialog.textUse1": "Use ? to present any single character",
"SSE.Views.PivotDigitalFilterDialog.textUse2": "Use * to present any series of character",
"SSE.Views.PivotDigitalFilterDialog.textShowLabel": "Show items for which the label:",
"SSE.Views.PivotDigitalFilterDialog.textShowValue": "Show items for which:",
"SSE.Views.PivotDigitalFilterDialog.txtTitleValue": "Value Filter",
"SSE.Views.PivotDigitalFilterDialog.txtTitleLabel": "Label Filter",
"SSE.Views.PivotDigitalFilterDialog.capCondition13": "between",
"SSE.Views.PivotDigitalFilterDialog.capCondition14": "not between",
"SSE.Views.PivotDigitalFilterDialog.txtAnd": "and",
"SSE.Views.PivotSettings.textAdvanced": "Show advanced settings",
"SSE.Views.PivotSettings.textColumns": "Columns",
"SSE.Views.PivotSettings.textFields": "Select Fields",
@ -2386,6 +2448,9 @@
"SSE.Views.SortDialog.textZA": "Z to A",
"SSE.Views.SortDialog.txtInvalidRange": "Invalid cells range.",
"SSE.Views.SortDialog.txtTitle": "Sort",
"SSE.Views.SortFilterDialog.txtTitle": "Sort",
"SSE.Views.SortFilterDialog.textAsc": "Ascenging (A to Z) by",
"SSE.Views.SortFilterDialog.textDesc": "Descending (Z to A) by",
"SSE.Views.SortOptionsDialog.textCase": "Case sensitive",
"SSE.Views.SortOptionsDialog.textHeaders": "My data has headers",
"SSE.Views.SortOptionsDialog.textLeftRight": "Sort left to right",
@ -2510,6 +2575,7 @@
"SSE.Views.TableSettings.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.TableSettings.textSlicer": "Insert slicer",
"SSE.Views.TableSettings.textPivot": "Insert pivot table",
"SSE.Views.TableSettings.textActions": "Table actions",
"SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text",
"SSE.Views.TableSettingsAdvanced.textAltDescription": "Description",
"SSE.Views.TableSettingsAdvanced.textAltTip": "The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.",
@ -2796,6 +2862,9 @@
"SSE.Views.Top10FilterDialog.txtPercent": "Percent",
"SSE.Views.Top10FilterDialog.txtTitle": "Top 10 AutoFilter",
"SSE.Views.Top10FilterDialog.txtTop": "Top",
"SSE.Views.Top10FilterDialog.txtValueTitle": "Top 10 Filter",
"SSE.Views.Top10FilterDialog.txtSum": "Sum",
"SSE.Views.Top10FilterDialog.txtBy": "by",
"SSE.Views.ValueFieldSettingsDialog.textTitle": "Value Field Settings",
"SSE.Views.ValueFieldSettingsDialog.txtAverage": "Average",
"SSE.Views.ValueFieldSettingsDialog.txtBaseField": "Base field",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

View file

@ -194,6 +194,7 @@
box-shadow: 0px 4px 0 #49795d inset;
border-top-width: 0;
padding-top: 1px;
font-weight: bold;
}
}
@ -207,14 +208,14 @@
}
&.coauth-locked {
vertical-align: top;
&.active {
> span {
border-top-width: 1px;
border-top-width: 0px;
}
}
> span {
outline: none;
position: relative;
}
> span:after {
position: absolute;