|
1 | | -import $ from '../../core/renderer'; |
2 | | -import { extend } from '../../core/utils/extend'; |
3 | | -import messageLocalization from '../../common/core/localization/message'; |
4 | | -import { isDefined } from '../../core/utils/type'; |
5 | | -import LoadPanel from '../../ui/load_panel'; |
6 | | -import gridUtils from '../../__internal/grids/grid_core/m_utils'; |
7 | | - |
| 1 | +/* eslint-disable @typescript-eslint/no-unsafe-return */ |
| 2 | +/* eslint-disable @typescript-eslint/explicit-function-return-type */ |
| 3 | +/* eslint-disable @typescript-eslint/no-explicit-any */ |
| 4 | +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ |
| 5 | +import messageLocalization from '@js/common/core/localization/message'; |
| 6 | +import $ from '@js/core/renderer'; |
| 7 | +import { extend } from '@js/core/utils/extend'; |
| 8 | +import { isDefined } from '@js/core/utils/type'; |
| 9 | +import LoadPanel from '@js/ui/load_panel'; |
| 10 | +import gridUtils from '@ts/grids/grid_core/m_utils'; |
8 | 11 |
|
9 | 12 | const EXPORT_LOAD_PANEL_CLASS = 'dx-export-loadpanel'; |
10 | 13 | class ExportLoadPanel { |
11 | | - constructor(component, $targetElement, $container, options) { |
12 | | - this._$targetElement = $targetElement; |
13 | | - this._$container = $container; |
14 | | - |
15 | | - this._loadPanel = component._createComponent($('<div>').addClass(EXPORT_LOAD_PANEL_CLASS).appendTo(this._$container), LoadPanel, this.getOptions(options)); |
16 | | - } |
17 | | - |
18 | | - getDefaultOptions() { |
19 | | - return { |
20 | | - animation: null, |
21 | | - shading: false, |
22 | | - height: 90, |
23 | | - width: 200, |
24 | | - container: this._$container |
25 | | - }; |
| 14 | + _$targetElement: any; |
| 15 | + |
| 16 | + _$container: any; |
| 17 | + |
| 18 | + _loadPanel: any; |
| 19 | + |
| 20 | + constructor(component, $targetElement, $container, options) { |
| 21 | + this._$targetElement = $targetElement; |
| 22 | + this._$container = $container; |
| 23 | + |
| 24 | + this._loadPanel = component._createComponent($('<div>').addClass(EXPORT_LOAD_PANEL_CLASS).appendTo(this._$container), LoadPanel, this.getOptions(options)); |
| 25 | + } |
| 26 | + |
| 27 | + getDefaultOptions() { |
| 28 | + return { |
| 29 | + animation: null, |
| 30 | + shading: false, |
| 31 | + height: 90, |
| 32 | + width: 200, |
| 33 | + container: this._$container, |
| 34 | + }; |
| 35 | + } |
| 36 | + |
| 37 | + getOptions(options) { |
| 38 | + if (isDefined(options.text)) { |
| 39 | + options.message = options.text; |
| 40 | + } else { |
| 41 | + options.message = messageLocalization.format('dxDataGrid-exporting'); |
26 | 42 | } |
27 | 43 |
|
28 | | - getOptions(options) { |
29 | | - if(isDefined(options.text)) { |
30 | | - options.message = options.text; |
31 | | - } else { |
32 | | - options.message = messageLocalization.format('dxDataGrid-exporting'); |
33 | | - } |
| 44 | + return extend(this.getDefaultOptions(), options); |
| 45 | + } |
34 | 46 |
|
35 | | - return extend(this.getDefaultOptions(), options); |
36 | | - } |
37 | | - |
38 | | - show() { |
39 | | - this._loadPanel.option('position', gridUtils.calculateLoadPanelPosition(this._$targetElement)); |
40 | | - this._loadPanel.show(); |
41 | | - } |
| 47 | + show() { |
| 48 | + this._loadPanel.option('position', gridUtils.calculateLoadPanelPosition(this._$targetElement)); |
| 49 | + this._loadPanel.show(); |
| 50 | + } |
42 | 51 |
|
43 | | - dispose() { |
44 | | - $(this._loadPanel.element()).remove(); |
45 | | - delete this._loadPanel; |
46 | | - } |
| 52 | + dispose() { |
| 53 | + $(this._loadPanel.element()).remove(); |
| 54 | + delete this._loadPanel; |
| 55 | + } |
47 | 56 | } |
48 | 57 |
|
49 | 58 | export { ExportLoadPanel }; |
0 commit comments