flexmonster 2.9.16 → 2.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/flexmonster.css +1 -1
  2. package/flexmonster.es5.full.js +2838 -2829
  3. package/flexmonster.es5.js +2577 -2571
  4. package/flexmonster.full.js +2315 -2308
  5. package/flexmonster.js +2376 -2372
  6. package/flexmonster.min.css +1 -1
  7. package/package.json +1 -1
  8. package/theme/accessible/flexmonster.css +1 -1
  9. package/theme/accessible/flexmonster.min.css +1 -1
  10. package/theme/blackorange/flexmonster.css +1 -1
  11. package/theme/blackorange/flexmonster.min.css +1 -1
  12. package/theme/brightorange/flexmonster.css +1 -1
  13. package/theme/brightorange/flexmonster.min.css +1 -1
  14. package/theme/dark/flexmonster.css +1 -1
  15. package/theme/dark/flexmonster.min.css +1 -1
  16. package/theme/flexmonster-base.less +1 -1
  17. package/theme/green/flexmonster.css +1 -1
  18. package/theme/green/flexmonster.min.css +1 -1
  19. package/theme/lightblue/flexmonster.css +1 -1
  20. package/theme/lightblue/flexmonster.min.css +1 -1
  21. package/theme/macos/flexmonster.css +1 -1
  22. package/theme/macos/flexmonster.min.css +1 -1
  23. package/theme/midnight/flexmonster.css +1 -1
  24. package/theme/midnight/flexmonster.min.css +1 -1
  25. package/theme/old/flexmonster.css +1 -1
  26. package/theme/old/flexmonster.min.css +1 -1
  27. package/theme/orange/flexmonster.css +1 -1
  28. package/theme/orange/flexmonster.min.css +1 -1
  29. package/theme/purple/flexmonster.css +1 -1
  30. package/theme/purple/flexmonster.min.css +1 -1
  31. package/theme/softdefault/flexmonster.css +1 -1
  32. package/theme/softdefault/flexmonster.min.css +1 -1
  33. package/theme/stripedblue/flexmonster.css +1 -1
  34. package/theme/stripedblue/flexmonster.min.css +1 -1
  35. package/theme/stripedteal/flexmonster.css +1 -1
  36. package/theme/stripedteal/flexmonster.min.css +1 -1
  37. package/theme/teal/flexmonster.css +1 -1
  38. package/theme/teal/flexmonster.min.css +1 -1
  39. package/theme/yellow/flexmonster.css +1 -1
  40. package/theme/yellow/flexmonster.min.css +1 -1
  41. package/toolbar/flexmonster.toolbar.js +562 -468
  42. package/types/flexmonster.d.ts +14 -2
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Flexmonster Pivot Table & Charts [https://www.flexmonster.com/]
3
- * January 2022 (v. 2.9.16)
3
+ * January 2022 (v. 2.9.17)
4
4
  * Copyright (c) 2022 Flexmonster. All rights reserved.
5
5
  *
6
6
  * Flexmonster Pivot Table & Charts commercial licenses may be obtained at
@@ -25,45 +25,45 @@ FlexmonsterToolbar.prototype.getTabs = function () {
25
25
  icon: this.icons.connect,
26
26
  kibana: false,
27
27
  menu: [{
28
- title: Labels.connect_local_csv,
29
- id: "fm-tab-connect-local-csv",
30
- handler: this.connectLocalCSVHandler,
31
- mobile: false,
32
- icon: this.icons.connect_csv
33
- },
34
- {
35
- title: Labels.connect_local_json,
36
- id: "fm-tab-connect-local-json",
37
- handler: this.connectLocalJSONHandler,
38
- mobile: false,
39
- icon: this.icons.connect_json
40
- },
41
- {
42
- title: this.osUtils.isMobile ? Labels.connect_remote_csv_mobile : Labels.connect_remote_csv,
43
- id: "fm-tab-connect-remote-csv",
44
- handler: this.connectRemoteCSV,
45
- icon: this.icons.connect_csv_remote
46
- },
47
- {
48
- title: this.osUtils.isMobile ? Labels.connect_remote_json_mobile : Labels.connect_remote_json,
49
- id: "fm-tab-connect-remote-json",
50
- handler: this.connectRemoteJSON,
51
- icon: this.icons.connect_json_remote
52
- },
53
- {
54
- title: this.osUtils.isMobile ? Labels.connect_olap_mobile : Labels.connect_olap,
55
- id: "fm-tab-connect-olap",
56
- handler: this.connectOLAP,
57
- flat: false,
58
- icon: this.icons.connect_olap
59
- },
60
- {
61
- title: this.osUtils.isMobile ? Labels.connect_elastic_mobile : Labels.connect_elastic,
62
- id: "fm-tab-connect-elastic",
63
- handler: this.connectElastic,
64
- flat: false,
65
- icon: this.icons.connect_elastic
66
- }
28
+ title: Labels.connect_local_csv,
29
+ id: "fm-tab-connect-local-csv",
30
+ handler: this.connectLocalCSVHandler,
31
+ mobile: false,
32
+ icon: this.icons.connect_csv
33
+ },
34
+ {
35
+ title: Labels.connect_local_json,
36
+ id: "fm-tab-connect-local-json",
37
+ handler: this.connectLocalJSONHandler,
38
+ mobile: false,
39
+ icon: this.icons.connect_json
40
+ },
41
+ {
42
+ title: this.osUtils.isMobile ? Labels.connect_remote_csv_mobile : Labels.connect_remote_csv,
43
+ id: "fm-tab-connect-remote-csv",
44
+ handler: this.connectRemoteCSV,
45
+ icon: this.icons.connect_csv_remote
46
+ },
47
+ {
48
+ title: this.osUtils.isMobile ? Labels.connect_remote_json_mobile : Labels.connect_remote_json,
49
+ id: "fm-tab-connect-remote-json",
50
+ handler: this.connectRemoteJSON,
51
+ icon: this.icons.connect_json_remote
52
+ },
53
+ {
54
+ title: this.osUtils.isMobile ? Labels.connect_olap_mobile : Labels.connect_olap,
55
+ id: "fm-tab-connect-olap",
56
+ handler: this.connectOLAP,
57
+ flat: false,
58
+ icon: this.icons.connect_olap
59
+ },
60
+ {
61
+ title: this.osUtils.isMobile ? Labels.connect_elastic_mobile : Labels.connect_elastic,
62
+ id: "fm-tab-connect-elastic",
63
+ handler: this.connectElastic,
64
+ flat: false,
65
+ icon: this.icons.connect_elastic
66
+ }
67
67
  ]
68
68
  });
69
69
 
@@ -74,18 +74,18 @@ FlexmonsterToolbar.prototype.getTabs = function () {
74
74
  icon: this.icons.open,
75
75
  kibana: false,
76
76
  menu: [{
77
- title: Labels.local_report,
78
- id: "fm-tab-open-local-report",
79
- handler: this.openLocalReport,
80
- mobile: false,
81
- icon: this.icons.open_local
82
- },
83
- {
84
- title: this.osUtils.isMobile ? Labels.remote_report_mobile : Labels.remote_report,
85
- id: "fm-tab-open-remote-report",
86
- handler: this.openRemoteReport,
87
- icon: this.icons.open_remote
88
- }
77
+ title: Labels.local_report,
78
+ id: "fm-tab-open-local-report",
79
+ handler: this.openLocalReport,
80
+ mobile: false,
81
+ icon: this.icons.open_local
82
+ },
83
+ {
84
+ title: this.osUtils.isMobile ? Labels.remote_report_mobile : Labels.remote_report,
85
+ id: "fm-tab-open-remote-report",
86
+ handler: this.openRemoteReport,
87
+ icon: this.icons.open_remote
88
+ }
89
89
  ]
