@easyquery/ui 7.2.3 → 7.2.4-rc01
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/assets/css/easyquery.css +5 -2
- package/dist/browser/eq.community.css.map +1 -1
- package/dist/browser/eq.community.js +32224 -33715
- 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 +22 -114
- 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 +22951 -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 +740 -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 +74 -72
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +829 -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 +21 -18
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js +238 -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 +32 -34
- package/dist/lib/widgets/sorting_bar.js +245 -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
package/dist/lib/views/view.js
CHANGED
|
@@ -1,539 +1,539 @@
|
|
|
1
|
-
import { i18n } from '@easydata/core';
|
|
2
|
-
import { utils as dataUtils } from '@easydata/core';
|
|
3
|
-
import { EqContext, WidgetGroup } from '@easyquery/core';
|
|
4
|
-
import { DefaultDialogService, addElement, domel } from '@easydata/ui';
|
|
5
|
-
import { EasyGridWidget } from '../widgets/easy_grid_widget';
|
|
6
|
-
import { ChartJsWidget } from '../widgets/charts/chart_widget_chartjs';
|
|
7
|
-
import { EntitiesPanel } from '../widgets/entities_panel';
|
|
8
|
-
import { ColumnsPanel } from '../widgets/columns_panel';
|
|
9
|
-
import { ColumnsBar } from '../widgets/columns_bar';
|
|
10
|
-
import { LocaleWidget } from '../widgets/locale_widget';
|
|
11
|
-
import { QueryPanel } from '../widgets/query_panel';
|
|
12
|
-
import { ProcessWidget } from '../widgets/process_widget';
|
|
13
|
-
import { FilterBar } from '../widgets/filter_bar';
|
|
14
|
-
import { SortingBar } from '../widgets/sorting_bar';
|
|
15
|
-
import { QueryNameWidget } from '../widgets/queryname_widget';
|
|
16
|
-
import { StatementPanel } from '../widgets/statement_panel';
|
|
17
|
-
import { ResultFacetsPanel } from '../widgets/result_facets_panel';
|
|
18
|
-
import { eqCssPrefix } from '../utils/utils';
|
|
19
|
-
import { browserUtils } from '../utils/browser_utils';
|
|
20
|
-
import { ExportWidget } from '../widgets/export_widget';
|
|
21
|
-
import { AggregationBar } from '../widgets/aggregation_bar';
|
|
22
|
-
var View = /** @class */ (function () {
|
|
23
|
-
// Widgets END
|
|
24
|
-
function View() {
|
|
25
|
-
this.domRoots = [document];
|
|
26
|
-
this.defaultViewOptions = {
|
|
27
|
-
enableExport: true,
|
|
28
|
-
disableConfirmationOnQueryChange: false,
|
|
29
|
-
queryFileExtensions: 'text/xml,application/json',
|
|
30
|
-
result: {
|
|
31
|
-
clearResultOnQueryChange: true,
|
|
32
|
-
showChart: true,
|
|
33
|
-
showProcessIndicator: true
|
|
34
|
-
},
|
|
35
|
-
widgets: {
|
|
36
|
-
resultGrid: {
|
|
37
|
-
addColumns: false
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
handlers: {}
|
|
41
|
-
};
|
|
42
|
-
this.viewOptions = {};
|
|
43
|
-
this.resultOptions = {};
|
|
44
|
-
this.enableExport = false;
|
|
45
|
-
this.resetContext();
|
|
46
|
-
this.renderSpinner();
|
|
47
|
-
}
|
|
48
|
-
View.prototype.resetContext = function () {
|
|
49
|
-
this.context = new EqContext();
|
|
50
|
-
this.context
|
|
51
|
-
.getServices()
|
|
52
|
-
.registerDialogServiceResolver(function () { return new DefaultDialogService(); });
|
|
53
|
-
};
|
|
54
|
-
View.prototype.init = function (options) {
|
|
55
|
-
try {
|
|
56
|
-
this.context.initStart();
|
|
57
|
-
// to support shadow DOM rendering
|
|
58
|
-
if (options && options.shadowRoots)
|
|
59
|
-
this.domRoots = this.domRoots.concat(options.shadowRoots);
|
|
60
|
-
this.viewOptions = this.initOptions(options);
|
|
61
|
-
this.resultOptions = dataUtils.assignDeep(this.defaultViewOptions.result, this.viewOptions.result);
|
|
62
|
-
this.initWidgets(this.viewOptions);
|
|
63
|
-
this.context.init(this.viewOptions);
|
|
64
|
-
this.initDone();
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
this.context.throwError({ action: 'Init', sourceError: err });
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
View.prototype.initOptions = function (options) {
|
|
71
|
-
options = dataUtils.assignDeep(this.defaultViewOptions, options);
|
|
72
|
-
// support old format
|
|
73
|
-
if (!options.widgets.easyGrid) {
|
|
74
|
-
options.widgets.easyGrid = options.widgets.resultGrid || {};
|
|
75
|
-
}
|
|
76
|
-
// map columnTitleFormat option to widgets that have similar option
|
|
77
|
-
if (options.columnTitleFormat) {
|
|
78
|
-
options.widgets.entitiesPanel = options.widgets.entitiesPanel || {};
|
|
79
|
-
options.widgets.entitiesPanel.columnTitleFormat = options.widgets.entitiesPanel.columnTitleFormat || options.columnTitleFormat;
|
|
80
|
-
options.widgets.columnsBar = options.widgets.columnsBar || {};
|
|
81
|
-
options.widgets.columnsBar.titleElementFormat = options.widgets.columnsBar.titleElementFormat || options.columnTitleFormat;
|
|
82
|
-
options.widgets.columnsPanel = options.widgets.columnsPanel || {};
|
|
83
|
-
options.widgets.columnsPanel.titleElementFormat = options.widgets.columnsPanel.titleElementFormat || options.columnTitleFormat;
|
|
84
|
-
}
|
|
85
|
-
//to support old paging options (should be removed in the next versions)
|
|
86
|
-
options.widgets.easyGrid.paging =
|
|
87
|
-
dataUtils.assignDeep({}, options.result.paging, options.widgets.easyGrid.paging);
|
|
88
|
-
this.enableExport = options.enableExport || false;
|
|
89
|
-
if (!options.widgets.exportWidget) {
|
|
90
|
-
options.widgets.exportWidget = {};
|
|
91
|
-
}
|
|
92
|
-
options.widgets.exportWidget.enableExport = this.enableExport;
|
|
93
|
-
return options;
|
|
94
|
-
};
|
|
95
|
-
View.prototype.initWidgets = function (options) {
|
|
96
|
-
var queryPanel = "QueryPanel";
|
|
97
|
-
var columnsPanel = "ColumnsPanel";
|
|
98
|
-
var entitiesPanel = "EntitiesPanel";
|
|
99
|
-
var resultPanel = "ResultPanel";
|
|
100
|
-
var columnsBar = "ColumnsBar";
|
|
101
|
-
var sortingBar = "SortingBar";
|
|
102
|
-
var filterBar = "FilterBar";
|
|
103
|
-
var processBar = "ProcessBar";
|
|
104
|
-
var statementPanel = "StatementPanel";
|
|
105
|
-
var changeLocale = "ChangeLocale";
|
|
106
|
-
var queryNameLabel = "QueryNameLabel";
|
|
107
|
-
var facetsPanel = "ResultFacetsPanel";
|
|
108
|
-
var resultCount = "ResultCount";
|
|
109
|
-
var exportButton = "ExportButton";
|
|
110
|
-
var aggregationBar = "AggregationBar";
|
|
111
|
-
if (options.slots) {
|
|
112
|
-
queryNameLabel = options.slots.queryNameLabel || queryNameLabel;
|
|
113
|
-
queryPanel = options.slots.queryPanel || queryPanel;
|
|
114
|
-
columnsPanel = options.slots.columnsPanel || columnsPanel;
|
|
115
|
-
columnsBar = options.slots.columnsBar || columnsBar;
|
|
116
|
-
entitiesPanel = options.slots.entitiesPanel || entitiesPanel;
|
|
117
|
-
resultPanel = options.slots.resultPanel || resultPanel;
|
|
118
|
-
statementPanel = options.slots.statementPanel || statementPanel;
|
|
119
|
-
processBar = options.slots.processBar || processBar;
|
|
120
|
-
changeLocale = options.slots.changeLocale || changeLocale;
|
|
121
|
-
facetsPanel = options.slots.facetsPanel || facetsPanel;
|
|
122
|
-
resultCount = options.slots.resultCountSpan || resultCount;
|
|
123
|
-
filterBar = options.slots.filterBar || filterBar;
|
|
124
|
-
exportButton = options.slots.exportButtons || exportButton;
|
|
125
|
-
aggregationBar = options.slots.aggregationBar || aggregationBar;
|
|
126
|
-
}
|
|
127
|
-
var epElement = this.resolveElement(entitiesPanel);
|
|
128
|
-
if (epElement && !this.entitiesPanelWidget) {
|
|
129
|
-
this.entitiesPanelWidget = this.createEntitiesPanelWidget(epElement);
|
|
130
|
-
this.context.addWidget(this.entitiesPanelWidget);
|
|
131
|
-
}
|
|
132
|
-
var cpElement = this.resolveElement(columnsPanel);
|
|
133
|
-
if (cpElement && !this.columnsPanelWidget) {
|
|
134
|
-
this.columnsPanelWidget = this.createColumnsPanelWidget(cpElement);
|
|
135
|
-
this.context.addWidget(this.columnsPanelWidget);
|
|
136
|
-
}
|
|
137
|
-
var cbElement = this.resolveElement(columnsBar);
|
|
138
|
-
if (cbElement && !this.columnsBarWidget) {
|
|
139
|
-
this.columnsBarWidget = this.createColumnsBarWidget(cbElement);
|
|
140
|
-
this.context.addWidget(this.columnsBarWidget);
|
|
141
|
-
}
|
|
142
|
-
var qpElement = this.resolveElement(queryPanel);
|
|
143
|
-
if (qpElement && !this.queryPanelWidget) {
|
|
144
|
-
this.queryPanelWidget = this.createQueryPanelWidget(qpElement);
|
|
145
|
-
this.context.addWidget(this.queryPanelWidget);
|
|
146
|
-
}
|
|
147
|
-
this.resultPanelSlot = this.resolveElement(resultPanel);
|
|
148
|
-
if (this.resultPanelSlot) {
|
|
149
|
-
if (!this.resultGridWidget) {
|
|
150
|
-
var gridPanel = addElement(this.resultPanelSlot, 'div', { cssClass: 'eqv-result-grid' });
|
|
151
|
-
this.resultGridWidget = this.createResultGridWidget(gridPanel);
|
|
152
|
-
this.context.addWidget(this.resultGridWidget);
|
|
153
|
-
}
|
|
154
|
-
if (this.resultOptions.showChart && !this.chartWidget) {
|
|
155
|
-
var chartPanel = addElement(this.resultPanelSlot, 'div', { cssClass: 'eqv-chart-panel' });
|
|
156
|
-
chartPanel.style.display = 'none';
|
|
157
|
-
this.chartWidget = this.createChartWidget(chartPanel);
|
|
158
|
-
this.context.addWidget(this.chartWidget);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
var qnElement = this.resolveElement(queryNameLabel);
|
|
162
|
-
if (qnElement && !this.queryNameWidget) {
|
|
163
|
-
this.queryNameWidget = this.createQueryNameWidget(qnElement);
|
|
164
|
-
this.context.addWidget(this.queryNameWidget);
|
|
165
|
-
}
|
|
166
|
-
var fbElement = this.resolveElement(filterBar);
|
|
167
|
-
if (fbElement && !this.filterBarWidget) {
|
|
168
|
-
this.filterBarWidget = this.createFilterBarWidget(fbElement);
|
|
169
|
-
this.context.addWidget(this.filterBarWidget);
|
|
170
|
-
}
|
|
171
|
-
var sbElement = this.resolveElement(sortingBar);
|
|
172
|
-
if (sbElement && !this.sortingBarWidget) {
|
|
173
|
-
this.sortingBarWidget = this.createSortingBarWidget(sbElement);
|
|
174
|
-
this.context.addWidget(this.sortingBarWidget);
|
|
175
|
-
}
|
|
176
|
-
var pbElement = this.resolveElement(processBar);
|
|
177
|
-
if (pbElement && !this.processWidget) {
|
|
178
|
-
this.processWidget = this.createProcessWidget(pbElement);
|
|
179
|
-
this.context.addWidget(this.processWidget);
|
|
180
|
-
}
|
|
181
|
-
var stElement = this.resolveElement(statementPanel);
|
|
182
|
-
if (stElement && !this.statementPanelWidget) {
|
|
183
|
-
this.statementPanelWidget = this.createStatementPanelWidget(stElement);
|
|
184
|
-
this.context.addWidget(this.statementPanelWidget);
|
|
185
|
-
}
|
|
186
|
-
var clElement = this.resolveElement(changeLocale);
|
|
187
|
-
if (clElement) {
|
|
188
|
-
var widget = this.createLocaleWidget(clElement);
|
|
189
|
-
this.context.addWidget(widget);
|
|
190
|
-
}
|
|
191
|
-
var fpElement = this.resolveElement(facetsPanel);
|
|
192
|
-
if (fpElement && !this.resultFacetPanelWidget) {
|
|
193
|
-
this.resultFacetPanelWidget = this.createResultFacetsPanel(fpElement);
|
|
194
|
-
this.context.addWidget(this.resultFacetPanelWidget);
|
|
195
|
-
}
|
|
196
|
-
var ewElement = this.resolveElement(exportButton);
|
|
197
|
-
if (ewElement && !this.exportWidget) {
|
|
198
|
-
this.exportWidget = this.createExportWidget(ewElement);
|
|
199
|
-
this.context.addWidget(this.exportWidget);
|
|
200
|
-
}
|
|
201
|
-
this.resultCountSlot = this.resolveElement(resultCount);
|
|
202
|
-
var aggrbElement = this.resolveElement(aggregationBar);
|
|
203
|
-
if (aggrbElement && !this.aggregationBarWidget) {
|
|
204
|
-
this.aggregationBarWidget = this.createAggregationBarWidget(aggrbElement);
|
|
205
|
-
this.context.addWidget(this.aggregationBarWidget);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
View.prototype.initDone = function () { };
|
|
209
|
-
View.prototype.resolveElement = function (elementOrId) {
|
|
210
|
-
if (typeof elementOrId === 'string') {
|
|
211
|
-
for (var _i = 0, _a = this.domRoots; _i < _a.length; _i++) {
|
|
212
|
-
var domRoot = _a[_i];
|
|
213
|
-
var el = domRoot.getElementById(elementOrId);
|
|
214
|
-
if (el)
|
|
215
|
-
return el;
|
|
216
|
-
}
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
return elementOrId;
|
|
220
|
-
};
|
|
221
|
-
View.prototype.resolveElementsByClassName = function (className) {
|
|
222
|
-
var result = [];
|
|
223
|
-
for (var _i = 0, _a = this.domRoots; _i < _a.length; _i++) {
|
|
224
|
-
var domRoot = _a[_i];
|
|
225
|
-
var elemList = domRoot.querySelectorAll('.' + className);
|
|
226
|
-
for (var i = 0; i < elemList.length; i++) {
|
|
227
|
-
result.push(elemList[i]);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return result;
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* Shows records count.
|
|
234
|
-
* @param count The value to show.
|
|
235
|
-
*/
|
|
236
|
-
View.prototype.displayRecordsCount = function (count) {
|
|
237
|
-
if (this.resultCountSlot && (typeof count !== 'undefined')) {
|
|
238
|
-
this.resultCountSlot.style.display = "inline";
|
|
239
|
-
this.resultCountSlot.innerHTML = i18n.getText("MsgResultCount").replace("{0}", count.toString());
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
View.prototype.getContext = function () {
|
|
243
|
-
return this.context;
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* Sets dialog service for the view
|
|
247
|
-
* @param dialogService The dialog service.
|
|
248
|
-
*/
|
|
249
|
-
View.prototype.setDialogService = function (dialogService) {
|
|
250
|
-
this.context.getServices()
|
|
251
|
-
.registerDialogServiceResolver(function () { return dialogService; });
|
|
252
|
-
};
|
|
253
|
-
/** @deprecated `executeQuery` is deprecated. Use `fetchData` instead*/
|
|
254
|
-
View.prototype.executeQuery = function (options) {
|
|
255
|
-
console.warn('`executeQuery` is deprecated. Use `fetchData` instead');
|
|
256
|
-
this.fetchData(options);
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* Fetches the data according to the query and other options defined in the context.
|
|
260
|
-
* @param options The options.
|
|
261
|
-
*/
|
|
262
|
-
View.prototype.fetchData = function (options) {
|
|
263
|
-
var _this = this;
|
|
264
|
-
options = options || { refresh: true };
|
|
265
|
-
this.context.clearResult();
|
|
266
|
-
//don't run fetch if the query is empty
|
|
267
|
-
if (this.context.getQuery().isEmpty() && !this.resultOptions.fetchEmptyQueries)
|
|
268
|
-
return;
|
|
269
|
-
this.showResultSpinner();
|
|
270
|
-
this.context.fetchData({
|
|
271
|
-
elasticPaging: options.elasticPaging,
|
|
272
|
-
success: function (result) {
|
|
273
|
-
_this.hideResultSpinner();
|
|
274
|
-
_this.toggleExportButtons();
|
|
275
|
-
_this.displayRecordsCount(_this.context.resultTable.getTotal());
|
|
276
|
-
if (options.refresh === true) {
|
|
277
|
-
_this.context.refreshWidgets(WidgetGroup.Result);
|
|
278
|
-
}
|
|
279
|
-
if (options.callback) {
|
|
280
|
-
options.callback();
|
|
281
|
-
}
|
|
282
|
-
if (options.success) {
|
|
283
|
-
options.success();
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
error: function () {
|
|
287
|
-
_this.hideResultSpinner();
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
View.prototype.toggleExportButtons = function () {
|
|
292
|
-
if (this.enableExport && this.context.resultTable
|
|
293
|
-
&& this.context.resultTable.getCachedCount() > 0) {
|
|
294
|
-
this.enableExportButtons();
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
this.disableExportButtons();
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
View.prototype.enableExportButtons = function () {
|
|
301
|
-
// Nothing to do
|
|
302
|
-
};
|
|
303
|
-
View.prototype.disableExportButtons = function () {
|
|
304
|
-
// Nothing to do
|
|
305
|
-
};
|
|
306
|
-
View.prototype.renderSpinner = function () {
|
|
307
|
-
var html = '<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>';
|
|
308
|
-
;
|
|
309
|
-
this._spinnerDiv = domel('div')
|
|
310
|
-
.addClass("eqjs-result-spinner")
|
|
311
|
-
.addChild('div', function (b) { return b
|
|
312
|
-
.addClass(eqCssPrefix
|
|
313
|
-
.addHtml(html); })
|
|
314
|
-
.toDOM();
|
|
315
|
-
};
|
|
316
|
-
View.prototype.showResultSpinner = function () {
|
|
317
|
-
if (this.resultOptions.showProcessIndicator && this.resultPanelSlot) {
|
|
318
|
-
if (!this._spinnerDiv.parentNode) {
|
|
319
|
-
for (var i = 0; i < this.resultPanelSlot.children.length; i++) {
|
|
320
|
-
var el = this.resultPanelSlot.children[i];
|
|
321
|
-
domel(el).hide();
|
|
322
|
-
}
|
|
323
|
-
this.resultPanelSlot.appendChild(this._spinnerDiv);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
View.prototype.hideResultSpinner = function () {
|
|
328
|
-
if (this.resultOptions.showProcessIndicator && this.resultPanelSlot) {
|
|
329
|
-
if (this._spinnerDiv.parentNode) {
|
|
330
|
-
this._spinnerDiv.parentNode.removeChild(this._spinnerDiv);
|
|
331
|
-
for (var i = 0; i < this.resultPanelSlot.children.length; i++) {
|
|
332
|
-
var el = this.resultPanelSlot.children[i];
|
|
333
|
-
domel(el).show();
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
/**
|
|
339
|
-
* Creates the widget that represents Chart Widget.
|
|
340
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
341
|
-
* @returns the created Widget object.
|
|
342
|
-
*/
|
|
343
|
-
View.prototype.createChartWidget = function (slotElement) {
|
|
344
|
-
if (this.resultOptions.chartWidgetResolver) {
|
|
345
|
-
return this.resultOptions.chartWidgetResolver(slotElement);
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
return new ChartJsWidget(slotElement);
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
/**
|
|
352
|
-
* Creates the widget that represents Grid Widget.
|
|
353
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
354
|
-
* @returns the created Widget object.
|
|
355
|
-
*/
|
|
356
|
-
View.prototype.createResultGridWidget = function (slotElement) {
|
|
357
|
-
if (this.resultOptions.resultGridResolver) {
|
|
358
|
-
return this.resultOptions.resultGridResolver(slotElement);
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
return new EasyGridWidget(slotElement);
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
/**
|
|
365
|
-
* Creates the widget that represents Entity Panel.
|
|
366
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
367
|
-
* @returns the created Widget object.
|
|
368
|
-
*/
|
|
369
|
-
View.prototype.createEntitiesPanelWidget = function (slot) {
|
|
370
|
-
return new EntitiesPanel(slot);
|
|
371
|
-
};
|
|
372
|
-
/**
|
|
373
|
-
* Creates the widget that represents Columns Panel.
|
|
374
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
375
|
-
* @returns the created Widget object.
|
|
376
|
-
*/
|
|
377
|
-
View.prototype.createColumnsPanelWidget = function (slot) {
|
|
378
|
-
return new ColumnsPanel(slot);
|
|
379
|
-
};
|
|
380
|
-
/**
|
|
381
|
-
* Creates the widget that represents Query Panel.
|
|
382
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
383
|
-
* @returns the created Widget object.
|
|
384
|
-
*/
|
|
385
|
-
View.prototype.createQueryPanelWidget = function (slot) {
|
|
386
|
-
return new QueryPanel(slot);
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* Creates the widget that represents Locale Widget.
|
|
390
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
391
|
-
* @returns the created Widget object.
|
|
392
|
-
*/
|
|
393
|
-
View.prototype.createLocaleWidget = function (slot) {
|
|
394
|
-
return new LocaleWidget(slot);
|
|
395
|
-
};
|
|
396
|
-
/**
|
|
397
|
-
* Creates the widget that represents Process Widget.
|
|
398
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
399
|
-
* @returns the created Widget object.
|
|
400
|
-
*/
|
|
401
|
-
View.prototype.createProcessWidget = function (slot) {
|
|
402
|
-
return new ProcessWidget(slot);
|
|
403
|
-
};
|
|
404
|
-
/**
|
|
405
|
-
* Creates the widget that represents Columns Bar.
|
|
406
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
407
|
-
* @returns the created Widget object.
|
|
408
|
-
*/
|
|
409
|
-
View.prototype.createColumnsBarWidget = function (slot) {
|
|
410
|
-
return new ColumnsBar(slot);
|
|
411
|
-
};
|
|
412
|
-
/**
|
|
413
|
-
* Creates the widget that represents Filter Bar.
|
|
414
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
415
|
-
* @returns the created Widget object.
|
|
416
|
-
*/
|
|
417
|
-
View.prototype.createFilterBarWidget = function (slot) {
|
|
418
|
-
return new FilterBar(slot);
|
|
419
|
-
};
|
|
420
|
-
/**
|
|
421
|
-
* Creates the widget that represents Sorting Bar.
|
|
422
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
423
|
-
* @returns the created Widget object.
|
|
424
|
-
*/
|
|
425
|
-
View.prototype.createSortingBarWidget = function (slot) {
|
|
426
|
-
return new SortingBar(slot);
|
|
427
|
-
};
|
|
428
|
-
/**
|
|
429
|
-
* Creates the widget that represents Query Name Widget.
|
|
430
|
-
* @param slot The HTMLElement to place the created widget in.
|
|
431
|
-
* @returns the created Widget object.
|
|
432
|
-
*/
|
|
433
|
-
View.prototype.createQueryNameWidget = function (slot) {
|
|
434
|
-
return new QueryNameWidget(slot);
|
|
435
|
-
};
|
|
436
|
-
/**
|
|
437
|
-
* Creates the widget that represents Statement Panel Widget.
|
|
438
|
-
* @param slot
|
|
439
|
-
*/
|
|
440
|
-
View.prototype.createStatementPanelWidget = function (slot) {
|
|
441
|
-
return new StatementPanel(slot);
|
|
442
|
-
};
|
|
443
|
-
/**
|
|
444
|
-
* Creates the widget that represents Result Facets Panel Widget.
|
|
445
|
-
* @param slot
|
|
446
|
-
*/
|
|
447
|
-
View.prototype.createResultFacetsPanel = function (slot) {
|
|
448
|
-
return new ResultFacetsPanel(slot);
|
|
449
|
-
};
|
|
450
|
-
/**
|
|
451
|
-
* Creates the widget that represents Export funcionality.
|
|
452
|
-
* @param slot
|
|
453
|
-
*/
|
|
454
|
-
View.prototype.createExportWidget = function (slot) {
|
|
455
|
-
return new ExportWidget(slot);
|
|
456
|
-
};
|
|
457
|
-
/**
|
|
458
|
-
* Creates the widget that represents Aggregation Bar Widget.
|
|
459
|
-
* @param slot
|
|
460
|
-
*/
|
|
461
|
-
View.prototype.createAggregationBarWidget = function (slot) {
|
|
462
|
-
return new AggregationBar(slot);
|
|
463
|
-
};
|
|
464
|
-
View.prototype.detach = function () {
|
|
465
|
-
if (this.entitiesPanelWidget) {
|
|
466
|
-
this.entitiesPanelWidget.destroy();
|
|
467
|
-
this.entitiesPanelWidget = null;
|
|
468
|
-
}
|
|
469
|
-
if (this.columnsPanelWidget) {
|
|
470
|
-
this.columnsPanelWidget.destroy();
|
|
471
|
-
this.columnsPanelWidget = null;
|
|
472
|
-
}
|
|
473
|
-
if (this.queryPanelWidget) {
|
|
474
|
-
this.queryPanelWidget.destroy();
|
|
475
|
-
this.queryPanelWidget = null;
|
|
476
|
-
}
|
|
477
|
-
if (this.columnsBarWidget) {
|
|
478
|
-
this.columnsBarWidget.destroy();
|
|
479
|
-
this.columnsBarWidget = null;
|
|
480
|
-
}
|
|
481
|
-
if (this.resultGridWidget) {
|
|
482
|
-
this.resultGridWidget.destroy();
|
|
483
|
-
this.resultGridWidget = null;
|
|
484
|
-
}
|
|
485
|
-
if (this.chartWidget) {
|
|
486
|
-
this.chartWidget.destroy();
|
|
487
|
-
this.chartWidget = null;
|
|
488
|
-
}
|
|
489
|
-
if (this.queryNameWidget) {
|
|
490
|
-
this.queryNameWidget.destroy();
|
|
491
|
-
this.queryNameWidget = null;
|
|
492
|
-
}
|
|
493
|
-
if (this.processWidget) {
|
|
494
|
-
this.processWidget.destroy();
|
|
495
|
-
this.processWidget = null;
|
|
496
|
-
}
|
|
497
|
-
if (this.localeWidget) {
|
|
498
|
-
this.localeWidget.destroy();
|
|
499
|
-
this.localeWidget = null;
|
|
500
|
-
}
|
|
501
|
-
if (this.statementPanelWidget) {
|
|
502
|
-
this.statementPanelWidget.destroy();
|
|
503
|
-
this.statementPanelWidget = null;
|
|
504
|
-
}
|
|
505
|
-
if (this.filterBarWidget) {
|
|
506
|
-
this.filterBarWidget.destroy();
|
|
507
|
-
this.filterBarWidget = null;
|
|
508
|
-
}
|
|
509
|
-
if (this.sortingBarWidget) {
|
|
510
|
-
this.sortingBarWidget.destroy();
|
|
511
|
-
this.sortingBarWidget = null;
|
|
512
|
-
}
|
|
513
|
-
if (this.statementWidget) {
|
|
514
|
-
this.statementWidget.destroy();
|
|
515
|
-
this.statementWidget = null;
|
|
516
|
-
}
|
|
517
|
-
if (this.exportWidget) {
|
|
518
|
-
this.exportWidget.destroy();
|
|
519
|
-
this.exportWidget = null;
|
|
520
|
-
}
|
|
521
|
-
if (this.resultFacetPanelWidget) {
|
|
522
|
-
this.resultFacetPanelWidget.destroy();
|
|
523
|
-
this.resultFacetPanelWidget = null;
|
|
524
|
-
}
|
|
525
|
-
if (this.resultCountSlot) {
|
|
526
|
-
this.resultCountSlot.innerHTML = '';
|
|
527
|
-
this.resultCountSlot = null;
|
|
528
|
-
}
|
|
529
|
-
if (this.resultPanelSlot) {
|
|
530
|
-
this.resultPanelSlot.innerHTML = '';
|
|
531
|
-
this.resultPanelSlot = null;
|
|
532
|
-
}
|
|
533
|
-
this.domRoots = [document];
|
|
534
|
-
this.resetContext();
|
|
535
|
-
};
|
|
536
|
-
return View;
|
|
537
|
-
}());
|
|
538
|
-
export { View };
|
|
1
|
+
import { i18n } from '@easydata/core';
|
|
2
|
+
import { utils as dataUtils } from '@easydata/core';
|
|
3
|
+
import { EqContext, WidgetGroup } from '@easyquery/core';
|
|
4
|
+
import { DefaultDialogService, addElement, domel } from '@easydata/ui';
|
|
5
|
+
import { EasyGridWidget } from '../widgets/easy_grid_widget';
|
|
6
|
+
import { ChartJsWidget } from '../widgets/charts/chart_widget_chartjs';
|
|
7
|
+
import { EntitiesPanel } from '../widgets/entities_panel';
|
|
8
|
+
import { ColumnsPanel } from '../widgets/columns_panel';
|
|
9
|
+
import { ColumnsBar } from '../widgets/columns_bar';
|
|
10
|
+
import { LocaleWidget } from '../widgets/locale_widget';
|
|
11
|
+
import { QueryPanel } from '../widgets/query_panel';
|
|
12
|
+
import { ProcessWidget } from '../widgets/process_widget';
|
|
13
|
+
import { FilterBar } from '../widgets/filter_bar';
|
|
14
|
+
import { SortingBar } from '../widgets/sorting_bar';
|
|
15
|
+
import { QueryNameWidget } from '../widgets/queryname_widget';
|
|
16
|
+
import { StatementPanel } from '../widgets/statement_panel';
|
|
17
|
+
import { ResultFacetsPanel } from '../widgets/result_facets_panel';
|
|
18
|
+
import { eqCssPrefix } from '../utils/utils';
|
|
19
|
+
import { browserUtils } from '../utils/browser_utils';
|
|
20
|
+
import { ExportWidget } from '../widgets/export_widget';
|
|
21
|
+
import { AggregationBar } from '../widgets/aggregation_bar';
|
|
22
|
+
var View = /** @class */ (function () {
|
|
23
|
+
// Widgets END
|
|
24
|
+
function View() {
|
|
25
|
+
this.domRoots = [document];
|
|
26
|
+
this.defaultViewOptions = {
|
|
27
|
+
enableExport: true,
|
|
28
|
+
disableConfirmationOnQueryChange: false,
|
|
29
|
+
queryFileExtensions: 'text/xml,application/json',
|
|
30
|
+
result: {
|
|
31
|
+
clearResultOnQueryChange: true,
|
|
32
|
+
showChart: true,
|
|
33
|
+
showProcessIndicator: true
|
|
34
|
+
},
|
|
35
|
+
widgets: {
|
|
36
|
+
resultGrid: {
|
|
37
|
+
addColumns: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
handlers: {}
|
|
41
|
+
};
|
|
42
|
+
this.viewOptions = {};
|
|
43
|
+
this.resultOptions = {};
|
|
44
|
+
this.enableExport = false;
|
|
45
|
+
this.resetContext();
|
|
46
|
+
this.renderSpinner();
|
|
47
|
+
}
|
|
48
|
+
View.prototype.resetContext = function () {
|
|
49
|
+
this.context = new EqContext();
|
|
50
|
+
this.context
|
|
51
|
+
.getServices()
|
|
52
|
+
.registerDialogServiceResolver(function () { return new DefaultDialogService(); });
|
|
53
|
+
};
|
|
54
|
+
View.prototype.init = function (options) {
|
|
55
|
+
try {
|
|
56
|
+
this.context.initStart();
|
|
57
|
+
// to support shadow DOM rendering
|
|
58
|
+
if (options && options.shadowRoots)
|
|
59
|
+
this.domRoots = this.domRoots.concat(options.shadowRoots);
|
|
60
|
+
this.viewOptions = this.initOptions(options);
|
|
61
|
+
this.resultOptions = dataUtils.assignDeep(this.defaultViewOptions.result, this.viewOptions.result);
|
|
62
|
+
this.initWidgets(this.viewOptions);
|
|
63
|
+
this.context.init(this.viewOptions);
|
|
64
|
+
this.initDone();
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
this.context.throwError({ action: 'Init', sourceError: err });
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
View.prototype.initOptions = function (options) {
|
|
71
|
+
options = dataUtils.assignDeep(this.defaultViewOptions, options);
|
|
72
|
+
// support old format
|
|
73
|
+
if (!options.widgets.easyGrid) {
|
|
74
|
+
options.widgets.easyGrid = options.widgets.resultGrid || {};
|
|
75
|
+
}
|
|
76
|
+
// map columnTitleFormat option to widgets that have similar option
|
|
77
|
+
if (options.columnTitleFormat) {
|
|
78
|
+
options.widgets.entitiesPanel = options.widgets.entitiesPanel || {};
|
|
79
|
+
options.widgets.entitiesPanel.columnTitleFormat = options.widgets.entitiesPanel.columnTitleFormat || options.columnTitleFormat;
|
|
80
|
+
options.widgets.columnsBar = options.widgets.columnsBar || {};
|
|
81
|
+
options.widgets.columnsBar.titleElementFormat = options.widgets.columnsBar.titleElementFormat || options.columnTitleFormat;
|
|
82
|
+
options.widgets.columnsPanel = options.widgets.columnsPanel || {};
|
|
83
|
+
options.widgets.columnsPanel.titleElementFormat = options.widgets.columnsPanel.titleElementFormat || options.columnTitleFormat;
|
|
84
|
+
}
|
|
85
|
+
//to support old paging options (should be removed in the next versions)
|
|
86
|
+
options.widgets.easyGrid.paging =
|
|
87
|
+
dataUtils.assignDeep({}, options.result.paging, options.widgets.easyGrid.paging);
|
|
88
|
+
this.enableExport = options.enableExport || false;
|
|
89
|
+
if (!options.widgets.exportWidget) {
|
|
90
|
+
options.widgets.exportWidget = {};
|
|
91
|
+
}
|
|
92
|
+
options.widgets.exportWidget.enableExport = this.enableExport;
|
|
93
|
+
return options;
|
|
94
|
+
};
|
|
95
|
+
View.prototype.initWidgets = function (options) {
|
|
96
|
+
var queryPanel = "QueryPanel";
|
|
97
|
+
var columnsPanel = "ColumnsPanel";
|
|
98
|
+
var entitiesPanel = "EntitiesPanel";
|
|
99
|
+
var resultPanel = "ResultPanel";
|
|
100
|
+
var columnsBar = "ColumnsBar";
|
|
101
|
+
var sortingBar = "SortingBar";
|
|
102
|
+
var filterBar = "FilterBar";
|
|
103
|
+
var processBar = "ProcessBar";
|
|
104
|
+
var statementPanel = "StatementPanel";
|
|
105
|
+
var changeLocale = "ChangeLocale";
|
|
106
|
+
var queryNameLabel = "QueryNameLabel";
|
|
107
|
+
var facetsPanel = "ResultFacetsPanel";
|
|
108
|
+
var resultCount = "ResultCount";
|
|
109
|
+
var exportButton = "ExportButton";
|
|
110
|
+
var aggregationBar = "AggregationBar";
|
|
111
|
+
if (options.slots) {
|
|
112
|
+
queryNameLabel = options.slots.queryNameLabel || queryNameLabel;
|
|
113
|
+
queryPanel = options.slots.queryPanel || queryPanel;
|
|
114
|
+
columnsPanel = options.slots.columnsPanel || columnsPanel;
|
|
115
|
+
columnsBar = options.slots.columnsBar || columnsBar;
|
|
116
|
+
entitiesPanel = options.slots.entitiesPanel || entitiesPanel;
|
|
117
|
+
resultPanel = options.slots.resultPanel || resultPanel;
|
|
118
|
+
statementPanel = options.slots.statementPanel || statementPanel;
|
|
119
|
+
processBar = options.slots.processBar || processBar;
|
|
120
|
+
changeLocale = options.slots.changeLocale || changeLocale;
|
|
121
|
+
facetsPanel = options.slots.facetsPanel || facetsPanel;
|
|
122
|
+
resultCount = options.slots.resultCountSpan || resultCount;
|
|
123
|
+
filterBar = options.slots.filterBar || filterBar;
|
|
124
|
+
exportButton = options.slots.exportButtons || exportButton;
|
|
125
|
+
aggregationBar = options.slots.aggregationBar || aggregationBar;
|
|
126
|
+
}
|
|
127
|
+
var epElement = this.resolveElement(entitiesPanel);
|
|
128
|
+
if (epElement && !this.entitiesPanelWidget) {
|
|
129
|
+
this.entitiesPanelWidget = this.createEntitiesPanelWidget(epElement);
|
|
130
|
+
this.context.addWidget(this.entitiesPanelWidget);
|
|
131
|
+
}
|
|
132
|
+
var cpElement = this.resolveElement(columnsPanel);
|
|
133
|
+
if (cpElement && !this.columnsPanelWidget) {
|
|
134
|
+
this.columnsPanelWidget = this.createColumnsPanelWidget(cpElement);
|
|
135
|
+
this.context.addWidget(this.columnsPanelWidget);
|
|
136
|
+
}
|
|
137
|
+
var cbElement = this.resolveElement(columnsBar);
|
|
138
|
+
if (cbElement && !this.columnsBarWidget) {
|
|
139
|
+
this.columnsBarWidget = this.createColumnsBarWidget(cbElement);
|
|
140
|
+
this.context.addWidget(this.columnsBarWidget);
|
|
141
|
+
}
|
|
142
|
+
var qpElement = this.resolveElement(queryPanel);
|
|
143
|
+
if (qpElement && !this.queryPanelWidget) {
|
|
144
|
+
this.queryPanelWidget = this.createQueryPanelWidget(qpElement);
|
|
145
|
+
this.context.addWidget(this.queryPanelWidget);
|
|
146
|
+
}
|
|
147
|
+
this.resultPanelSlot = this.resolveElement(resultPanel);
|
|
148
|
+
if (this.resultPanelSlot) {
|
|
149
|
+
if (!this.resultGridWidget) {
|
|
150
|
+
var gridPanel = addElement(this.resultPanelSlot, 'div', { cssClass: 'eqv-result-grid' });
|
|
151
|
+
this.resultGridWidget = this.createResultGridWidget(gridPanel);
|
|
152
|
+
this.context.addWidget(this.resultGridWidget);
|
|
153
|
+
}
|
|
154
|
+
if (this.resultOptions.showChart && !this.chartWidget) {
|
|
155
|
+
var chartPanel = addElement(this.resultPanelSlot, 'div', { cssClass: 'eqv-chart-panel' });
|
|
156
|
+
chartPanel.style.display = 'none';
|
|
157
|
+
this.chartWidget = this.createChartWidget(chartPanel);
|
|
158
|
+
this.context.addWidget(this.chartWidget);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
var qnElement = this.resolveElement(queryNameLabel);
|
|
162
|
+
if (qnElement && !this.queryNameWidget) {
|
|
163
|
+
this.queryNameWidget = this.createQueryNameWidget(qnElement);
|
|
164
|
+
this.context.addWidget(this.queryNameWidget);
|
|
165
|
+
}
|
|
166
|
+
var fbElement = this.resolveElement(filterBar);
|
|
167
|
+
if (fbElement && !this.filterBarWidget) {
|
|
168
|
+
this.filterBarWidget = this.createFilterBarWidget(fbElement);
|
|
169
|
+
this.context.addWidget(this.filterBarWidget);
|
|
170
|
+
}
|
|
171
|
+
var sbElement = this.resolveElement(sortingBar);
|
|
172
|
+
if (sbElement && !this.sortingBarWidget) {
|
|
173
|
+
this.sortingBarWidget = this.createSortingBarWidget(sbElement);
|
|
174
|
+
this.context.addWidget(this.sortingBarWidget);
|
|
175
|
+
}
|
|
176
|
+
var pbElement = this.resolveElement(processBar);
|
|
177
|
+
if (pbElement && !this.processWidget) {
|
|
178
|
+
this.processWidget = this.createProcessWidget(pbElement);
|
|
179
|
+
this.context.addWidget(this.processWidget);
|
|
180
|
+
}
|
|
181
|
+
var stElement = this.resolveElement(statementPanel);
|
|
182
|
+
if (stElement && !this.statementPanelWidget) {
|
|
183
|
+
this.statementPanelWidget = this.createStatementPanelWidget(stElement);
|
|
184
|
+
this.context.addWidget(this.statementPanelWidget);
|
|
185
|
+
}
|
|
186
|
+
var clElement = this.resolveElement(changeLocale);
|
|
187
|
+
if (clElement) {
|
|
188
|
+
var widget = this.createLocaleWidget(clElement);
|
|
189
|
+
this.context.addWidget(widget);
|
|
190
|
+
}
|
|
191
|
+
var fpElement = this.resolveElement(facetsPanel);
|
|
192
|
+
if (fpElement && !this.resultFacetPanelWidget) {
|
|
193
|
+
this.resultFacetPanelWidget = this.createResultFacetsPanel(fpElement);
|
|
194
|
+
this.context.addWidget(this.resultFacetPanelWidget);
|
|
195
|
+
}
|
|
196
|
+
var ewElement = this.resolveElement(exportButton);
|
|
197
|
+
if (ewElement && !this.exportWidget) {
|
|
198
|
+
this.exportWidget = this.createExportWidget(ewElement);
|
|
199
|
+
this.context.addWidget(this.exportWidget);
|
|
200
|
+
}
|
|
201
|
+
this.resultCountSlot = this.resolveElement(resultCount);
|
|
202
|
+
var aggrbElement = this.resolveElement(aggregationBar);
|
|
203
|
+
if (aggrbElement && !this.aggregationBarWidget) {
|
|
204
|
+
this.aggregationBarWidget = this.createAggregationBarWidget(aggrbElement);
|
|
205
|
+
this.context.addWidget(this.aggregationBarWidget);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
View.prototype.initDone = function () { };
|
|
209
|
+
View.prototype.resolveElement = function (elementOrId) {
|
|
210
|
+
if (typeof elementOrId === 'string') {
|
|
211
|
+
for (var _i = 0, _a = this.domRoots; _i < _a.length; _i++) {
|
|
212
|
+
var domRoot = _a[_i];
|
|
213
|
+
var el = domRoot.getElementById(elementOrId);
|
|
214
|
+
if (el)
|
|
215
|
+
return el;
|
|
216
|
+
}
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
return elementOrId;
|
|
220
|
+
};
|
|
221
|
+
View.prototype.resolveElementsByClassName = function (className) {
|
|
222
|
+
var result = [];
|
|
223
|
+
for (var _i = 0, _a = this.domRoots; _i < _a.length; _i++) {
|
|
224
|
+
var domRoot = _a[_i];
|
|
225
|
+
var elemList = domRoot.querySelectorAll('.' + className);
|
|
226
|
+
for (var i = 0; i < elemList.length; i++) {
|
|
227
|
+
result.push(elemList[i]);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return result;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Shows records count.
|
|
234
|
+
* @param count The value to show.
|
|
235
|
+
*/
|
|
236
|
+
View.prototype.displayRecordsCount = function (count) {
|
|
237
|
+
if (this.resultCountSlot && (typeof count !== 'undefined')) {
|
|
238
|
+
this.resultCountSlot.style.display = "inline";
|
|
239
|
+
this.resultCountSlot.innerHTML = i18n.getText("MsgResultCount").replace("{0}", count.toString());
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
View.prototype.getContext = function () {
|
|
243
|
+
return this.context;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Sets dialog service for the view
|
|
247
|
+
* @param dialogService The dialog service.
|
|
248
|
+
*/
|
|
249
|
+
View.prototype.setDialogService = function (dialogService) {
|
|
250
|
+
this.context.getServices()
|
|
251
|
+
.registerDialogServiceResolver(function () { return dialogService; });
|
|
252
|
+
};
|
|
253
|
+
/** @deprecated `executeQuery` is deprecated. Use `fetchData` instead*/
|
|
254
|
+
View.prototype.executeQuery = function (options) {
|
|
255
|
+
console.warn('`executeQuery` is deprecated. Use `fetchData` instead');
|
|
256
|
+
this.fetchData(options);
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Fetches the data according to the query and other options defined in the context.
|
|
260
|
+
* @param options The options.
|
|
261
|
+
*/
|
|
262
|
+
View.prototype.fetchData = function (options) {
|
|
263
|
+
var _this = this;
|
|
264
|
+
options = options || { refresh: true };
|
|
265
|
+
this.context.clearResult();
|
|
266
|
+
//don't run fetch if the query is empty
|
|
267
|
+
if (this.context.getQuery().isEmpty() && !this.resultOptions.fetchEmptyQueries)
|
|
268
|
+
return;
|
|
269
|
+
this.showResultSpinner();
|
|
270
|
+
this.context.fetchData({
|
|
271
|
+
elasticPaging: options.elasticPaging,
|
|
272
|
+
success: function (result) {
|
|
273
|
+
_this.hideResultSpinner();
|
|
274
|
+
_this.toggleExportButtons();
|
|
275
|
+
_this.displayRecordsCount(_this.context.resultTable.getTotal());
|
|
276
|
+
if (options.refresh === true) {
|
|
277
|
+
_this.context.refreshWidgets(WidgetGroup.Result);
|
|
278
|
+
}
|
|
279
|
+
if (options.callback) {
|
|
280
|
+
options.callback();
|
|
281
|
+
}
|
|
282
|
+
if (options.success) {
|
|
283
|
+
options.success();
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
error: function () {
|
|
287
|
+
_this.hideResultSpinner();
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
View.prototype.toggleExportButtons = function () {
|
|
292
|
+
if (this.enableExport && this.context.resultTable
|
|
293
|
+
&& this.context.resultTable.getCachedCount() > 0) {
|
|
294
|
+
this.enableExportButtons();
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
this.disableExportButtons();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
View.prototype.enableExportButtons = function () {
|
|
301
|
+
// Nothing to do
|
|
302
|
+
};
|
|
303
|
+
View.prototype.disableExportButtons = function () {
|
|
304
|
+
// Nothing to do
|
|
305
|
+
};
|
|
306
|
+
View.prototype.renderSpinner = function () {
|
|
307
|
+
var html = '<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>';
|
|
308
|
+
;
|
|
309
|
+
this._spinnerDiv = domel('div')
|
|
310
|
+
.addClass("eqjs-result-spinner")
|
|
311
|
+
.addChild('div', function (b) { return b
|
|
312
|
+
.addClass("".concat(eqCssPrefix, "-progress-win8"), browserUtils.getMobileCssClass())
|
|
313
|
+
.addHtml(html); })
|
|
314
|
+
.toDOM();
|
|
315
|
+
};
|
|
316
|
+
View.prototype.showResultSpinner = function () {
|
|
317
|
+
if (this.resultOptions.showProcessIndicator && this.resultPanelSlot) {
|
|
318
|
+
if (!this._spinnerDiv.parentNode) {
|
|
319
|
+
for (var i = 0; i < this.resultPanelSlot.children.length; i++) {
|
|
320
|
+
var el = this.resultPanelSlot.children[i];
|
|
321
|
+
domel(el).hide();
|
|
322
|
+
}
|
|
323
|
+
this.resultPanelSlot.appendChild(this._spinnerDiv);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
View.prototype.hideResultSpinner = function () {
|
|
328
|
+
if (this.resultOptions.showProcessIndicator && this.resultPanelSlot) {
|
|
329
|
+
if (this._spinnerDiv.parentNode) {
|
|
330
|
+
this._spinnerDiv.parentNode.removeChild(this._spinnerDiv);
|
|
331
|
+
for (var i = 0; i < this.resultPanelSlot.children.length; i++) {
|
|
332
|
+
var el = this.resultPanelSlot.children[i];
|
|
333
|
+
domel(el).show();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* Creates the widget that represents Chart Widget.
|
|
340
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
341
|
+
* @returns the created Widget object.
|
|
342
|
+
*/
|
|
343
|
+
View.prototype.createChartWidget = function (slotElement) {
|
|
344
|
+
if (this.resultOptions.chartWidgetResolver) {
|
|
345
|
+
return this.resultOptions.chartWidgetResolver(slotElement);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
return new ChartJsWidget(slotElement);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Creates the widget that represents Grid Widget.
|
|
353
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
354
|
+
* @returns the created Widget object.
|
|
355
|
+
*/
|
|
356
|
+
View.prototype.createResultGridWidget = function (slotElement) {
|
|
357
|
+
if (this.resultOptions.resultGridResolver) {
|
|
358
|
+
return this.resultOptions.resultGridResolver(slotElement);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
return new EasyGridWidget(slotElement);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* Creates the widget that represents Entity Panel.
|
|
366
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
367
|
+
* @returns the created Widget object.
|
|
368
|
+
*/
|
|
369
|
+
View.prototype.createEntitiesPanelWidget = function (slot) {
|
|
370
|
+
return new EntitiesPanel(slot);
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Creates the widget that represents Columns Panel.
|
|
374
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
375
|
+
* @returns the created Widget object.
|
|
376
|
+
*/
|
|
377
|
+
View.prototype.createColumnsPanelWidget = function (slot) {
|
|
378
|
+
return new ColumnsPanel(slot);
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* Creates the widget that represents Query Panel.
|
|
382
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
383
|
+
* @returns the created Widget object.
|
|
384
|
+
*/
|
|
385
|
+
View.prototype.createQueryPanelWidget = function (slot) {
|
|
386
|
+
return new QueryPanel(slot);
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* Creates the widget that represents Locale Widget.
|
|
390
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
391
|
+
* @returns the created Widget object.
|
|
392
|
+
*/
|
|
393
|
+
View.prototype.createLocaleWidget = function (slot) {
|
|
394
|
+
return new LocaleWidget(slot);
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Creates the widget that represents Process Widget.
|
|
398
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
399
|
+
* @returns the created Widget object.
|
|
400
|
+
*/
|
|
401
|
+
View.prototype.createProcessWidget = function (slot) {
|
|
402
|
+
return new ProcessWidget(slot);
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Creates the widget that represents Columns Bar.
|
|
406
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
407
|
+
* @returns the created Widget object.
|
|
408
|
+
*/
|
|
409
|
+
View.prototype.createColumnsBarWidget = function (slot) {
|
|
410
|
+
return new ColumnsBar(slot);
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Creates the widget that represents Filter Bar.
|
|
414
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
415
|
+
* @returns the created Widget object.
|
|
416
|
+
*/
|
|
417
|
+
View.prototype.createFilterBarWidget = function (slot) {
|
|
418
|
+
return new FilterBar(slot);
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* Creates the widget that represents Sorting Bar.
|
|
422
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
423
|
+
* @returns the created Widget object.
|
|
424
|
+
*/
|
|
425
|
+
View.prototype.createSortingBarWidget = function (slot) {
|
|
426
|
+
return new SortingBar(slot);
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* Creates the widget that represents Query Name Widget.
|
|
430
|
+
* @param slot The HTMLElement to place the created widget in.
|
|
431
|
+
* @returns the created Widget object.
|
|
432
|
+
*/
|
|
433
|
+
View.prototype.createQueryNameWidget = function (slot) {
|
|
434
|
+
return new QueryNameWidget(slot);
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Creates the widget that represents Statement Panel Widget.
|
|
438
|
+
* @param slot
|
|
439
|
+
*/
|
|
440
|
+
View.prototype.createStatementPanelWidget = function (slot) {
|
|
441
|
+
return new StatementPanel(slot);
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Creates the widget that represents Result Facets Panel Widget.
|
|
445
|
+
* @param slot
|
|
446
|
+
*/
|
|
447
|
+
View.prototype.createResultFacetsPanel = function (slot) {
|
|
448
|
+
return new ResultFacetsPanel(slot);
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* Creates the widget that represents Export funcionality.
|
|
452
|
+
* @param slot
|
|
453
|
+
*/
|
|
454
|
+
View.prototype.createExportWidget = function (slot) {
|
|
455
|
+
return new ExportWidget(slot);
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Creates the widget that represents Aggregation Bar Widget.
|
|
459
|
+
* @param slot
|
|
460
|
+
*/
|
|
461
|
+
View.prototype.createAggregationBarWidget = function (slot) {
|
|
462
|
+
return new AggregationBar(slot);
|
|
463
|
+
};
|
|
464
|
+
View.prototype.detach = function () {
|
|
465
|
+
if (this.entitiesPanelWidget) {
|
|
466
|
+
this.entitiesPanelWidget.destroy();
|
|
467
|
+
this.entitiesPanelWidget = null;
|
|
468
|
+
}
|
|
469
|
+
if (this.columnsPanelWidget) {
|
|
470
|
+
this.columnsPanelWidget.destroy();
|
|
471
|
+
this.columnsPanelWidget = null;
|
|
472
|
+
}
|
|
473
|
+
if (this.queryPanelWidget) {
|
|
474
|
+
this.queryPanelWidget.destroy();
|
|
475
|
+
this.queryPanelWidget = null;
|
|
476
|
+
}
|
|
477
|
+
if (this.columnsBarWidget) {
|
|
478
|
+
this.columnsBarWidget.destroy();
|
|
479
|
+
this.columnsBarWidget = null;
|
|
480
|
+
}
|
|
481
|
+
if (this.resultGridWidget) {
|
|
482
|
+
this.resultGridWidget.destroy();
|
|
483
|
+
this.resultGridWidget = null;
|
|
484
|
+
}
|
|
485
|
+
if (this.chartWidget) {
|
|
486
|
+
this.chartWidget.destroy();
|
|
487
|
+
this.chartWidget = null;
|
|
488
|
+
}
|
|
489
|
+
if (this.queryNameWidget) {
|
|
490
|
+
this.queryNameWidget.destroy();
|
|
491
|
+
this.queryNameWidget = null;
|
|
492
|
+
}
|
|
493
|
+
if (this.processWidget) {
|
|
494
|
+
this.processWidget.destroy();
|
|
495
|
+
this.processWidget = null;
|
|
496
|
+
}
|
|
497
|
+
if (this.localeWidget) {
|
|
498
|
+
this.localeWidget.destroy();
|
|
499
|
+
this.localeWidget = null;
|
|
500
|
+
}
|
|
501
|
+
if (this.statementPanelWidget) {
|
|
502
|
+
this.statementPanelWidget.destroy();
|
|
503
|
+
this.statementPanelWidget = null;
|
|
504
|
+
}
|
|
505
|
+
if (this.filterBarWidget) {
|
|
506
|
+
this.filterBarWidget.destroy();
|
|
507
|
+
this.filterBarWidget = null;
|
|
508
|
+
}
|
|
509
|
+
if (this.sortingBarWidget) {
|
|
510
|
+
this.sortingBarWidget.destroy();
|
|
511
|
+
this.sortingBarWidget = null;
|
|
512
|
+
}
|
|
513
|
+
if (this.statementWidget) {
|
|
514
|
+
this.statementWidget.destroy();
|
|
515
|
+
this.statementWidget = null;
|
|
516
|
+
}
|
|
517
|
+
if (this.exportWidget) {
|
|
518
|
+
this.exportWidget.destroy();
|
|
519
|
+
this.exportWidget = null;
|
|
520
|
+
}
|
|
521
|
+
if (this.resultFacetPanelWidget) {
|
|
522
|
+
this.resultFacetPanelWidget.destroy();
|
|
523
|
+
this.resultFacetPanelWidget = null;
|
|
524
|
+
}
|
|
525
|
+
if (this.resultCountSlot) {
|
|
526
|
+
this.resultCountSlot.innerHTML = '';
|
|
527
|
+
this.resultCountSlot = null;
|
|
528
|
+
}
|
|
529
|
+
if (this.resultPanelSlot) {
|
|
530
|
+
this.resultPanelSlot.innerHTML = '';
|
|
531
|
+
this.resultPanelSlot = null;
|
|
532
|
+
}
|
|
533
|
+
this.domRoots = [document];
|
|
534
|
+
this.resetContext();
|
|
535
|
+
};
|
|
536
|
+
return View;
|
|
537
|
+
}());
|
|
538
|
+
export { View };
|
|
539
539
|
//# sourceMappingURL=view.js.map
|