Merge branch 'develop' into feature/sse-views
|
@ -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: {
|
||||
|
|
|
@ -951,6 +951,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]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@
|
|||
|
||||
&:not(.icon-top)
|
||||
.caption:not(:empty) {
|
||||
padding: 0 2px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
|
|
@ -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]});
|
||||
|
||||
|
|
|
@ -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"> </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"> </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"> </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"> </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"> </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"> </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"> </i></button>
|
||||
</div>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 || {}));
|
||||
});
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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 || {}));
|
||||
});
|
|
@ -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",
|
||||
|
@ -2015,6 +2020,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",
|
||||
|
@ -2379,6 +2405,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",
|
||||
|
@ -2503,6 +2532,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.",
|
||||
|
@ -2786,6 +2816,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",
|
||||
|
|
Before Width: | Height: | Size: 317 B |
After Width: | Height: | Size: 637 B |
After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 323 B |
After Width: | Height: | Size: 713 B |
After Width: | Height: | Size: 620 B |
Before Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 342 B |
After Width: | Height: | Size: 713 B |
After Width: | Height: | Size: 690 B |
Before Width: | Height: | Size: 317 B |
After Width: | Height: | Size: 637 B |
After Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 259 B |
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 451 B |
Before Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 392 B |
After Width: | Height: | Size: 935 B |
After Width: | Height: | Size: 810 B |
Before Width: | Height: | Size: 245 B |
After Width: | Height: | Size: 768 B |
After Width: | Height: | Size: 583 B |
|
@ -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;
|
||||
|
|