90
90
  });
91
91
 
@@ -106,46 +106,46 @@ FlexmonsterToolbar.prototype.getTabs = function () {
106
106
  mobile: false,
107
107
  icon: this.icons.export,
108
108
  menu: [{
109
- title: Labels.export_print,
110
- id: "fm-tab-export-print",
111
- handler: this.printHandler,
112
- icon: this.icons.export_print
113
- },
114
- {
115
- title: Labels.export_html,
116
- id: "fm-tab-export-html",
117
- handler: this.exportHandler,
118
- args: "html",
119
- icon: this.icons.export_html
120
- },
121
- {
122
- title: Labels.export_csv,
123
- id: "fm-tab-export-csv",
124
- handler: this.exportHandler,
125
- args: "csv",
126
- icon: this.icons.export_csv
127
- },
128
- {
129
- title: Labels.export_excel,
130
- id: "fm-tab-export-excel",
131
- handler: this.exportHandler,
132
- args: "excel",
133
- icon: this.icons.export_excel
134
- },
135
- {
136
- title: Labels.export_image,
137
- id: "fm-tab-export-image",
138
- handler: this.exportHandler,
139
- args: "image",
140
- icon: this.icons.export_image
141
- },
142
- {
143
- title: Labels.export_pdf,
144
- id: "fm-tab-export-pdf",
145
- handler: this.exportHandler,
146
- args: "pdf",
147
- icon: this.icons.export_pdf
148
- },
109
+ title: Labels.export_print,
110
+ id: "fm-tab-export-print",
111
+ handler: this.printHandler,
112
+ icon: this.icons.export_print
113
+ },
114
+ {
115
+ title: Labels.export_html,
116
+ id: "fm-tab-export-html",
117
+ handler: this.exportHandler,
118
+ args: "html",
119
+ icon: this.icons.export_html
120
+ },
121
+ {
122
+ title: Labels.export_csv,
123
+ id: "fm-tab-export-csv",
124
+ handler: this.exportHandler,
125
+ args: "csv",
126
+ icon: this.icons.export_csv
127
+ },
128
+ {
129
+ title: Labels.export_excel,
130
+ id: "fm-tab-export-excel",
131
+ handler: this.exportHandler,
132
+ args: "excel",
133
+ icon: this.icons.export_excel
134
+ },
135
+ {
136
+ title: Labels.export_image,
137
+ id: "fm-tab-export-image",
138
+ handler: this.exportHandler,
139
+ args: "image",
140
+ icon: this.icons.export_image
141
+ },
142
+ {
143
+ title: Labels.export_pdf,
144
+ id: "fm-tab-export-pdf",
145
+ handler: this.exportHandler,
146
+ args: "pdf",
147
+ icon: this.icons.export_pdf
148
+ },
149
149
  ]
150
150
  });
151
151
  // Share tab
@@ -176,63 +176,63 @@ FlexmonsterToolbar.prototype.getTabs = function () {
176
176
  onShowHandler: this.checkChartMultipleMeasures,
177
177
  icon: this.icons.charts,
178
178
  menu: [{
179
- title: Labels.charts_column,
180
- id: "fm-tab-charts-column",
181
- handler: this.chartsHandler,
182
- args: "column",
183
- icon: this.icons.charts
184
- },
185
- {
186
- title: Labels.charts_bar_horizontal,
187
- id: "fm-tab-charts-bar-horizontal",
188
- handler: this.chartsHandler,
189
- args: "bar_h",
190
- icon: this.icons.charts_bar
191
- },
192
- {
193
- title: Labels.charts_line,
194
- id: "fm-tab-charts-line",
195
- handler: this.chartsHandler,
196
- args: "line",
197
- icon: this.icons.charts_line
198
- },
199
- {
200
- title: Labels.charts_scatter,
201
- id: "fm-tab-charts-scatter",
202
- handler: this.chartsHandler,
203
- args: "scatter",
204
- icon: this.icons.charts_scatter
205
- },
206
- {
207
- title: Labels.charts_pie,
208
- id: "fm-tab-charts-pie",
209
- handler: this.chartsHandler,
210
- args: "pie",
211
- icon: this.icons.charts_pie
212
- },
213
- {
214
- title: Labels.charts_stacked_column,
215
- id: "fm-tab-charts-stacked-column",
216
- handler: this.chartsHandler,
217
- args: "stacked_column",
218
- flat: false,
219
- icon: this.icons.charts_stacked_column
220
- },
221
- {
222
- title: Labels.charts_column_line,
223
- id: "fm-tab-charts-column-line",
224
- handler: this.chartsHandler,
225
- args: "column_line",
226
- icon: this.icons.charts_column_line
227
- },
228
- {
229
- title: Labels.charts_multiple,
230
- id: "fm-tab-charts-multiple",
231
- handler: this.chartsMultipleHandler,
232
- flat: false,
233
- mobile: false,
234
- type: "checkbox"
235
- }
179
+ title: Labels.charts_column,
180
+ id: "fm-tab-charts-column",
181
+ handler: this.chartsHandler,
182
+ args: "column",
183
+ icon: this.icons.charts
184
+ },
185
+ {
186
+ title: Labels.charts_bar_horizontal,
187
+ id: "fm-tab-charts-bar-horizontal",
188
+ handler: this.chartsHandler,
189
+ args: "bar_h",
190
+ icon: this.icons.charts_bar
191
+ },
192
+ {
193
+ title: Labels.charts_line,
194
+ id: "fm-tab-charts-line",
195
+ handler: this.chartsHandler,
196
+ args: "line",
197
+ icon: this.icons.charts_line
198
+ },
199
+ {
200
+ title: Labels.charts_scatter,
201
+ id: "fm-tab-charts-scatter",
202
+ handler: this.chartsHandler,
203
+ args: "scatter",
204
+ icon: this.icons.charts_scatter
205
+ },
206
+ {
207
+ title: Labels.charts_pie,
208
+ id: "fm-tab-charts-pie",
209
+ handler: this.chartsHandler,
210
+ args: "pie",
211
+ icon: this.icons.charts_pie
212
+ },
213
+ {
214
+ title: Labels.charts_stacked_column,
215
+ id: "fm-tab-charts-stacked-column",
216
+ handler: this.chartsHandler,
217
+ args: "stacked_column",
218
+ flat: false,
219
+ icon: this.icons.charts_stacked_column
220
+ },
221
+ {
222
+ title: Labels.charts_column_line,
223
+ id: "fm-tab-charts-column-line",
224
+ handler: this.chartsHandler,
225
+ args: "column_line",
226
+ icon: this.icons.charts_column_line
227
+ },
228
+ {
229
+ title: Labels.charts_multiple,
230
+ id: "fm-tab-charts-multiple",
231
+ handler: this.chartsMultipleHandler,
232
+ flat: false,
233
+ mobile: false,
234
+ type: "checkbox"
235
+ }
236
236
  ]
237
237
  });
