@easyquery/ui 7.2.3-rc03 → 7.2.4-beta03
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.
- package/dist/browser/eq.community.css.map +1 -1
- package/dist/browser/eq.community.js +32587 -34146
- package/dist/browser/eq.community.js.map +1 -1
- package/dist/browser/eq.community.min.js +1 -9
- package/dist/browser/eq.community.min.js.map +1 -1
- package/dist/browser/eq.core.css +17 -112
- package/dist/browser/eq.core.min.css +3 -10
- package/dist/browser/eq.view.css +1 -1
- package/dist/browser/eq.view.css.map +1 -1
- package/dist/browser/eq.view.min.css +1 -10
- package/dist/bundles/easyquery.ui.js +23032 -22870
- package/dist/bundles/easyquery.ui.js.map +1 -1
- package/dist/bundles/easyquery.ui.min.js +1 -1
- package/dist/bundles/easyquery.ui.min.js.map +1 -1
- package/dist/lib/dialog/aggr_settings_dialog.d.ts +12 -12
- package/dist/lib/dialog/aggr_settings_dialog.js +106 -106
- package/dist/lib/dialog/export_dialog.d.ts +7 -7
- package/dist/lib/dialog/export_dialog.js +63 -63
- package/dist/lib/extensions.d.ts +7 -7
- package/dist/lib/extensions.js +13 -13
- package/dist/lib/facets/chart_facet.d.ts +21 -21
- package/dist/lib/facets/chart_facet.js +240 -238
- package/dist/lib/facets/chart_facet.js.map +1 -1
- package/dist/lib/facets/datatable_facet.d.ts +15 -15
- package/dist/lib/facets/datatable_facet.js +71 -69
- package/dist/lib/facets/datatable_facet.js.map +1 -1
- package/dist/lib/facets/pivot_table_facet.d.ts +51 -51
- package/dist/lib/facets/pivot_table_facet.js +698 -696
- package/dist/lib/facets/pivot_table_facet.js.map +1 -1
- package/dist/lib/facets/result_facet.d.ts +40 -40
- package/dist/lib/facets/result_facet.js +246 -246
- package/dist/lib/facets/result_facet.js.map +1 -1
- package/dist/lib/i18n/text_resources.d.ts +1 -1
- package/dist/lib/i18n/text_resources.js +260 -259
- package/dist/lib/i18n/text_resources.js.map +1 -1
- package/dist/lib/public_api.d.ts +61 -61
- package/dist/lib/public_api.js +92 -90
- package/dist/lib/public_api.js.map +1 -1
- package/dist/lib/types/facet_type.d.ts +5 -5
- package/dist/lib/types/facet_type.js +6 -6
- package/dist/lib/types/qp_editable_part.d.ts +15 -15
- package/dist/lib/types/qp_editable_part.js +16 -16
- package/dist/lib/utils/browser_utils.d.ts +8 -8
- package/dist/lib/utils/browser_utils.js +58 -58
- package/dist/lib/utils/display_format_parser.d.ts +11 -11
- package/dist/lib/utils/display_format_parser.js +61 -61
- package/dist/lib/utils/dropdown.d.ts +11 -11
- package/dist/lib/utils/dropdown.js +57 -55
- package/dist/lib/utils/dropdown.js.map +1 -1
- package/dist/lib/utils/popup_menu.d.ts +163 -163
- package/dist/lib/utils/popup_menu.js +1259 -1260
- package/dist/lib/utils/popup_menu.js.map +1 -1
- package/dist/lib/utils/utils.d.ts +9 -9
- package/dist/lib/utils/utils.js +46 -46
- package/dist/lib/utils/utils.js.map +1 -1
- package/dist/lib/views/adv_search_view.d.ts +95 -95
- package/dist/lib/views/adv_search_view.js +712 -710
- package/dist/lib/views/adv_search_view.js.map +1 -1
- package/dist/lib/views/data_filter_view.d.ts +17 -17
- package/dist/lib/views/data_filter_view.js +79 -77
- package/dist/lib/views/data_filter_view.js.map +1 -1
- package/dist/lib/views/html_data_filter_view.d.ts +19 -19
- package/dist/lib/views/html_data_filter_view.js +44 -42
- package/dist/lib/views/html_data_filter_view.js.map +1 -1
- package/dist/lib/views/report_view.d.ts +173 -173
- package/dist/lib/views/report_view.js +733 -731
- package/dist/lib/views/report_view.js.map +1 -1
- package/dist/lib/views/view.d.ts +149 -149
- package/dist/lib/views/view.js +538 -538
- package/dist/lib/views/view.js.map +1 -1
- package/dist/lib/views/view_options.d.ts +113 -113
- package/dist/lib/views/view_options.js +1 -0
- package/dist/lib/widgets/aggregation_bar.d.ts +30 -30
- package/dist/lib/widgets/aggregation_bar.js +145 -143
- package/dist/lib/widgets/aggregation_bar.js.map +1 -1
- package/dist/lib/widgets/charts/chart_type.d.ts +14 -14
- package/dist/lib/widgets/charts/chart_type.js +15 -15
- package/dist/lib/widgets/charts/chart_widget.d.ts +92 -92
- package/dist/lib/widgets/charts/chart_widget.js +384 -382
- package/dist/lib/widgets/charts/chart_widget.js.map +1 -1
- package/dist/lib/widgets/charts/chart_widget_chartjs.d.ts +23 -23
- package/dist/lib/widgets/charts/chart_widget_chartjs.js +186 -184
- package/dist/lib/widgets/charts/chart_widget_chartjs.js.map +1 -1
- package/dist/lib/widgets/charts/chart_widget_google.d.ts +23 -23
- package/dist/lib/widgets/charts/chart_widget_google.js +165 -163
- package/dist/lib/widgets/charts/chart_widget_google.js.map +1 -1
- package/dist/lib/widgets/columns_bar.d.ts +64 -64
- package/dist/lib/widgets/columns_bar.js +722 -721
- package/dist/lib/widgets/columns_bar.js.map +1 -1
- package/dist/lib/widgets/columns_panel.d.ts +64 -62
- package/dist/lib/widgets/columns_panel.js +739 -721
- package/dist/lib/widgets/columns_panel.js.map +1 -1
- package/dist/lib/widgets/easy_grid_widget.d.ts +38 -38
- package/dist/lib/widgets/easy_grid_widget.js +229 -227
- package/dist/lib/widgets/easy_grid_widget.js.map +1 -1
- package/dist/lib/widgets/entities_panel.d.ts +49 -49
- package/dist/lib/widgets/entities_panel.js +627 -625
- package/dist/lib/widgets/entities_panel.js.map +1 -1
- package/dist/lib/widgets/eq_result_html_grid.d.ts +32 -32
- package/dist/lib/widgets/eq_result_html_grid.js +185 -183
- package/dist/lib/widgets/eq_result_html_grid.js.map +1 -1
- package/dist/lib/widgets/export_widget.d.ts +10 -10
- package/dist/lib/widgets/export_widget.js +57 -55
- package/dist/lib/widgets/export_widget.js.map +1 -1
- package/dist/lib/widgets/facet_container.d.ts +12 -12
- package/dist/lib/widgets/facet_container.js +53 -51
- package/dist/lib/widgets/facet_container.js.map +1 -1
- package/dist/lib/widgets/filter_bar.d.ts +38 -38
- package/dist/lib/widgets/filter_bar.js +259 -257
- package/dist/lib/widgets/filter_bar.js.map +1 -1
- package/dist/lib/widgets/grid.d.ts +35 -35
- package/dist/lib/widgets/grid.js +79 -77
- package/dist/lib/widgets/grid.js.map +1 -1
- package/dist/lib/widgets/html_content_widget.d.ts +35 -35
- package/dist/lib/widgets/html_content_widget.js +71 -69
- package/dist/lib/widgets/html_content_widget.js.map +1 -1
- package/dist/lib/widgets/locale_widget.d.ts +16 -16
- package/dist/lib/widgets/locale_widget.js +79 -77
- package/dist/lib/widgets/locale_widget.js.map +1 -1
- package/dist/lib/widgets/manage_drilldown_widget.d.ts +18 -18
- package/dist/lib/widgets/manage_drilldown_widget.js +154 -152
- package/dist/lib/widgets/manage_drilldown_widget.js.map +1 -1
- package/dist/lib/widgets/process_widget.d.ts +21 -21
- package/dist/lib/widgets/process_widget.js +50 -48
- package/dist/lib/widgets/process_widget.js.map +1 -1
- package/dist/lib/widgets/query_panel.d.ts +62 -58
- package/dist/lib/widgets/query_panel.js +675 -653
- package/dist/lib/widgets/query_panel.js.map +1 -1
- package/dist/lib/widgets/queryname_widget.d.ts +27 -27
- package/dist/lib/widgets/queryname_widget.js +109 -107
- package/dist/lib/widgets/queryname_widget.js.map +1 -1
- package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.d.ts +54 -54
- package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.js +429 -429
- package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/base_element_renderer.d.ts +15 -15
- package/dist/lib/widgets/renderers/base_element_renderer.js +63 -63
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.d.ts +11 -11
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js +62 -60
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.d.ts +53 -53
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js +550 -550
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/simple_column_renderer.d.ts +9 -9
- package/dist/lib/widgets/renderers/columnsbar/simple_column_renderer.js +79 -77
- package/dist/lib/widgets/renderers/columnsbar/simple_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer.d.ts +17 -17
- package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer.js +180 -178
- package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.d.ts +72 -72
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +819 -817
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.d.ts +22 -18
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js +245 -214
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/simple_column_renderer.d.ts +13 -13
- package/dist/lib/widgets/renderers/columnspanel/simple_column_renderer.js +180 -178
- package/dist/lib/widgets/renderers/columnspanel/simple_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/dropdown_renderer.d.ts +9 -9
- package/dist/lib/widgets/renderers/dropdown_renderer.js +42 -40
- package/dist/lib/widgets/renderers/dropdown_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/addrow_renderer.d.ts +16 -16
- package/dist/lib/widgets/renderers/querypanel/addrow_renderer.js +87 -85
- package/dist/lib/widgets/renderers/querypanel/addrow_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/attribute_expression_renderer.d.ts +14 -14
- package/dist/lib/widgets/renderers/querypanel/attribute_expression_renderer.js +71 -69
- package/dist/lib/widgets/renderers/querypanel/attribute_expression_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/bind_to_parent_column_expression_renderer.d.ts +7 -7
- package/dist/lib/widgets/renderers/querypanel/bind_to_parent_column_expression_renderer.js +41 -39
- package/dist/lib/widgets/renderers/querypanel/bind_to_parent_column_expression_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/condition_group_renderer.d.ts +27 -27
- package/dist/lib/widgets/renderers/querypanel/condition_group_renderer.js +231 -229
- package/dist/lib/widgets/renderers/querypanel/condition_group_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/condition_renderer.d.ts +48 -48
- package/dist/lib/widgets/renderers/querypanel/condition_renderer.js +509 -507
- package/dist/lib/widgets/renderers/querypanel/condition_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/datetime_expression_render.d.ts +13 -13
- package/dist/lib/widgets/renderers/querypanel/datetime_expression_render.js +108 -106
- package/dist/lib/widgets/renderers/querypanel/datetime_expression_render.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/expression_renderer.d.ts +28 -28
- package/dist/lib/widgets/renderers/querypanel/expression_renderer.js +91 -89
- package/dist/lib/widgets/renderers/querypanel/expression_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/input_expression_renderer.d.ts +14 -14
- package/dist/lib/widgets/renderers/querypanel/input_expression_renderer.js +165 -163
- package/dist/lib/widgets/renderers/querypanel/input_expression_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/list_expression_renderer.d.ts +35 -35
- package/dist/lib/widgets/renderers/querypanel/list_expression_renderer.js +317 -315
- package/dist/lib/widgets/renderers/querypanel/list_expression_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/operator_renderer.d.ts +19 -19
- package/dist/lib/widgets/renderers/querypanel/operator_renderer.js +95 -93
- package/dist/lib/widgets/renderers/querypanel/operator_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/subquery_expression_renderer.d.ts +27 -27
- package/dist/lib/widgets/renderers/querypanel/subquery_expression_renderer.js +237 -235
- package/dist/lib/widgets/renderers/querypanel/subquery_expression_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/text_renderer.d.ts +11 -11
- package/dist/lib/widgets/renderers/querypanel/text_renderer.js +36 -36
- package/dist/lib/widgets/renderers/querypanel/text_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.d.ts +26 -26
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js +163 -163
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js.map +1 -1
- package/dist/lib/widgets/result_facets_panel.d.ts +64 -64
- package/dist/lib/widgets/result_facets_panel.js +503 -501
- package/dist/lib/widgets/result_facets_panel.js.map +1 -1
- package/dist/lib/widgets/sorting_bar.d.ts +34 -34
- package/dist/lib/widgets/sorting_bar.js +330 -328
- package/dist/lib/widgets/sorting_bar.js.map +1 -1
- package/dist/lib/widgets/statement_panel.d.ts +21 -21
- package/dist/lib/widgets/statement_panel.js +60 -58
- package/dist/lib/widgets/statement_panel.js.map +1 -1
- package/dist/lib/widgets/widget_options.d.ts +433 -429
- package/dist/lib/widgets/widget_options.js +1 -0
- package/package.json +25 -25
- package/webpack.config.js +31 -24
- package/dist/browser/eq.community.min.css.map +0 -1
- package/dist/browser/eq.view.min.css.map +0 -1
|
@@ -1,732 +1,734 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
d
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_this
|
|
28
|
-
_this.
|
|
29
|
-
_this.
|
|
30
|
-
_this.
|
|
31
|
-
_this.
|
|
32
|
-
_this.
|
|
33
|
-
_this.
|
|
34
|
-
_this.
|
|
35
|
-
_this.
|
|
36
|
-
_this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_this.
|
|
45
|
-
_this.
|
|
46
|
-
_this.
|
|
47
|
-
_this.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_this.context.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|| eventData.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
var
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
var
|
|
332
|
-
|
|
333
|
-
var
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
_this.
|
|
360
|
-
|
|
361
|
-
_this.
|
|
362
|
-
_this.
|
|
363
|
-
_this.
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
var
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
var
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
if (idx
|
|
481
|
-
idx =
|
|
482
|
-
if (idx
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
*
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
li
|
|
545
|
-
li.
|
|
546
|
-
li.
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
*
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
*
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
*
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
}
|
|
731
|
-
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { WidgetGroup, QueryChangePart } from '@easyquery/core';
|
|
17
|
+
import { i18n, utils as dataUtils } from '@easydata/core';
|
|
18
|
+
import { domel } from '@easydata/ui';
|
|
19
|
+
import { browserUtils } from '../utils/browser_utils';
|
|
20
|
+
import { View } from './view';
|
|
21
|
+
/**
|
|
22
|
+
* The view that represents the "ad-hoc reporting" scenario
|
|
23
|
+
*/
|
|
24
|
+
var ReportView = /** @class */ (function (_super) {
|
|
25
|
+
__extends(ReportView, _super);
|
|
26
|
+
function ReportView() {
|
|
27
|
+
var _this = _super.call(this) || this;
|
|
28
|
+
_this.reports = [];
|
|
29
|
+
_this.reportCache = [];
|
|
30
|
+
_this.exportButtons = [];
|
|
31
|
+
_this.exportClass = "eqjs-export";
|
|
32
|
+
_this.disabledClass = "eqjs-disabled";
|
|
33
|
+
_this.enableExport = false;
|
|
34
|
+
_this.useReportCache = true;
|
|
35
|
+
_this.syncReportOnChange = true;
|
|
36
|
+
_this._reportSaveTemplate = "<div id=\"kdlg-dialog-form\" class=\"kfrm-form\">\n <div class=\"kfrm-fields label-above\">\n <label for=\"kdlg-dialog-form-input\" id=\"kdlg-dialog-form-content\"></label>\n <input type=\"text\" name=\"kdlg-dialog-form-input\" id=\"kdlg-dialog-form-input\" />\n <label for=\"kdlg-dialog-form-textarea\" id=\"kdlg-dialog-form-desc-label\"></label>\n <textarea type=\"text\" name=\"kdlg-dialog-form-textarea\" id=\"kdlg-dialog-form-textarea\"></textarea>\n </div>\n </div>";
|
|
37
|
+
_this.context.useStoredQueryOnFetch = true;
|
|
38
|
+
_this.exportButtonClickHandler = function (srcElement, e) {
|
|
39
|
+
if (!srcElement.classList.contains(_this.disabledClass)) {
|
|
40
|
+
var format = srcElement.getAttribute("data-format");
|
|
41
|
+
_this.context.exportResult({ format: format });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
_this.clearReportButtonClickHandler = _this.clearReportButtonClick.bind(_this);
|
|
45
|
+
_this.newReportButtonClickHandler = _this.newReportButtonClick.bind(_this);
|
|
46
|
+
_this.loadReportButtonClickHandler = _this.loadReportButtonClick.bind(_this);
|
|
47
|
+
_this.saveReportButtonClickHandler = _this.saveReportButtonClick.bind(_this);
|
|
48
|
+
_this.removeReportButtonClickHandler = _this.removeReportButtonClick.bind(_this);
|
|
49
|
+
_this.reloadReportDataButtonClickHandler = _this.reloadReportDataButtonClick.bind(_this);
|
|
50
|
+
browserUtils.onMobileModeChanged(function (_) {
|
|
51
|
+
document.location.reload();
|
|
52
|
+
});
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
ReportView.prototype.initOptions = function (options) {
|
|
56
|
+
options = _super.prototype.initOptions.call(this, options);
|
|
57
|
+
if (typeof (options.syncQueryOnChange) !== "undefined") {
|
|
58
|
+
this.syncReportOnChange = options.syncQueryOnChange;
|
|
59
|
+
}
|
|
60
|
+
if (typeof (options.syncReportOnChange) !== "undefined") {
|
|
61
|
+
this.syncReportOnChange = options.syncReportOnChange;
|
|
62
|
+
}
|
|
63
|
+
options.syncQueryOnChange = this.syncReportOnChange;
|
|
64
|
+
if (typeof (options.useReportCache) !== "undefined") {
|
|
65
|
+
this.useReportCache = options.useReportCache;
|
|
66
|
+
}
|
|
67
|
+
this.defaultReportId = options.defaultReportId;
|
|
68
|
+
return options;
|
|
69
|
+
};
|
|
70
|
+
ReportView.prototype.initDone = function () {
|
|
71
|
+
var _this = this;
|
|
72
|
+
_super.prototype.initDone.call(this);
|
|
73
|
+
var query = this.context.getQuery();
|
|
74
|
+
query.addChangedCallback(function (event) {
|
|
75
|
+
var eventData = event.data;
|
|
76
|
+
if (eventData) {
|
|
77
|
+
if (eventData.changeType == "query.switched") {
|
|
78
|
+
_this.context.clearResult();
|
|
79
|
+
_this.context.refreshWidgets(WidgetGroup.Result);
|
|
80
|
+
_this.context.refreshWidgets(WidgetGroup.Query);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
_this.disableExportButtons();
|
|
84
|
+
if (_this.resultCountSlot) {
|
|
85
|
+
_this.resultCountSlot.style.display = "none";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//true if we just switched the report or changed facets (query was not changed)
|
|
90
|
+
var isLiteUpdate = !eventData
|
|
91
|
+
|| eventData.changeType == "query.switched"
|
|
92
|
+
|| eventData.part == QueryChangePart.ExtraData
|
|
93
|
+
|| eventData.part == QueryChangePart.Facets;
|
|
94
|
+
var syncStarted = false;
|
|
95
|
+
if (_this.syncReportOnChange) {
|
|
96
|
+
var needSync = eventData && eventData.changeType != "query.switched" && !eventData.noSync;
|
|
97
|
+
if (needSync) {
|
|
98
|
+
syncStarted = true;
|
|
99
|
+
_this.syncReport({
|
|
100
|
+
success: function () {
|
|
101
|
+
// fetch data on query change
|
|
102
|
+
if (!isLiteUpdate && _this.viewOptions.fetchDataOnChange) {
|
|
103
|
+
_this.fetchData();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// clear dataset result on query change
|
|
110
|
+
if (!isLiteUpdate && _this.resultOptions.clearResultOnQueryChange) {
|
|
111
|
+
_this.context.clearResult();
|
|
112
|
+
_this.context.refreshWidgets(WidgetGroup.Result);
|
|
113
|
+
}
|
|
114
|
+
if (!isLiteUpdate && !syncStarted && _this.viewOptions.fetchDataOnChange) {
|
|
115
|
+
_this.fetchData();
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
window.setTimeout(function () {
|
|
119
|
+
_this.context.loadQueryList({
|
|
120
|
+
success: function (data) {
|
|
121
|
+
if (Array.isArray(data)) {
|
|
122
|
+
_this.reports = data;
|
|
123
|
+
var exists = _this.reports.filter(function (r) { return r.id == _this.defaultReportId; }).length > 0;
|
|
124
|
+
if (exists) {
|
|
125
|
+
_this.renderReportList({ reportId: _this.defaultReportId });
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
_this.renderReportList();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}, 100);
|
|
134
|
+
};
|
|
135
|
+
ReportView.prototype.initWidgets = function (options) {
|
|
136
|
+
var _this = this;
|
|
137
|
+
_super.prototype.initWidgets.call(this, options);
|
|
138
|
+
var clearReportButton = "ClearReportButton";
|
|
139
|
+
var newReportButton = "NewReportButton";
|
|
140
|
+
var loadReportButton = "LoadReportButton";
|
|
141
|
+
var saveReportButton = "SaveReportButton";
|
|
142
|
+
var removeReportButton = "RemoveReportButton";
|
|
143
|
+
var reloadReportDataButton = "ReloadReportDataButton";
|
|
144
|
+
var resultCountSpan = "ResultCount";
|
|
145
|
+
var exportButtons = "ResultExportButtons";
|
|
146
|
+
var exportClass = this.exportClass;
|
|
147
|
+
if (options.slots) {
|
|
148
|
+
resultCountSpan = options.slots.resultCountSpan || resultCountSpan;
|
|
149
|
+
exportButtons = options.slots.exportButtons || exportButtons;
|
|
150
|
+
clearReportButton = options.slots.clearReportButton || clearReportButton;
|
|
151
|
+
newReportButton = options.slots.newReportButton || newReportButton;
|
|
152
|
+
loadReportButton = options.slots.loadReportButton || loadReportButton;
|
|
153
|
+
saveReportButton = options.slots.saveReportButton || saveReportButton;
|
|
154
|
+
removeReportButton = options.slots.removeReportButton || removeReportButton;
|
|
155
|
+
reloadReportDataButton = options.slots.reloadReportDataButton || reloadReportDataButton;
|
|
156
|
+
exportClass = options.slots.exportClass || exportClass;
|
|
157
|
+
}
|
|
158
|
+
this.exportButtons = this.domRoots.reduce(function (elems, root) {
|
|
159
|
+
return elems.concat(Array.from(root.querySelectorAll(".".concat(exportClass))));
|
|
160
|
+
}, []);
|
|
161
|
+
this.enableExport = options.enableExport;
|
|
162
|
+
if (this.enableExport) {
|
|
163
|
+
//Add event listener for export buttons
|
|
164
|
+
this.exportButtons.forEach(function (button) {
|
|
165
|
+
button.addEventListener('click', _this.exportButtonClickHandler);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.hideExportButtons();
|
|
170
|
+
}
|
|
171
|
+
this.exportButtonsContainer = this.resolveElement(exportButtons);
|
|
172
|
+
if (!this.clearReportButton) {
|
|
173
|
+
this.clearReportButton = this.resolveElement(clearReportButton);
|
|
174
|
+
if (this.clearReportButton) {
|
|
175
|
+
this.clearReportButton.addEventListener('click', this.clearReportButtonClickHandler);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (!this.newReportButton) {
|
|
179
|
+
this.newReportButton = this.resolveElement(newReportButton);
|
|
180
|
+
if (this.newReportButton) {
|
|
181
|
+
this.newReportButton.addEventListener('click', this.newReportButtonClickHandler);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!this.loadReportButton) {
|
|
185
|
+
this.loadReportButton = this.resolveElement(loadReportButton);
|
|
186
|
+
if (this.loadReportButton) {
|
|
187
|
+
this.loadReportButton.addEventListener('click', this.loadReportButtonClickHandler);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (!this.saveReportButton) {
|
|
191
|
+
this.saveReportButton = this.resolveElement(saveReportButton);
|
|
192
|
+
if (this.saveReportButton) {
|
|
193
|
+
this.saveReportButton.addEventListener('click', this.saveReportButtonClickHandler);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (!this.removeReportButton) {
|
|
197
|
+
this.removeReportButton = this.resolveElement(removeReportButton);
|
|
198
|
+
if (this.removeReportButton) {
|
|
199
|
+
this.removeReportButton.addEventListener('click', this.removeReportButtonClickHandler);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (!this.reloadReportDataButton) {
|
|
203
|
+
this.reloadReportDataButton = this.resolveElement(reloadReportDataButton);
|
|
204
|
+
//OBSOLETE: remove the next 3 lines. We just support the old default button ID here
|
|
205
|
+
if (!this.reloadReportDataButton) {
|
|
206
|
+
this.reloadReportDataButton = this.resolveElement('UpdateReportButton');
|
|
207
|
+
}
|
|
208
|
+
if (this.reloadReportDataButton) {
|
|
209
|
+
this.reloadReportDataButton.addEventListener('click', this.reloadReportDataButtonClickHandler);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
this.reportListSlot = document.getElementById('ReportList');
|
|
213
|
+
this.resultCountSlot = this.resolveElement(resultCountSpan);
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Creates a new report.
|
|
217
|
+
*/
|
|
218
|
+
ReportView.prototype.newReport = function () {
|
|
219
|
+
var _this = this;
|
|
220
|
+
var ds = this.context.getServices().getDialogService();
|
|
221
|
+
var dlg = ds.open({
|
|
222
|
+
title: i18n.getText('NewReportDlgTitle'),
|
|
223
|
+
body: this._reportSaveTemplate,
|
|
224
|
+
submitable: true,
|
|
225
|
+
closable: true,
|
|
226
|
+
cancelable: true,
|
|
227
|
+
submitOnEnter: true,
|
|
228
|
+
arrangeParents: false,
|
|
229
|
+
beforeOpen: function () {
|
|
230
|
+
var input = document.getElementById("kdlg-dialog-form-input");
|
|
231
|
+
input.value = i18n.getText('NewReportDefName');
|
|
232
|
+
var content = document.getElementById('kdlg-dialog-form-content');
|
|
233
|
+
content.innerHTML = i18n.getText('SaveReportDlgLabel');
|
|
234
|
+
var label = document.getElementById('kdlg-dialog-form-desc-label');
|
|
235
|
+
label.innerHTML = i18n.getText('ReportDescLabel');
|
|
236
|
+
input.focus();
|
|
237
|
+
},
|
|
238
|
+
onSubmit: function () {
|
|
239
|
+
var nameInput = document.getElementById("kdlg-dialog-form-input");
|
|
240
|
+
var queryName = nameInput.value;
|
|
241
|
+
if (queryName && queryName.replace(/\s/g, '').length > 0) {
|
|
242
|
+
dlg.clearAlert();
|
|
243
|
+
dlg.disableButtons();
|
|
244
|
+
var header_1 = dlg.getRootElement().querySelector('header');
|
|
245
|
+
var processEl_1 = domel('div', header_1)
|
|
246
|
+
.addClass('eqjs-process-bar local')
|
|
247
|
+
.toDOM();
|
|
248
|
+
var descInput = document.getElementById("kdlg-dialog-form-textarea");
|
|
249
|
+
var queryDesc = descInput.value;
|
|
250
|
+
_this.context.newQuery({
|
|
251
|
+
name: queryName,
|
|
252
|
+
description: queryDesc,
|
|
253
|
+
success: function () {
|
|
254
|
+
dlg.close();
|
|
255
|
+
var query = _this.context.getQuery();
|
|
256
|
+
var reportId = query.getId();
|
|
257
|
+
_this.insertIntoReportList({ id: reportId, name: query.getName(), description: query.getDescription() });
|
|
258
|
+
_this.renderReportList({ reportId: reportId });
|
|
259
|
+
},
|
|
260
|
+
error: function (error) {
|
|
261
|
+
header_1.removeChild(processEl_1);
|
|
262
|
+
dlg.enableButtons();
|
|
263
|
+
dlg.showAlert(error, 'error');
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Loads report by ID.
|
|
273
|
+
* @param reportId The ID of the report to load.
|
|
274
|
+
*/
|
|
275
|
+
ReportView.prototype.loadReport = function (reportId) {
|
|
276
|
+
var _this = this;
|
|
277
|
+
if (!reportId) {
|
|
278
|
+
throw 'Empty report ID!';
|
|
279
|
+
}
|
|
280
|
+
var reportToLoad = this.findReportById(reportId);
|
|
281
|
+
if (!reportToLoad)
|
|
282
|
+
return;
|
|
283
|
+
var self = this;
|
|
284
|
+
var query = self.context.getQuery();
|
|
285
|
+
var reportLoaded = function () {
|
|
286
|
+
_this.renderReportProps();
|
|
287
|
+
_this.context.resultTable.clear();
|
|
288
|
+
query.fireChangedEvent({
|
|
289
|
+
part: QueryChangePart.All,
|
|
290
|
+
noSync: true,
|
|
291
|
+
changeType: 'query.switched'
|
|
292
|
+
});
|
|
293
|
+
_this.fetchData();
|
|
294
|
+
};
|
|
295
|
+
var reportContent = this.useReportCache ? this.getReportContentFromCache(reportToLoad) : null;
|
|
296
|
+
if (reportContent) {
|
|
297
|
+
query.clear();
|
|
298
|
+
query.loadFromJson(reportContent, { validate: false });
|
|
299
|
+
reportLoaded();
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
this.context.loadQuery({
|
|
303
|
+
queryId: reportId,
|
|
304
|
+
silent: true,
|
|
305
|
+
success: function () {
|
|
306
|
+
_this.saveReportContentInCache(reportToLoad, query.toJSON());
|
|
307
|
+
reportLoaded();
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
this.setActiveReport(reportId);
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* Shows the dialog to save the report with new name.
|
|
315
|
+
*/
|
|
316
|
+
ReportView.prototype.saveCurrentReportAs = function () {
|
|
317
|
+
var _this = this;
|
|
318
|
+
var query = this.context.getQuery();
|
|
319
|
+
var ds = this.context.getServices().getDialogService();
|
|
320
|
+
var dlg = ds.open({
|
|
321
|
+
title: i18n.getText('SaveReportDlgTitle'),
|
|
322
|
+
body: this._reportSaveTemplate,
|
|
323
|
+
submitable: true,
|
|
324
|
+
closable: true,
|
|
325
|
+
cancelable: true,
|
|
326
|
+
submitOnEnter: true,
|
|
327
|
+
arrangeParents: false,
|
|
328
|
+
beforeOpen: function () {
|
|
329
|
+
var input = document.getElementById("kdlg-dialog-form-input");
|
|
330
|
+
input.value = query.getName();
|
|
331
|
+
var content = document.getElementById('kdlg-dialog-form-content');
|
|
332
|
+
content.innerHTML = i18n.getText('SaveReportDlgLabel');
|
|
333
|
+
var label = document.getElementById('kdlg-dialog-form-desc-label');
|
|
334
|
+
label.innerHTML = i18n.getText('ReportDescLabel');
|
|
335
|
+
var text = document.getElementById("kdlg-dialog-form-textarea");
|
|
336
|
+
text.value = query.getDescription();
|
|
337
|
+
input.focus();
|
|
338
|
+
},
|
|
339
|
+
onSubmit: function () {
|
|
340
|
+
var input = document.getElementById("kdlg-dialog-form-input");
|
|
341
|
+
var value = input.value;
|
|
342
|
+
if (value && value.replace(/\s/g, '').length > 0) {
|
|
343
|
+
query.setId(dataUtils.generateId(value.replace(/\s/g, '')));
|
|
344
|
+
dlg.clearAlert();
|
|
345
|
+
dlg.disableButtons();
|
|
346
|
+
var header_2 = dlg.getRootElement().querySelector('header');
|
|
347
|
+
var processEl_2 = domel('div', header_2)
|
|
348
|
+
.addClass('eqjs-process-bar local')
|
|
349
|
+
.toDOM();
|
|
350
|
+
var text = document.getElementById("kdlg-dialog-form-textarea");
|
|
351
|
+
var desc = text.value;
|
|
352
|
+
query.setDescription(desc);
|
|
353
|
+
_this.context.newQuery({
|
|
354
|
+
clearQuery: false,
|
|
355
|
+
name: value,
|
|
356
|
+
success: function () {
|
|
357
|
+
dlg.close();
|
|
358
|
+
_this.context.refreshWidgets(WidgetGroup.Query);
|
|
359
|
+
var savedQuery = _this.context.getQuery();
|
|
360
|
+
var reportId = savedQuery.getId();
|
|
361
|
+
_this.fetchData();
|
|
362
|
+
_this.insertIntoReportList({ id: reportId, name: query.getName(), description: query.getDescription() });
|
|
363
|
+
_this.renderReportList({ reportId: reportId });
|
|
364
|
+
_this.setActiveReport(reportId);
|
|
365
|
+
_this.renderReportProps();
|
|
366
|
+
},
|
|
367
|
+
error: function (error) {
|
|
368
|
+
header_2.removeChild(processEl_2);
|
|
369
|
+
dlg.enableButtons();
|
|
370
|
+
dlg.showAlert(error, 'error');
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Removes current report.
|
|
380
|
+
*/
|
|
381
|
+
ReportView.prototype.removeCurrentReport = function () {
|
|
382
|
+
var _this = this;
|
|
383
|
+
var report = this.context.getQuery();
|
|
384
|
+
var ds = this.context.getServices().getDialogService();
|
|
385
|
+
ds.openConfirm(i18n.getText('RemoveReportDlgTitle'), i18n.getText('RemoveReportContent').replace('{reportName}', report.getName()))
|
|
386
|
+
.then(function (result) {
|
|
387
|
+
if (result) {
|
|
388
|
+
var reportId_1 = report.getId();
|
|
389
|
+
_this.context.removeQuery({
|
|
390
|
+
queryId: reportId_1,
|
|
391
|
+
success: function () {
|
|
392
|
+
var index = _this.removeFromReportList(reportId_1);
|
|
393
|
+
_this.renderReportList({ reportIndex: index });
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Sends current report's query to back-end.
|
|
401
|
+
*/
|
|
402
|
+
ReportView.prototype.syncReport = function (options) {
|
|
403
|
+
var _this = this;
|
|
404
|
+
if (this.useReportCache) {
|
|
405
|
+
var query = this.context.getQuery();
|
|
406
|
+
var currentReport = this.findReportById(query.getId());
|
|
407
|
+
if (currentReport) {
|
|
408
|
+
currentReport.lastUpdated = Date.now();
|
|
409
|
+
this.saveReportContentInCache(currentReport, query.toJSON());
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
this.context.syncQuery({
|
|
413
|
+
success: function (responseData) {
|
|
414
|
+
if (responseData.query) {
|
|
415
|
+
_this.context.refreshWidgets(WidgetGroup.Query);
|
|
416
|
+
}
|
|
417
|
+
if (responseData.statement) {
|
|
418
|
+
_this.context.refreshWidgets(WidgetGroup.Statement);
|
|
419
|
+
}
|
|
420
|
+
if (options && options.success) {
|
|
421
|
+
options.success(responseData);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Sets active report.
|
|
428
|
+
* @param reportId The ID of the report to make active.
|
|
429
|
+
*/
|
|
430
|
+
ReportView.prototype.setActiveReport = function (reportId) {
|
|
431
|
+
var rlItems = this.reportListSlot.querySelectorAll('li');
|
|
432
|
+
for (var i = 0; i < rlItems.length; i++) {
|
|
433
|
+
var item = rlItems[i];
|
|
434
|
+
item.classList.remove('active');
|
|
435
|
+
var rid = item.getAttribute('data-rid');
|
|
436
|
+
if (rid === reportId) {
|
|
437
|
+
item.classList.add('active');
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
;
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* Renders current report.
|
|
444
|
+
*/
|
|
445
|
+
ReportView.prototype.renderReportProps = function () {
|
|
446
|
+
var query = this.context.getQuery();
|
|
447
|
+
var titleElem = document.getElementById('ReportTitle');
|
|
448
|
+
titleElem.innerHTML = query.getName();
|
|
449
|
+
var columnsPanel = document.querySelector('.columns-bar');
|
|
450
|
+
if (columnsPanel) {
|
|
451
|
+
columnsPanel.innerHTML = '<strong>Columns:</strong>';
|
|
452
|
+
var columns = query.getColumns();
|
|
453
|
+
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
|
|
454
|
+
var column = columns_1[_i];
|
|
455
|
+
columnsPanel.innerHTML += '<span class="label label-default">' + column.caption + '</span> ';
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* Renders the list of reports.
|
|
461
|
+
* @param options The options. In particular, `options.reportIndex` defines which report should be active.
|
|
462
|
+
*/
|
|
463
|
+
ReportView.prototype.renderReportList = function (options) {
|
|
464
|
+
this.renderReportPanels();
|
|
465
|
+
if (!this.reportListSlot.matches('li')) {
|
|
466
|
+
this.reportListSlot.innerHTML = "";
|
|
467
|
+
options = options || { reportId: (this.reports.length > 0 ? this.reports[0].id : null) };
|
|
468
|
+
var ul = document.createElement('ul');
|
|
469
|
+
ul.className = 'list-group list-group-flush';
|
|
470
|
+
this.reportListSlot.appendChild(ul);
|
|
471
|
+
for (var _i = 0, _a = this.reports; _i < _a.length; _i++) {
|
|
472
|
+
var report = _a[_i];
|
|
473
|
+
this.renderReportItemInList(report, ul);
|
|
474
|
+
}
|
|
475
|
+
if (options.reportId) {
|
|
476
|
+
this.loadReport(options.reportId);
|
|
477
|
+
}
|
|
478
|
+
if (typeof (options.reportIndex) !== "undefined") {
|
|
479
|
+
var idx = options.reportIndex;
|
|
480
|
+
if (idx >= this.reports.length)
|
|
481
|
+
idx = this.reports.length - 1;
|
|
482
|
+
if (idx < 0 && this.reports.length > 0)
|
|
483
|
+
idx = 0;
|
|
484
|
+
if (idx >= 0)
|
|
485
|
+
this.loadReport(this.reports[idx].id);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
ReportView.prototype.detach = function () {
|
|
490
|
+
var _this = this;
|
|
491
|
+
if (this.exportButtonsContainer) {
|
|
492
|
+
this.showExportButtons();
|
|
493
|
+
this.exportButtons.forEach(function (button) {
|
|
494
|
+
button.removeEventListener('click', _this.exportButtonClickHandler);
|
|
495
|
+
});
|
|
496
|
+
this.exportButtons = [];
|
|
497
|
+
this.exportButtonsContainer = null;
|
|
498
|
+
}
|
|
499
|
+
if (this.clearReportButton) {
|
|
500
|
+
this.clearReportButton.removeEventListener('click', this.clearReportButtonClickHandler);
|
|
501
|
+
this.clearReportButton = null;
|
|
502
|
+
}
|
|
503
|
+
if (this.newReportButton) {
|
|
504
|
+
this.newReportButton.removeEventListener('click', this.newReportButtonClickHandler);
|
|
505
|
+
this.newReportButton = null;
|
|
506
|
+
}
|
|
507
|
+
if (this.loadReportButton) {
|
|
508
|
+
this.loadReportButton.removeEventListener('click', this.loadReportButtonClickHandler);
|
|
509
|
+
this.loadReportButton = null;
|
|
510
|
+
}
|
|
511
|
+
if (this.saveReportButton) {
|
|
512
|
+
this.saveReportButton.addEventListener('click', this.saveReportButtonClickHandler);
|
|
513
|
+
this.saveReportButton = null;
|
|
514
|
+
}
|
|
515
|
+
if (this.removeReportButton) {
|
|
516
|
+
this.removeReportButton.removeEventListener('click', this.removeReportButtonClickHandler);
|
|
517
|
+
this.removeReportButton = null;
|
|
518
|
+
}
|
|
519
|
+
if (this.reloadReportDataButton) {
|
|
520
|
+
this.reloadReportDataButton.removeEventListener('click', this.reloadReportDataButtonClickHandler);
|
|
521
|
+
this.removeReportButton = null;
|
|
522
|
+
}
|
|
523
|
+
if (this.reportListSlot) {
|
|
524
|
+
this.reportListSlot.innerHTML = '';
|
|
525
|
+
this.reportListSlot = null;
|
|
526
|
+
}
|
|
527
|
+
if (this.resultCountSlot) {
|
|
528
|
+
this.resultCountSlot.innerHTML = '';
|
|
529
|
+
this.resultCountSlot = null;
|
|
530
|
+
}
|
|
531
|
+
_super.prototype.detach.call(this);
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* Renders a single item in the list of reports.
|
|
535
|
+
* @param report The [[Report]] object to render.
|
|
536
|
+
* @param ul The [[HTMLUListElement]] to add the item to.
|
|
537
|
+
*/
|
|
538
|
+
ReportView.prototype.renderReportItemInList = function (report, ul) {
|
|
539
|
+
var _this = this;
|
|
540
|
+
if (!ul) {
|
|
541
|
+
ul = this.reportListSlot.querySelector("ul");
|
|
542
|
+
}
|
|
543
|
+
var reportName = report.name || report.description || "";
|
|
544
|
+
var li = document.createElement('li');
|
|
545
|
+
li.className = "list-group-item";
|
|
546
|
+
li.style.cursor = 'pointer';
|
|
547
|
+
li.setAttribute('data-rid', report.id);
|
|
548
|
+
li.innerText = reportName;
|
|
549
|
+
if (report.description) {
|
|
550
|
+
li.title = report.description;
|
|
551
|
+
}
|
|
552
|
+
li.addEventListener('click', function (e) {
|
|
553
|
+
var target = e.target;
|
|
554
|
+
var rid = target.getAttribute('data-rid');
|
|
555
|
+
_this.loadReport(rid);
|
|
556
|
+
_this.setActiveReport(rid);
|
|
557
|
+
});
|
|
558
|
+
ul.appendChild(li);
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Renders report panels.
|
|
562
|
+
*/
|
|
563
|
+
ReportView.prototype.renderReportPanels = function () {
|
|
564
|
+
var reportsContainer = document.getElementById("ReportsContainer");
|
|
565
|
+
var noReportPanel = document.getElementById("NoReportPanel");
|
|
566
|
+
if (this.reports.length > 0) {
|
|
567
|
+
this.hideElement(noReportPanel);
|
|
568
|
+
this.showElement(reportsContainer);
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
this.hideElement(reportsContainer);
|
|
572
|
+
this.showElement(noReportPanel);
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
//TODO: Move these two functions to @easydata/ui
|
|
576
|
+
ReportView.prototype.hideElement = function (element) {
|
|
577
|
+
if (element) {
|
|
578
|
+
element.style.visibility = 'hidden';
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
ReportView.prototype.showElement = function (element) {
|
|
582
|
+
if (element) {
|
|
583
|
+
element.style.removeProperty('visibility');
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* Inserts the report to the list of reports.
|
|
588
|
+
* @param report The [[Report]] object to be inserted.
|
|
589
|
+
*/
|
|
590
|
+
ReportView.prototype.insertIntoReportList = function (report) {
|
|
591
|
+
this.reports.push(report);
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
* Removes the report from the list of reports.
|
|
595
|
+
* @param reportId The ID of the report to be removed.
|
|
596
|
+
* @returns the index of removed report.
|
|
597
|
+
*/
|
|
598
|
+
ReportView.prototype.removeFromReportList = function (reportId) {
|
|
599
|
+
var index = this.indexOfReportById(reportId);
|
|
600
|
+
if (index >= 0)
|
|
601
|
+
this.reports.splice(index, 1);
|
|
602
|
+
return index;
|
|
603
|
+
};
|
|
604
|
+
ReportView.prototype.indexOfReportById = function (reportId) {
|
|
605
|
+
for (var i = 0; i < this.reports.length; i++) {
|
|
606
|
+
if (this.reports[i].id === reportId)
|
|
607
|
+
return i;
|
|
608
|
+
}
|
|
609
|
+
return -1;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* The handler of the "Clear" button click.
|
|
613
|
+
*/
|
|
614
|
+
ReportView.prototype.clearReportButtonClick = function () {
|
|
615
|
+
this.clearErrors();
|
|
616
|
+
this.context.clearQuery();
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* The handler of the "Update" button click.
|
|
620
|
+
*/
|
|
621
|
+
ReportView.prototype.reloadReportDataButtonClick = function () {
|
|
622
|
+
this.fetchData();
|
|
623
|
+
};
|
|
624
|
+
/**
|
|
625
|
+
* The handler of the "Save" button click.
|
|
626
|
+
*/
|
|
627
|
+
ReportView.prototype.saveReportButtonClick = function () {
|
|
628
|
+
this.saveCurrentReportAs();
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* The handler of the "Load" button click.
|
|
632
|
+
*/
|
|
633
|
+
ReportView.prototype.loadReportButtonClick = function () {
|
|
634
|
+
this.loadReport("LastQuery");
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* The handler of the "Remove" button click.
|
|
638
|
+
*/
|
|
639
|
+
ReportView.prototype.removeReportButtonClick = function () {
|
|
640
|
+
this.removeCurrentReport();
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* The handler of the "New" button click.
|
|
644
|
+
*/
|
|
645
|
+
ReportView.prototype.newReportButtonClick = function () {
|
|
646
|
+
this.newReport();
|
|
647
|
+
};
|
|
648
|
+
/**
|
|
649
|
+
* The handler of errors.
|
|
650
|
+
* @param error The error object.
|
|
651
|
+
*/
|
|
652
|
+
ReportView.prototype.errorHandler = function (error) {
|
|
653
|
+
};
|
|
654
|
+
/**
|
|
655
|
+
* Clears the errors.
|
|
656
|
+
*/
|
|
657
|
+
ReportView.prototype.clearErrors = function () {
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* Disables export buttons.
|
|
661
|
+
*/
|
|
662
|
+
ReportView.prototype.disableExportButtons = function () {
|
|
663
|
+
this.hideExportButtons();
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* Enables export buttons.
|
|
667
|
+
*/
|
|
668
|
+
ReportView.prototype.enableExportButtons = function () {
|
|
669
|
+
this.showExportButtons();
|
|
670
|
+
};
|
|
671
|
+
/**
|
|
672
|
+
* Hides export buttons.
|
|
673
|
+
*/
|
|
674
|
+
ReportView.prototype.hideExportButtons = function () {
|
|
675
|
+
if (this.exportButtonsContainer) {
|
|
676
|
+
this.exportButtonsContainer.style.display = "none";
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* Shows export buttons.
|
|
681
|
+
*/
|
|
682
|
+
ReportView.prototype.showExportButtons = function () {
|
|
683
|
+
if (this.exportButtonsContainer) {
|
|
684
|
+
this.exportButtonsContainer.style.display = "initial";
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
/**
|
|
688
|
+
* Saves reports content to the cache.
|
|
689
|
+
* @param report The report.
|
|
690
|
+
* @param content The content (Query serialized into JSON).
|
|
691
|
+
*/
|
|
692
|
+
ReportView.prototype.saveReportContentInCache = function (report, content) {
|
|
693
|
+
var item = this.findReportCacheItem(report.id);
|
|
694
|
+
if (!item) {
|
|
695
|
+
item = { id: report.id };
|
|
696
|
+
this.reportCache.push(item);
|
|
697
|
+
}
|
|
698
|
+
item.lastUpdated = report.lastUpdated;
|
|
699
|
+
item.content = content;
|
|
700
|
+
};
|
|
701
|
+
/**
|
|
702
|
+
* Gets the report content from cache.
|
|
703
|
+
* @param report The report.
|
|
704
|
+
* @returns Content of the report (Query in JSOn string)
|
|
705
|
+
*/
|
|
706
|
+
ReportView.prototype.getReportContentFromCache = function (report) {
|
|
707
|
+
var item = this.findReportCacheItem(report.id);
|
|
708
|
+
if (item && item.lastUpdated === report.lastUpdated) {
|
|
709
|
+
return item.content;
|
|
710
|
+
}
|
|
711
|
+
return null;
|
|
712
|
+
};
|
|
713
|
+
ReportView.prototype.findReportById = function (id) {
|
|
714
|
+
for (var _i = 0, _a = this.reports; _i < _a.length; _i++) {
|
|
715
|
+
var item = _a[_i];
|
|
716
|
+
if (item.id === id) {
|
|
717
|
+
return item;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return null;
|
|
721
|
+
};
|
|
722
|
+
ReportView.prototype.findReportCacheItem = function (id) {
|
|
723
|
+
for (var _i = 0, _a = this.reportCache; _i < _a.length; _i++) {
|
|
724
|
+
var item = _a[_i];
|
|
725
|
+
if (item.id === id) {
|
|
726
|
+
return item;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return null;
|
|
730
|
+
};
|
|
731
|
+
return ReportView;
|
|
732
|
+
}(View));
|
|
733
|
+
export { ReportView };
|
|
732
734
|
//# sourceMappingURL=report_view.js.map
|