238
238
  tabs.push({
@@ -246,17 +246,17 @@ FlexmonsterToolbar.prototype.getTabs = function () {
246
246
  icon: this.icons.format,
247
247
  rightGroup: true,
248
248
  menu: [{
249
- title: this.osUtils.isMobile ? Labels.format_cells_mobile : Labels.format_cells,
250
- id: "fm-tab-format-cells",
251
- handler: this.formatCellsHandler,
252
- icon: this.icons.format_number
253
- },
254
- {
255
- title: this.osUtils.isMobile ? Labels.conditional_formatting_mobile : Labels.conditional_formatting,
256
- id: "fm-tab-format-conditional",
257
- handler: this.conditionalFormattingHandler,
258
- icon: this.icons.format_conditional
259
- }
249
+ title: this.osUtils.isMobile ? Labels.format_cells_mobile : Labels.format_cells,
250
+ id: "fm-tab-format-cells",
251
+ handler: this.formatCellsHandler,
252
+ icon: this.icons.format_number
253
+ },
254
+ {
255
+ title: this.osUtils.isMobile ? Labels.conditional_formatting_mobile : Labels.conditional_formatting,
256
+ id: "fm-tab-format-conditional",
257
+ handler: this.conditionalFormattingHandler,
258
+ icon: this.icons.format_conditional
259
+ }
260
260
  ]
261
261
  });
262
262
 
@@ -388,7 +388,7 @@ FlexmonsterToolbar.prototype.init = function () {
388
388
  _this.updateLabels(_this.Labels);
389
389
 
390
390
  _this.pivot.on("numberformatting", function (data) {
391
- _this.formatCellsHandler(data.measureName);
391
+ _this.formatCellsHandler(data.measureName, data.aggregation);
392
392
  });
393
393
  _this.pivot.on("conditionalformatting", function (data) {
394
394
  _this.conditionalFormattingHandler(data.measureName);
@@ -428,8 +428,8 @@ FlexmonsterToolbar.prototype.init = function () {
428
428
  for (var i = 0; i < children.length; i++) {
429
429
  var classList = children[i].classList;
430
430
  if (!(classList.contains("fm-popup") ||
431
- classList.contains("fm-modal-overlay") ||
432
- classList.contains("fm-popup-modal-overlay"))) {
431
+ classList.contains("fm-modal-overlay") ||
432
+ classList.contains("fm-popup-modal-overlay"))) {
433
433
  elementsToDelete.push(children[i]);
434
434
  }
435
435
  }
@@ -754,8 +754,8 @@ FlexmonsterToolbar.prototype.disableMultipleValues = function (type, multiple, n
754
754
  }
755
755
  }
756
756
  // Format tab
757
- FlexmonsterToolbar.prototype.formatCellsHandler = function (measureName) {
758
- this.showFormatCellsDialog(measureName);
757
+ FlexmonsterToolbar.prototype.formatCellsHandler = function (measureName, aggregation) {
758
+ this.showFormatCellsDialog(measureName, aggregation);
759
759
  }
760
760
  FlexmonsterToolbar.prototype.conditionalFormattingHandler = function (measureName) {
761
761
  this.showConditionalFormattingDialog(measureName);
@@ -773,7 +773,7 @@ FlexmonsterToolbar.prototype.printHandler = function () {
773
773
  this.pivot.print();
774
774
  }
775
775
  FlexmonsterToolbar.prototype.exportHandler = function (type) {
776
- (type == "pdf") ? this.showExportPdfDialog() : this.pivot.exportTo(type);
776
+ (type == "pdf") ? this.showExportPdfDialog(): this.pivot.exportTo(type);
777
777
  }
778
778
  // Share tab
779
779
  FlexmonsterToolbar.prototype.shareReportHandler = function () {
@@ -802,15 +802,15 @@ FlexmonsterToolbar.prototype.showConnectToRemoteCSVDialog = function () {
802
802
  dialog.content.classList.add("fm-popup-w500");
803
803
  dialog.setTitle(Labels.open_remote_csv);
804
804
  dialog.setToolbar([{
805
- id: "fm-btn-open",
806
- label: Labels.open,
807
- handler: applyHandler,
808
- isPositive: true
809
- },
810
- {
811
- id: "fm-btn-cancel",
812
- label: Labels.cancel
813
- }
805
+ id: "fm-btn-open",
806
+ label: Labels.open,
807
+ handler: applyHandler,
808
+ isPositive: true
809
+ },
810
+ {
811
+ id: "fm-btn-cancel",
812
+ label: Labels.cancel
813
+ }
814
814
  ]);
815
815
 
816
816
  var content = document.createElement("div");
@@ -841,15 +841,15 @@ FlexmonsterToolbar.prototype.showConnectToRemoteJsonDialog = function () {
841
841
  dialog.content.classList.add("fm-popup-w500");
842
842
  dialog.setTitle(Labels.open_remote_json);
843
843
  dialog.setToolbar([{
844
- id: "fm-btn-open",
845
- label: Labels.open,
846
- handler: applyHandler,
847
- isPositive: true
848
- },
849
- {
850
- id: "fm-btn-cancel",
851
- label: Labels.cancel
852
- }
844
+ id: "fm-btn-open",
845
+ label: Labels.open,
846
+ handler: applyHandler,
847
+ isPositive: true
848
+ },
849
+ {
850
+ id: "fm-btn-cancel",
851
+ label: Labels.cancel
852
+ }
853
853
  ]);
854
854
 
855
855
  var content = document.createElement("div");
@@ -902,16 +902,16 @@ FlexmonsterToolbar.prototype.showConnectToElasticDialog = function () {
902
902
  dialog.content.classList.add("fm-popup-w570");
903
903
  dialog.setTitle(Labels.connect_elastic_title);
904
904
  dialog.setToolbar([{
905
- id: "fm-btn-open",
906
- label: Labels.ok,
907
- handler: okHandler,
908
- disabled: true,
909
- isPositive: true
910
- },
911
- {
912
- id: "fm-btn-cancel",
913
- label: Labels.cancel
914
- }
905
+ id: "fm-btn-open",
906
+ label: Labels.ok,
907
+ handler: okHandler,
908
+ disabled: true,
909
+ isPositive: true
910
+ },
911
+ {
912
+ id: "fm-btn-cancel",
913
+ label: Labels.cancel
914
+ }
915
915
  ]);
916
916
 
917
917
  var content = document.createElement("div");
@@ -1024,16 +1024,16 @@ FlexmonsterToolbar.prototype.showConnectToOLAPDialog = function () {
1024
1024
  dialog.content.classList.add("fm-popup-w570");
1025
1025
  dialog.setTitle(this.osUtils.isMobile ? Labels.connect_olap_mobile : Labels.olap_connection_tool);
1026
1026
  dialog.setToolbar([{
1027
- id: "fm-btn-open",
1028
- label: Labels.ok,
1029
- handler: okHandler,
1030
- disabled: true,
1031
- isPositive: true
1032
- },
1033
- {
1034
- id: "fm-btn-cancel",
1035
- label: Labels.cancel
1036
- }
1027
+ id: "fm-btn-open",
1028
+ label: Labels.ok,
1029
+ handler: okHandler,
1030
+ disabled: true,
1031
+ isPositive: true
1032
+ },
1033
+ {
1034
+ id: "fm-btn-cancel",
1035
+ label: Labels.cancel
1036
+ }
1037
1037
  ]);
1038
1038
 
1039
1039
  var content = document.createElement("div");
@@ -1132,15 +1132,15 @@ FlexmonsterToolbar.prototype.showOpenRemoteReportDialog = function () {
1132
1132
  dialog.content.classList.add("fm-popup-w500");
1133
1133
  dialog.setTitle(Labels.open_remote_report);
1134
1134
  dialog.setToolbar([{
1135
- id: "fm-btn-open",
1136
- label: Labels.open,
1137
- handler: applyHandler,
1138
- isPositive: true
1139
- },
1140
- {
1141
- id: "fm-btn-cancel",
1142
- label: Labels.cancel
1143
- }
1135
+ id: "fm-btn-open",
1136
+ label: Labels.open,
1137
+ handler: applyHandler,
1138
+ isPositive: true
1139
+ },
1140
+ {
1141
+ id: "fm-btn-cancel",
1142
+ label: Labels.cancel
1143
+ }
1144
1144
  ]);
1145
1145
  var content = document.createElement("div");
1146
1146
  var textInput = document.createElement("input");
@@ -1158,164 +1158,164 @@ FlexmonsterToolbar.prototype.showOpenRemoteReportDialog = function () {
1158
1158
  // Format cells
1159
1159
  FlexmonsterToolbar.prototype.defaults.numberFormatting = {
1160
1160
  textAligns: [{
1161
- label: "align_left",
1162
- value: "left"
1163
- },
1164
- {
1165
- label: "align_right",
1166
- value: "right"
1167
- },
1168
- {
1169
- label: "align_center",
1170
- value: "center"
1171
- },
1161
+ label: "align_left",
1162
+ value: "left"
1163
+ },
1164
+ {
1165
+ label: "align_right",
1166
+ value: "right"
1167
+ },
1168
+ {
1169
+ label: "align_center",
1170
+ value: "center"
1171
+ },
1172
1172
  ],
1173
1173
  thousandsSeparators: [{
1174
- label: "none",
1175
- value: ""
1176
- },
1177
- {
1178
- label: "space",
1179
- value: " "
1180
- },
1181
- {
1182
- label: ",",
1183
- value: ","
1184
- },
1185
- {
1186
- label: ".",
1187
- value: "."
1188
- },
1174
+ label: "none",
1175
+ value: ""
1176
+ },
1177
+ {
1178
+ label: "space",
1179
+ value: " "
1180
+ },
1181
+ {
1182
+ label: ",",
1183
+ value: ","
1184
+ },
1185
+ {
1186
+ label: ".",
1187
+ value: "."
1188
+ },
1189
1189
  ],
1190
1190
  decimalSeparators: [{
1191
- label: ",",
1192
- value: ","
1193
- },
1194
- {
1195
- label: ".",
1196
- value: "."
1197
- },
1191
+ label: ",",
1192
+ value: ","
1193
+ },
1194
+ {
1195
+ label: ".",
1196
+ value: "."
1197
+ },
1198
1198
  ],
1199
1199
  decimalPlaces: [{
1200
- label: "none",
1201
- value: -1
1202
- },
1203
- {
1204
- label: "0",
1205
- value: 0
1206
- },
1207
- {
1208
- label: "1",
1209
- value: 1
1210
- },
1211
- {
1212
- label: "2",
1213
- value: 2
1214
- },
1215
- {
1216
- label: "3",
1217
- value: 3
1218
- },
1219
- {
1220
- label: "4",
1221
- value: 4
1222
- },
1223
- {
1224
- label: "5",
1225
- value: 5
1226
- },
1227
- {
1228
- label: "6",
1229
- value: 6
1230
- },
1231
- {
1232
- label: "7",
1233
- value: 7
1234
- },
1235
- {
1236
- label: "8",
1237
- value: 8
1238
- },
1239
- {
1240
- label: "9",
1241
- value: 9
1242
- },
1200
+ label: "none",
1201
+ value: -1
1202
+ },
1203
+ {
1204
+ label: "0",
1205
+ value: 0
1206
+ },
1207
+ {
1208
+ label: "1",
1209
+ value: 1
1210
+ },
1211
+ {
1212
+ label: "2",
1213
+ value: 2
1214
+ },
1215
+ {
1216
+ label: "3",
1217
+ value: 3
1218
+ },
1219
+ {
1220
+ label: "4",
1221
+ value: 4
1222
+ },
1223
+ {
1224
+ label: "5",
1225
+ value: 5
1226
+ },
1227
+ {
1228
+ label: "6",
1229
+ value: 6
1230
+ },
1231
+ {
1232
+ label: "7",
1233
+ value: 7
1234
+ },
1235
+ {
1236
+ label: "8",
1237
+ value: 8
1238
+ },
1239
+ {
1240
+ label: "9",
1241
+ value: 9
1242
+ },
1243
1243
  ],
1244
1244
  positiveCurrencyFormats: [{
1245
- label: "$1",
1246
- value: "$1"
1247
- },
1248
- {
1249
- label: "1$",
1250
- value: "1$"
1251
- },
1245
+ label: "$1",
1246
+ value: "$1"
1247
+ },
1248
+ {
1249
+ label: "1$",
1250
+ value: "1$"
1251
+ },
1252
1252
  ],
1253
1253
  negativeCurrencyFormats: [{
1254
- label: "-$1",
1255
- value: "-$1"
1256
- },
1257
- {
1258
- label: "-1$",
1259
- value: "-1$"
1260
- },
1261
- {
1262
- label: "$-1",
1263
- value: "$-1"
1264
- },
1265
- {
1266
- label: "$1-",
1267
- value: "$1-"
1268
- },
1269
- {
1270
- label: "1-$",
1271
- value: "1-$"
1272
- },
1273
- {
1274
- label: "1$-",
1275
- value: "1$-"
1276
- },
1277
- {
1278
- label: "($1)",
1279
- value: "($1)"
1280
- },
1281
- {
1282
- label: "(1$)",
1283
- value: "(1$)"
1284
- },
1254
+ label: "-$1",
1255
+ value: "-$1"
1256
+ },
1257
+ {
1258
+ label: "-1$",
1259
+ value: "-1$"
1260
+ },
1261
+ {
1262
+ label: "$-1",
1263
+ value: "$-1"
1264
+ },
1265
+ {
1266
+ label: "$1-",
1267
+ value: "$1-"
1268
+ },
1269
+ {
1270
+ label: "1-$",
1271
+ value: "1-$"
1272
+ },
1273
+ {
1274
+ label: "1$-",
1275
+ value: "1$-"
1276
+ },
1277
+ {
1278
+ label: "($1)",
1279
+ value: "($1)"
1280
+ },
1281
+ {
1282
+ label: "(1$)",
1283
+ value: "(1$)"
1284
+ },
1285
1285
  ],
1286
1286
  negativeNumberFormats: [{
1287
- label: "-1",
1288
- value: "-1"
1289
- },
1290
- {
1291
- label: "- 1",
1292
- value: "- 1"
1293
- },
1294
- {
1295
- label: "1-",
1296
- value: "1-"
1297
- },
1298
- {
1299
- label: "1 -",
1300
- value: "1 -"
1301
- },
1302
- {
1303
- label: "(1)",
1304
- value: "(1)"
1305
- },
1287
+ label: "-1",
1288
+ value: "-1"
1289
+ },
1290
+ {
1291
+ label: "- 1",
1292
+ value: "- 1"
1293
+ },
1294
+ {
1295
+ label: "1-",
1296
+ value: "1-"
1297
+ },
1298
+ {
1299
+ label: "1 -",
1300
+ value: "1 -"
1301
+ },
1302
+ {
1303
+ label: "(1)",
1304
+ value: "(1)"
1305
+ },
1306
1306
  ],
1307
1307
  isPercent: [{
1308
- label: "true_value",
1309
- value: true
1310
- },
1311
- {
1312
- label: "false_value",
1313
- value: false
1314
- },
1308
+ label: "true_value",
1309
+ value: true
1310
+ },
1311
+ {
1312
+ label: "false_value",
1313
+ value: false
1314
+ },
1315
1315
  ]
1316
1316
  }
1317
- FlexmonsterToolbar.prototype.ConfirmationPopUp = function () { }
1318
- FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1317
+ FlexmonsterToolbar.prototype.ConfirmationPopUp = function () {}
1318
+ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName, measureAggregation) {
1319
1319
  var self = this;
1320
1320
  var Labels = this.Labels;
1321
1321
  var currentFormatVO = undefined;
@@ -1410,16 +1410,16 @@ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1410
1410
  ConfirmationPopUp.prototype.initializePopUp = function () {
1411
1411
  this.dialog.setTitle(Labels.confirm_title);
1412
1412
  confirmPopUp.dialog.setToolbar([{
1413
- id: "fm-btn-apply",
1414
- label: Labels.ok,
1415
- handler: switchToMeasure,
1416
- isPositive: true
1417
- },
1418
- {
1419
- id: "fm-btn-cancel",
1420
- label: Labels.cancel,
1421
- handler: restoreEditedMeasure
1422
- }
1413
+ id: "fm-btn-apply",
1414
+ label: Labels.ok,
1415
+ handler: switchToMeasure,
1416
+ isPositive: true
1417
+ },
1418
+ {
1419
+ id: "fm-btn-cancel",
1420
+ label: Labels.cancel,
1421
+ handler: restoreEditedMeasure
1422
+ }
1423
1423
  ], false, this.removePopUp);
1424
1424
  var content = document.createElement("div");
1425
1425
  var contentLabel = document.createElement("label");
@@ -1461,8 +1461,8 @@ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1461
1461
  var formatObject = {};
1462
1462
  formatObject = filterFormatting(formatObject);
1463
1463
  if ((formatObject.hasOwnProperty("textAlign") || formatObject.hasOwnProperty("thousandsSeparator") || formatObject.hasOwnProperty("decimalSeparator") ||
1464
- formatObject.hasOwnProperty("decimalPlaces") || formatObject.hasOwnProperty("currencySymbol") || formatObject.hasOwnProperty("positiveCurrencyFormat") ||
1465
- formatObject.hasOwnProperty("negativeCurrencyFormat") || formatObject.hasOwnProperty("nullValue") || formatObject.hasOwnProperty("isPercent")) &&
1464
+ formatObject.hasOwnProperty("decimalPlaces") || formatObject.hasOwnProperty("currencySymbol") || formatObject.hasOwnProperty("positiveCurrencyFormat") ||
1465
+ formatObject.hasOwnProperty("negativeCurrencyFormat") || formatObject.hasOwnProperty("nullValue") || formatObject.hasOwnProperty("isPercent")) &&
1466
1466
  (currentMeasureNames && currentMeasureNames.length > 0)) {
1467
1467
  confirmPopUp.createPopUp();
1468
1468
  confirmPopUp.initializePopUp();
@@ -1518,7 +1518,10 @@ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1518
1518
  var switchToMeasure = function () {
1519
1519
  validateForm();
1520
1520
  currentMeasureNames = valuesDropDown.getValue();
1521
- var formatVO = self.pivot.getFormat(currentMeasureNames ? currentMeasureNames[0] : null);
1521
+ var currentMeasure = currentMeasureNames ? getMeasureFromUniqueName(currentMeasureNames[0]) : null;
1522
+ var formatVO = currentMeasure ?
1523
+ self.pivot.getFormat(currentMeasure[0], currentMeasure[1]) :
1524
+ self.pivot.getFormat(null);
1522
1525
  currentFormatVO = formatVO;
1523
1526
 
1524
1527
  applyStringDataMode(isStringDataMode());
@@ -1567,9 +1570,11 @@ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1567
1570
  }
1568
1571
  filterFormatting(formatVO);
1569
1572
  currentFormatVO = undefined;
1570
- var measures = valuesDropDown.getValue();
1571
- for (var i = 0; i < measures.length; i++) {
1572
- self.pivot.setFormat(formatVO, (measures[i] == "" ? null : measures[i]));
1573
+ var measuresList = valuesDropDown.getValue();
1574
+ var measure = null;
1575
+ for (var i = 0; i < measuresList.length; i++) {
1576
+ measure = getMeasureFromUniqueName(measuresList[i]);
1577
+ self.pivot.setFormat(formatVO, (measure[0] == "" ? null : measure[0]), measure[1]);
1573
1578
  }
1574
1579
  // if (valuesDropDown.getValue() === "" && currentReport.hasOwnProperty("formats")) {
1575
1580
  // var reportMeasures = currentReport.slice.measures;
@@ -1582,21 +1587,42 @@ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1582
1587
  self.pivot.refresh();
1583
1588
  }
1584
1589
 
1590
+ var MEASURE_UNIQUENAME_DELIMETER = "_@@_@@_@@_";
1591
+ //generates uniqueName based on measure's uniqueName and aggregation
1592
+ var getMeasureUniqueName = function (uniqueName, aggregation) {
1593
+ return uniqueName + MEASURE_UNIQUENAME_DELIMETER + aggregation;
1594
+ }
1595
+
1596
+ //generates measure tuple (uniqueName and aggregation) based on getMeasureUniqueName result
1597
+ var getMeasureFromUniqueName = function (uniqueName) {
1598
+ return uniqueName.split(MEASURE_UNIQUENAME_DELIMETER, 2);
1599
+ }
1600
+
1601
+ var getDropDownLabel = function (measure) {
1602
+ var aggregationLabelIndex = measure.availableAggregations.indexOf(measure.aggregation);
1603
+ var aggregation = aggregationLabelIndex === -1 || measure.aggregation === "none" || measure.calculated ?
1604
+ null :
1605
+ measure.availableAggregationsCaptions[aggregationLabelIndex];
1606
+ return aggregation === null ?
1607
+ measure.name :
1608
+ measure.name + " (" + aggregation + ")";
1609
+ }
1610
+
1585
1611
  var dialog = this.popupManager.createPopup();
1586
1612
  var confirmPopUp = new ConfirmationPopUp();
1587
1613
 
1588
1614
  dialog.content.classList.add("fm-popup-format-cells");
1589
1615
  dialog.setTitle(this.osUtils.isMobile ? Labels.format : Labels.format_cells);
1590
1616
  dialog.setToolbar([{
1591
- id: "fm-btn-apply",
1592
- label: Labels.apply,
1593
- handler: applyHandler,
1594
- isPositive: true
1595
- },
1596
- {
1597
- id: "fm-btn-cancel",
1598
- label: Labels.cancel
1599
- }
1617
+ id: "fm-btn-apply",
1618
+ label: Labels.apply,
1619
+ handler: applyHandler,
1620
+ isPositive: true
1621
+ },
1622
+ {
1623
+ id: "fm-btn-cancel",
1624
+ label: Labels.cancel
1625
+ }
1600
1626
  ], true);
1601
1627
 
1602
1628
  var content = document.createElement("div");
@@ -1608,21 +1634,23 @@ FlexmonsterToolbar.prototype.showFormatCellsDialog = function (measureName) {
1608
1634
  value: "",
1609
1635
  label: Labels.default_value
1610
1636
  }];
1611
- var _uniqueNames = [];
1637
+ var _uniqueNames = {};
1612
1638
  var _measures = self.pivot.getMeasures();
1613
1639
  for (var i = 0; i < _measures.length; i++) {
1614
- if (_uniqueNames.indexOf(_measures[i].uniqueName) == -1) {
1615
- _uniqueNames.push(_measures[i].uniqueName);
1640
+ if (!_uniqueNames[_measures[i].uniqueName] ||
1641
+ (_uniqueNames[_measures[i].uniqueName] && !_uniqueNames[_measures[i].uniqueName][_measures[i].aggregation])) {
1642
+ if (!_uniqueNames[_measures[i].uniqueName]) _uniqueNames[_measures[i].uniqueName] = {};
1643
+ _uniqueNames[_measures[i].uniqueName][_measures[i].aggregation] = true;
1616
1644
  measuresDataProvider.push({
1617
- value: _measures[i].uniqueName,
1618
- label: _measures[i].name
1645
+ value: getMeasureUniqueName(_measures[i].uniqueName, _measures[i].aggregation),
1646
+ label: getDropDownLabel(_measures[i])
1619
1647
  });
1620
1648
  }
1621
1649
  }
1622
1650
 
1623
1651
  var valuesDropDown = this.createSelect(measuresDataProvider, Labels.choose_value, true);
1624
1652
  valuesDropDown.onchange = valuesDropDownChangeHandler;
1625
- if (measureName) valuesDropDown.setValue([measureName]);
1653
+ if (measureName && measureAggregation) valuesDropDown.setValue([getMeasureUniqueName(measureName, measureAggregation)]);
1626
1654
 
1627
1655
  var valuesRow = this.createInputRow(Labels.choose_value, valuesDropDown);
1628
1656
  valuesRow.querySelector("label").classList.add("fm-uc");
@@ -1726,25 +1754,39 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1726
1754
  var self = this;
1727
1755
  var Labels = this.Labels;
1728
1756
  var conditions = this.pivot.getAllConditions();
1757
+ var dataType = this.pivot.getReport().dataSource.type;
1758
+ var isMSAS = dataType === "microsoft analysis services" || dataType === "mondrian";
1729
1759
 
1730
1760
  var _allMeasures = self.pivot.getAllMeasures();
1731
1761
  var _measures = self.pivot.getMeasures();
1732
1762
  var _conditionsMeasuresMap = {};
1733
1763
  var _uniqueNames = [];
1764
+ var _measureWithAggregations = {};
1734
1765
  var measures = [];
1735
1766
 
1736
- for (var i = 0; i < conditions.length; i++) {// creating a map where the key is measure's uniqueName for which the condition is defined
1767
+ var MEASURE_UNIQUENAME_DELIMETER = "_@@_@@_@@_";
1768
+ //generates uniqueName based on measure's uniqueName and aggregation
1769
+ var getMeasureUniqueName = function (measure) {
1770
+ return measure.uniqueName + MEASURE_UNIQUENAME_DELIMETER + measure.aggregation;
1771
+ }
1772
+
1773
+ for (var i = 0; i < conditions.length; i++) { // creating a map where the key is measure's uniqueName for which the condition is defined
1737
1774
  _conditionsMeasuresMap[conditions[i].measure] = 1;
1738
1775
  }
1739
- for (var i = 0; i < _allMeasures.length; i++) {// adding all the measures for which the condition is defined to the dropdown the list
1740
- if (_conditionsMeasuresMap[_allMeasures[i].uniqueName] === 1) {
1776
+ for (var i = 0; i < _allMeasures.length; i++) { // adding all the measures for which the condition is defined to the dropdown the list
1777
+ var uniqueName = isMSAS ? _allMeasures[i].uniqueName : getMeasureUniqueName(_allMeasures[i]);
1778
+ if (_conditionsMeasuresMap[_allMeasures[i].uniqueName] === 1 && _measureWithAggregations[uniqueName] === undefined) {
1779
+ _measureWithAggregations[uniqueName] = 1;
1741
1780
  _uniqueNames.push(_allMeasures[i].uniqueName);
1742
1781
  measures.push(_allMeasures[i]);
1743
1782
  }
1744
1783
  }
1745
- for (var i = 0; i < _measures.length; i++) {// adding all the measures from the slice.measures list to the dropdown the list
1746
- if (_uniqueNames.indexOf(_measures[i].uniqueName) === -1 && _measures[i].type === "number") {
1747
- _uniqueNames.push(_measures[i].uniqueName);
1784
+ for (var i = 0; i < _measures.length; i++) { // adding all the measures from the slice.measures list to the dropdown the list
1785
+ var uniqueName = isMSAS ? _measures[i].uniqueName : getMeasureUniqueName(_measures[i]);
1786
+ if (((_measures[i].type === "number" || _measures[i].type === "float" || _measures[i].type === "long") && _measureWithAggregations[uniqueName] === undefined)
1787
+ || (_measures[i].type === undefined && _measureWithAggregations[uniqueName] === undefined)) {
1788
+ //_uniqueNames.push(_measures[i].uniqueName);
1789
+ _measureWithAggregations[uniqueName] = 1;
1748
1790
  measures.push(_measures[i]);
1749
1791
  }
1750
1792
  }
@@ -1753,11 +1795,12 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1753
1795
  _measures = undefined;
1754
1796
  _conditionsMeasuresMap = undefined;
1755
1797
  _uniqueNames = undefined;
1798
+ _measureWithAggregations = undefined;
1756
1799
 
1757
1800
  var applyHandler = function () {
1758
1801
  self.pivot.removeAllConditions();
1759
1802
  for (var i = 0; i < conditions.length; i++) {
1760
- var formula = composeFormula(conditions[i].sign, conditions[i].value1, conditions[i].value2);
1803
+ var formula = composeFormula(conditions[i].sign, conditions[i].value1, conditions[i].value2, [conditions[i].measure, conditions[i].aggregation]);
1761
1804
  if (formula == null) return;
1762
1805
  conditions[i].formula = formula;
1763
1806
  self.pivot.addCondition(conditions[i]);
@@ -1777,7 +1820,7 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1777
1820
  }
1778
1821
  };
1779
1822
  conditions.unshift(condition);
1780
- var item = self.createConditionalFormattingItem(condition, conditions);
1823
+ var item = self.createConditionalFormattingItem(condition, conditions, isMSAS);
1781
1824
  content.insertBefore(item, content.firstChild);
1782
1825
  item.focus();
1783
1826
  content.scrollTop = 0;
@@ -1786,25 +1829,27 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1786
1829
  }
1787
1830
  self.popupManager.centerPopup(dialog.content);
1788
1831
  };
1789
- var composeFormula = function (sign, value1, value2) {
1832
+
1833
+ var composeFormula = function (sign, value1, value2, measureWithAggregation) {
1790
1834
  var formula = '';
1791
1835
  var firstValueEmpty = (value1 == null || value1.length == 0);
1792
1836
  var secondValueEmpty = (value2 == null || value2.length == 0);
1793
1837
  var isBetween = (sign === '><');
1794
1838
  var isEmpty = (sign === 'isNaN');
1839
+ var value = "#value";
1795
1840
  if ((firstValueEmpty && !isEmpty) || (isBetween && secondValueEmpty)) {
1796
1841
  return formula;
1797
1842
  }
1798
1843
  if (isBetween && !secondValueEmpty) {
1799
- formula = "AND(#value > " + value1 + ", #value < " + value2 + ")";
1844
+ formula = "AND(" + value + " > " + value1 + ", " + value + " < " + value2 + ")";
1800
1845
  } else if (isEmpty) {
1801
- formula = "isNaN(#value)";
1846
+ formula = "isNaN(" + value + ")";
1802
1847
  } else {
1803
1848
  var isString = isNaN(parseFloat(value1));
1804
1849
  if (isString) {
1805
1850
  value1 = "'" + value1 + "'";
1806
1851
  }
1807
- formula = "#value " + sign + " " + value1;
1852
+ formula = value + " " + sign + " " + value1;
1808
1853
  }
1809
1854
  return formula;
1810
1855
  };
@@ -1828,11 +1873,22 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1828
1873
  }
1829
1874
  return output;
1830
1875
  };
1876
+ var filterNumbers = function (numbersList) {
1877
+ if (!numbersList) return numbersList;
1878
+ var filteredNumbers = [];
1879
+ for (var i = 0; i < numbersList.length; i++) {
1880
+ if (!isNaN(Number(numbersList[i]))) {
1881
+ filteredNumbers.push(numbersList[i]);
1882
+ }
1883
+ }
1884
+ return filteredNumbers;
1885
+ }
1831
1886
  var parseFormula = function (formula) {
1832
1887
  var parseNumber = /\W\d+\.*\d*/g;
1833
1888
  var parseSign = /<=|>=|<|>|=|=|!=|isNaN/g;
1834
- var numbers = formula.match(parseNumber);
1835
1889
  var strings = parseStrings(formula);
1890
+ var numbers = formula.match(parseNumber);
1891
+ numbers = filterNumbers(numbers);
1836
1892
  var signs = formula.match(parseSign);
1837
1893
  if (numbers == null && strings == null) return {};
1838
1894
  return {
@@ -1845,15 +1901,15 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1845
1901
  dialog.content.classList.add("fm-popup-conditional");
1846
1902
  dialog.setTitle(this.osUtils.isMobile ? Labels.conditional : Labels.conditional_formatting);
1847
1903
  dialog.setToolbar([{
1848
- id: "fm-btn-apply",
1849
- label: Labels.apply,
1850
- handler: applyHandler,
1851
- isPositive: true
1852
- },
1853
- {
1854
- id: "fm-btn-cancel",
1855
- label: Labels.cancel
1856
- }
1904
+ id: "fm-btn-apply",
1905
+ label: Labels.apply,
1906
+ handler: applyHandler,
1907
+ isPositive: true
1908
+ },
1909
+ {
1910
+ id: "fm-btn-cancel",
1911
+ label: Labels.cancel
1912
+ }
1857
1913
  ], true);
1858
1914
 
1859
1915
  var addConditionBtn = document.createElement("button");
@@ -1909,7 +1965,7 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1909
1965
  conditions[i].value2 = formula.value2;
1910
1966
  conditions[i].sign = formula.sign;
1911
1967
  conditions[i].measures = measures;
1912
- content.appendChild(self.createConditionalFormattingItem(conditions[i], conditions));
1968
+ content.appendChild(self.createConditionalFormattingItem(conditions[i], conditions, isMSAS));
1913
1969
  }
1914
1970
  if (conditions.length > 0) {
1915
1971
  placeholder.style.display = "none";
@@ -1921,56 +1977,90 @@ FlexmonsterToolbar.prototype.showConditionalFormattingDialog = function (measure
1921
1977
  FlexmonsterToolbar.prototype.defaults.fontSizes = ["8px", "9px", "10px", "11px", "12px", "13px", "14px"];
1922
1978
  FlexmonsterToolbar.prototype.defaults.fonts = ['Arial', 'Lucida Sans Unicode', 'Verdana', 'Courier New', 'Palatino Linotype', 'Tahoma', 'Impact', 'Trebuchet MS', 'Georgia', 'Times New Roman'];
1923
1979
  FlexmonsterToolbar.prototype.defaults.conditions = [{
1924
- label: "less_than",
1925
- value: '<'
1926
- },
1927
- {
1928
- label: "less_than_or_equal",
1929
- value: '<='
1930
- },
1931
- {
1932
- label: "greater_than",
1933
- value: '>'
1934
- },
1935
- {
1936
- label: "greater_than_or_equal",
1937
- value: '>='
1938
- },
1939
- {
1940
- label: "equal_to",
1941
- value: '='
1942
- },
1943
- {
1944
- label: "not_equal_to",
1945
- value: '!='
1946
- },
1947
- {
1948
- label: "between",
1949
- value: '><'
1950
- },
1951
- {
1952
- label: "is_empty",
1953
- value: 'isNaN'
1954
- }
1980
+ label: "less_than",
1981
+ value: '<'
1982
+ },
1983
+ {
1984
+ label: "less_than_or_equal",
1985
+ value: '<='
1986
+ },
1987
+ {
1988
+ label: "greater_than",
1989
+ value: '>'
1990
+ },
1991
+ {
1992
+ label: "greater_than_or_equal",
1993
+ value: '>='
1994
+ },
1995
+ {
1996
+ label: "equal_to",
1997
+ value: '='
1998
+ },
1999
+ {
2000
+ label: "not_equal_to",
2001
+ value: '!='
2002
+ },
2003
+ {
2004
+ label: "between",
2005
+ value: '><'
2006
+ },
2007
+ {
2008
+ label: "is_empty",
2009
+ value: 'isNaN'
2010
+ }
1955
2011
  ];
1956
- FlexmonsterToolbar.prototype.createConditionalFormattingItem = function (data, allConditions) {
2012
+ FlexmonsterToolbar.prototype.createConditionalFormattingItem = function (data, allConditions, isMSAS) {
1957
2013
  var self = this;
1958
2014
  var Labels = this.Labels;
2015
+ var _isMSAS = isMSAS;
2016
+
2017
+ var MEASURE_UNIQUENAME_DELIMETER = "_@@_@@_@@_";
2018
+ //generates uniqueName based on measure's uniqueName and aggregation
2019
+ var getMeasureUniqueName = function (uniqueName, aggregation) {
2020
+ return _isMSAS || aggregation === "none" || aggregation === "" ? uniqueName : uniqueName + MEASURE_UNIQUENAME_DELIMETER + aggregation;
2021
+ }
2022
+ //generates measure tuple (uniqueName and aggregation) based on getMeasureUniqueName result
2023
+ var getMeasureFromUniqueName = function (uniqueName) {
2024
+ return uniqueName.split(MEASURE_UNIQUENAME_DELIMETER, 2);
2025
+ }
1959
2026
 
1960
- function fillValuesDropDown(measures, selectedMeasure) {
2027
+ var getDropDownLabel = function (measure) {
2028
+ var aggregationLabelIndex = measure.availableAggregations.indexOf(measure.aggregation);
2029
+ var aggregation = aggregationLabelIndex === -1 || measure.aggregation === "none" || measure.calculated ?
2030
+ null :
2031
+ measure.availableAggregationsCaptions[aggregationLabelIndex];
2032
+ return aggregation === null || _isMSAS ?
2033
+ measure.name :
2034
+ measure.name + " (" + aggregation + ")";
2035
+ }
2036
+
2037
+ function fillValuesDropDown(measures, selectedMeasure, selectedMeasureAggregation) {
1961
2038
  var options = self.pivot.getOptions() || {};
2039
+ var currentMeasure = measures.filter(function (measure) {
2040
+ return measure.uniqueName === selectedMeasure
2041
+ }).pop();
1962
2042
  var isFlatTable = (options.grid && options.grid.type == "flat");
1963
2043
  var dataProvider = [{
1964
2044
  label: Labels.all_values,
1965
2045
  value: ""
1966
2046
  }];
2047
+ if (selectedMeasure && selectedMeasureAggregation === "" && (currentMeasure && !currentMeasure.calculated) && !isMSAS) {
2048
+ var measureItemList = measures.filter(function(item) {
2049
+ return item.uniqueName === selectedMeasure;
2050
+ });
2051
+ var selectedMeasureLabel = measureItemList.length > 0 ? measureItemList[0].name + " (" + Labels.all + ")" : selectedMeasure + " (" + Labels.all + ")";
2052
+ dataProvider.push({
2053
+ label: selectedMeasureLabel,
2054
+ value: selectedMeasure
2055
+ });
2056
+ }
1967
2057
  for (var i = 0; i < measures.length; i++) {
1968
2058
  if (isFlatTable && measures[i].type == 7) { // count measure
1969
2059
  continue;
1970
2060
  }
1971
2061
  dataProvider.push({
1972
- label: measures[i].name,
1973
- value: measures[i].uniqueName
2062
+ label: getDropDownLabel(measures[i]),
2063
+ value: getMeasureUniqueName(measures[i].uniqueName, measures[i].aggregation)
1974
2064
  })
1975
2065
  // backward compatibility with 2.1
1976
2066
  if (selectedMeasure == "[Measures].[" + measures[i].uniqueName + "]") {
@@ -1978,7 +2068,9 @@ FlexmonsterToolbar.prototype.createConditionalFormattingItem = function (data, a
1978
2068
  }
1979
2069
  }
1980
2070
  valuesDropDown.setDataProvider(dataProvider);
1981
- valuesDropDown.setValue(selectedMeasure ? selectedMeasure : dataProvider[0].value);
2071
+ valuesDropDown.setValue(selectedMeasure && selectedMeasureAggregation !== undefined
2072
+ ? getMeasureUniqueName(selectedMeasure, selectedMeasureAggregation)
2073
+ : (selectedMeasure ? selectedMeasure : dataProvider[0].value));
1982
2074
  };
1983
2075
 
1984
2076
  function applyLabels(dataProvider) {
@@ -1990,7 +2082,9 @@ FlexmonsterToolbar.prototype.createConditionalFormattingItem = function (data, a
1990
2082
  });
1991
2083
  }
1992
2084
  var onValueChanged = function () {
1993
- data.measure = valuesDropDown.getValue();
2085
+ var measureWithAggregation = getMeasureFromUniqueName(valuesDropDown.getValue());
2086
+ data.measure = measureWithAggregation[0];
2087
+ data.aggregation = measureWithAggregation[1];
1994
2088
  };
1995
2089
  var onFontFamilyChanged = function () {
1996
2090
  if (data.format != null) {
@@ -2099,7 +2193,7 @@ FlexmonsterToolbar.prototype.createConditionalFormattingItem = function (data, a
2099
2193
  var valuesDropDown = this.createSelect();
2100
2194
  valuesDropDown.classList.add("fm-values");
2101
2195
  if (data.measures && data.measures.length > 0) {
2102
- fillValuesDropDown(data.measures, data.measure);
2196
+ fillValuesDropDown(data.measures, data.measure, data.aggregation);
2103
2197
  } else {
2104
2198
  valuesDropDown.setEnabled(false);
2105
2199
  }
@@ -2224,15 +2318,15 @@ FlexmonsterToolbar.prototype.showOptionsDialog = function () {
2224
2318
  dialog.content.classList.add("fm-popup-options");
2225
2319
  dialog.setTitle(this.osUtils.isMobile ? Labels.options : Labels.layout_options);
2226
2320
  dialog.setToolbar([{
2227
- id: "fm-btn-apply",
2228
- label: Labels.apply,
2229
- handler: applyHandler,
2230
- isPositive: true
2231
- },
2232
- {
2233
- id: "fm-btn-cancel",
2234
- label: Labels.cancel
2235
- }
2321
+ id: "fm-btn-apply",
2322
+ label: Labels.apply,
2323
+ handler: applyHandler,
2324
+ isPositive: true
2325
+ },
2326
+ {
2327
+ id: "fm-btn-cancel",
2328
+ label: Labels.cancel
2329
+ }
2236
2330
  ], true);
2237
2331
 
2238
2332
  var content = document.createElement("div");
@@ -2348,15 +2442,15 @@ FlexmonsterToolbar.prototype.showExportPdfDialog = function () {
2348
2442
  var dialog = this.popupManager.createPopup();
2349
2443
  dialog.setTitle(Labels.choose_page_orientation);
2350
2444
  dialog.setToolbar([{
2351
- id: "fm-btn-apply",
2352
- label: Labels.apply,
2353
- handler: applyHandler,
2354
- isPositive: true
2355
- },
2356
- {
2357
- id: "fm-btn-cancel",
2358
- label: Labels.cancel
2359
- }
2445
+ id: "fm-btn-apply",
2446
+ label: Labels.apply,
2447
+ handler: applyHandler,
2448
+ isPositive: true
2449
+ },
2450
+ {
2451
+ id: "fm-btn-cancel",
2452
+ label: Labels.cancel
2453
+ }
2360
2454
  ]);
2361
2455
 
2362
2456
  var content = document.createElement("div");
@@ -2531,7 +2625,7 @@ FlexmonsterToolbar.prototype.makeSelectableByKeyboard = function (element) {
2531
2625
  if (document.activeElement !== element) {
2532
2626
  return;
2533
2627
  }
2534
- if (e.which == 13 /*enter*/ || e.which == 32 /*space*/) {
2628
+ if (e.which == 13 /*enter*/ || e.which == 32 /*space*/ ) {
2535
2629
  element.click();
2536
2630
  var el = element.querySelector("input");
2537
2631
  if (el) {
@@ -3068,7 +3162,7 @@ FlexmonsterToolbar.prototype.createTabMenu = function (dataProvider, parentTab)
3068
3162
  setActiveItemAt(e.keyCode == 40 ? _activeItemIndex + 1 : _activeItemIndex - 1);
3069
3163
  e.preventDefault();
3070
3164
  }
3071
- if (e.keyCode == 13 /*enter*/ || e.keyCode == 32 /*space*/) {
3165
+ if (e.keyCode == 13 /*enter*/ || e.keyCode == 32 /*space*/ ) {
3072
3166
  if (_isOpen) {
3073
3167
  if (_activeItemIndex >= 0) {
3074
3168
  var data = dataProvider[_activeItemIndex];
@@ -3083,7 +3177,7 @@ FlexmonsterToolbar.prototype.createTabMenu = function (dataProvider, parentTab)
3083
3177
  e.preventDefault();
3084
3178
  }
3085
3179
  }
3086
- if (_isOpen && e.keyCode == 27 /*esc*/) {
3180
+ if (_isOpen && e.keyCode == 27 /*esc*/ ) {
3087
3181
  hide();
3088
3182
  e.stopImmediatePropagation();
3089
3183
  }