@highcharts/grid-pro 2.2.0 → 2.3.1
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/LICENSE.txt +6 -0
- package/README.md +15 -9
- package/css/grid-pro.css +1262 -1122
- package/css/modules/grid-base-variables.css +131 -0
- package/css/modules/grid-button-variables.css +140 -0
- package/css/modules/grid-caption-variables.css +11 -0
- package/css/modules/grid-description-variables.css +11 -0
- package/css/modules/grid-input-variables.css +114 -0
- package/css/modules/grid-link-variables.css +18 -0
- package/css/modules/grid-menu-variables.css +50 -0
- package/css/modules/grid-pagination-variables.css +12 -0
- package/css/modules/grid-popup-variables.css +24 -0
- package/css/modules/grid-pro.css +234 -0
- package/css/modules/grid-table-variables.css +385 -0
- package/css/modules/grid-theme-default.css +55 -0
- package/es-modules/Accessibility/A11yI18n.js +1 -2
- package/es-modules/Accessibility/Accessibility.js +1 -2
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +2 -2
- package/es-modules/Accessibility/Components/ContainerComponent.js +0 -1
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +6 -8
- package/es-modules/Accessibility/Components/LegendComponent.js +1 -2
- package/es-modules/Accessibility/Components/MenuComponent.js +1 -3
- package/es-modules/Accessibility/Components/NavigatorComponent.js +3 -4
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +1 -3
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +22 -11
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +3 -7
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +0 -1
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +3 -5
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +1 -4
- package/es-modules/Accessibility/Components/ZoomComponent.js +1 -2
- package/es-modules/Accessibility/FocusBorder.js +6 -7
- package/es-modules/Accessibility/KeyboardNavigation.js +1 -2
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +1 -2
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +11 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +8 -4
- package/es-modules/Accessibility/Options/LangDefaults.js +9 -0
- package/es-modules/Accessibility/ProxyElement.d.ts +2 -2
- package/es-modules/Accessibility/ProxyElement.js +4 -7
- package/es-modules/Accessibility/ProxyProvider.js +1 -2
- package/es-modules/Accessibility/Utils/Announcer.js +2 -3
- package/es-modules/Accessibility/Utils/ChartUtilities.js +1 -3
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +2 -2
- package/es-modules/Accessibility/Utils/EventProvider.js +6 -2
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +1 -3
- package/es-modules/Core/Animation/AnimationUtilities.js +1 -2
- package/es-modules/Core/Animation/Fx.js +1 -2
- package/es-modules/Core/Callback.d.ts +9 -2
- package/es-modules/Core/Chart/Chart.js +56 -42
- package/es-modules/Core/Chart/Chart3D.js +1 -2
- package/es-modules/Core/Chart/ChartDefaults.js +11 -0
- package/es-modules/Core/Chart/ChartNavigationComposition.js +0 -1
- package/es-modules/Core/Chart/ChartOptions.d.ts +8 -0
- package/es-modules/Core/Chart/GanttChart.js +1 -2
- package/es-modules/Core/Chart/MapChart.js +3 -2
- package/es-modules/Core/Chart/StockChart.js +2 -3
- package/es-modules/Core/Color/Color.js +1 -3
- package/es-modules/Core/Defaults.js +36 -10
- package/es-modules/Core/Delaunay.d.ts +1 -0
- package/es-modules/Core/Delaunay.js +312 -0
- package/es-modules/Core/Foundation.js +1 -3
- package/es-modules/Core/Geometry/CircleUtilities.js +1 -2
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +1 -2
- package/es-modules/Core/MSPointer.js +1 -3
- package/es-modules/Core/Math3D.js +1 -2
- package/es-modules/Core/Options.d.ts +6 -2
- package/es-modules/Core/Pointer.js +23 -4
- package/es-modules/Core/PointerEvent.d.ts +2 -0
- package/es-modules/Core/Renderer/HTML/AST.js +2 -2
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +3 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -2
- package/es-modules/Core/Renderer/RendererUtilities.js +34 -20
- package/es-modules/Core/Renderer/SVG/SVGRenderer.d.ts +1 -1
- package/es-modules/Core/Renderer/SVG/Symbols.d.ts +2 -2
- package/es-modules/Core/Responsive.d.ts +4 -2
- package/es-modules/Core/Responsive.js +10 -4
- package/es-modules/Core/Templating.d.ts +1 -1
- package/es-modules/Core/Templating.js +3 -4
- package/es-modules/Core/Time.d.ts +8 -0
- package/es-modules/Core/Time.js +2 -2
- package/es-modules/Core/Tooltip.d.ts +4 -8
- package/es-modules/Core/Tooltip.js +100 -81
- package/es-modules/Core/TooltipOptions.d.ts +44 -1
- package/es-modules/Core/Utilities.d.ts +25 -665
- package/es-modules/Core/Utilities.js +21 -1400
- package/es-modules/Data/ColumnUtils.d.ts +83 -80
- package/es-modules/Data/ColumnUtils.js +103 -113
- package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/CSVConnector.js +3 -4
- package/es-modules/Data/Connectors/DataConnector.d.ts +56 -58
- package/es-modules/Data/Connectors/DataConnector.js +37 -56
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +73 -88
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +4 -2
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
- package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -4
- package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/JSONConnector.js +3 -4
- package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
- package/es-modules/Data/Converters/CSVConverter.js +3 -4
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
- package/es-modules/Data/Converters/DataConverter.js +26 -53
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
- package/es-modules/Data/Converters/DataConverterUtils.js +169 -181
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +3 -3
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
- package/es-modules/Data/Converters/HTMLTableConverter.js +2 -3
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
- package/es-modules/Data/Converters/JSONConverter.js +6 -6
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +2 -2
- package/es-modules/Data/DataCursor.d.ts +65 -70
- package/es-modules/Data/DataCursor.js +119 -139
- package/es-modules/Data/DataEvent.d.ts +55 -57
- package/es-modules/Data/DataPool.d.ts +10 -17
- package/es-modules/Data/DataPool.js +21 -10
- package/es-modules/Data/DataTable.d.ts +111 -113
- package/es-modules/Data/DataTable.js +3 -3
- package/es-modules/Data/DataTableCore.d.ts +9 -9
- package/es-modules/Data/DataTableCore.js +2 -2
- package/es-modules/Data/Formula/FormulaParser.js +1 -2
- package/es-modules/Data/Formula/FormulaProcessor.js +1 -2
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
- package/es-modules/Data/Modifiers/ChainModifier.js +7 -8
- package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
- package/es-modules/Data/Modifiers/DataModifier.js +31 -53
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/FilterModifier.js +3 -4
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/InvertModifier.js +3 -4
- package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/RangeModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
- package/es-modules/Data/Modifiers/SortModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +3 -3
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +1 -1
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +5 -6
- package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
- package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
- package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
- package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
- package/es-modules/Grid/Core/Defaults.js +4 -2
- package/es-modules/Grid/Core/Globals.d.ts +20 -16
- package/es-modules/Grid/Core/Globals.js +10 -8
- package/es-modules/Grid/Core/Grid.d.ts +31 -22
- package/es-modules/Grid/Core/Grid.js +217 -139
- package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
- package/es-modules/Grid/Core/GridUtils.js +50 -3
- package/es-modules/Grid/Core/Options.d.ts +145 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +68 -28
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +1 -2
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +3 -3
- package/es-modules/Grid/Core/Querying/PaginationController.js +7 -6
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
- package/es-modules/Grid/Core/Querying/QueryingController.js +2 -26
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +272 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +3 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +2 -2
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +17 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +58 -15
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +1 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +57 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +411 -118
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +27 -13
- package/es-modules/Grid/Core/Table/Body/TableCell.js +74 -25
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +7 -15
- package/es-modules/Grid/Core/Table/Body/TableRow.js +24 -19
- package/es-modules/Grid/Core/Table/Cell.d.ts +16 -3
- package/es-modules/Grid/Core/Table/Cell.js +36 -3
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +3 -8
- package/es-modules/Grid/Core/Table/Column.d.ts +10 -4
- package/es-modules/Grid/Core/Table/Column.js +23 -34
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +9 -8
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +4 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +7 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +2 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +0 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +4 -14
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +33 -13
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +4 -5
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +3 -3
- package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Row.js +2 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +38 -12
- package/es-modules/Grid/Core/Table/Table.js +184 -91
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +5 -3
- package/es-modules/Grid/Core/UI/Popup.js +7 -9
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
- package/es-modules/Grid/Core/UI/SvgIcons.js +206 -33
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
- package/es-modules/Grid/Core/UI/ToolbarButton.js +8 -26
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +2 -2
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +10 -10
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +34 -32
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +3 -4
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +1 -3
- package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
- package/es-modules/Grid/Pro/Data/DataSourceHelper.js +256 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +1 -2
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +1 -2
- package/es-modules/Grid/Pro/GridEvents.js +1 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +1 -2
- package/es-modules/Shared/BaseForm.js +1 -2
- package/es-modules/Shared/DownloadURL.js +1 -2
- package/es-modules/Shared/TimeBase.js +3 -3
- package/es-modules/Shared/Types.d.ts +7 -0
- package/es-modules/Shared/Utilities.d.ts +576 -0
- package/es-modules/Shared/Utilities.js +1360 -0
- package/es-modules/masters/grid-pro.src.d.ts +15 -11
- package/es-modules/masters/grid-pro.src.js +12 -5
- package/grid-pro.d.ts +15 -11
- package/grid-pro.js +3 -3
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +15 -11
- package/grid-pro.src.js +13854 -11395
- package/package.json +1 -1
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
- package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { DeepPartial } from '../../../Shared/Types';
|
|
2
|
+
import type Grid from '../../Core/Grid';
|
|
3
|
+
import type { Options } from '../Options';
|
|
4
|
+
import type { ResponsiveOptions, RuleOptions } from './ResponsiveOptions';
|
|
5
|
+
/**
|
|
6
|
+
* Extends the grid classes with responsive options.
|
|
7
|
+
*
|
|
8
|
+
* @param GridClass
|
|
9
|
+
* The class to extend.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare function compose(GridClass: typeof Grid): void;
|
|
13
|
+
declare module '../Options' {
|
|
14
|
+
interface Options {
|
|
15
|
+
/**
|
|
16
|
+
* Allows setting a set of rules to apply for different screen or grid
|
|
17
|
+
* sizes. Each rule specifies additional grid options.
|
|
18
|
+
*/
|
|
19
|
+
responsive?: ResponsiveOptions;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare module '../Grid' {
|
|
23
|
+
export default interface Grid {
|
|
24
|
+
/**
|
|
25
|
+
* Tracks the ResizeObserver instance for the grid.
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
resizeObserver?: ResizeObserver;
|
|
29
|
+
/**
|
|
30
|
+
* Cache of currently active responsive rules.
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
activeRules?: Set<RuleOptions>;
|
|
34
|
+
/**
|
|
35
|
+
* Stores merged responsive options and undo data.
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
currentResponsive?: {
|
|
39
|
+
ruleIds?: string;
|
|
40
|
+
mergedOptions: DeepPartial<Options>;
|
|
41
|
+
undoOptions: DeepPartial<Options>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Prevents recursive updates during responsive changes.
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
updatingResponsive?: boolean;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
declare const _default: {
|
|
51
|
+
readonly compose: typeof compose;
|
|
52
|
+
};
|
|
53
|
+
export default _default;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/* *
|
|
2
|
+
*
|
|
3
|
+
* Grid Responsive composition
|
|
4
|
+
*
|
|
5
|
+
* (c) 2020-2026 Highsoft AS
|
|
6
|
+
*
|
|
7
|
+
* A commercial license may be required depending on use.
|
|
8
|
+
* See www.highcharts.com/license
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* Authors:
|
|
12
|
+
* - Dawid Dragula
|
|
13
|
+
*
|
|
14
|
+
* */
|
|
15
|
+
'use strict';
|
|
16
|
+
import Globals from '../../Core/Globals.js';
|
|
17
|
+
import { addEvent, defined, diffObjects, merge, pushUnique } from '../../../Shared/Utilities.js';
|
|
18
|
+
import { uniqueKey } from '../../../Core/Utilities.js';
|
|
19
|
+
/* *
|
|
20
|
+
*
|
|
21
|
+
* Composition
|
|
22
|
+
*
|
|
23
|
+
* */
|
|
24
|
+
/**
|
|
25
|
+
* Extends the grid classes with responsive options.
|
|
26
|
+
*
|
|
27
|
+
* @param GridClass
|
|
28
|
+
* The class to extend.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export function compose(GridClass) {
|
|
32
|
+
if (!pushUnique(Globals.composed, 'Responsive')) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
addEvent(GridClass, 'beforeRenderViewport', initResizeObserver);
|
|
36
|
+
addEvent(GridClass, 'beforeDestroy', destroyResizeObserver);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Initializes the resize observer.
|
|
40
|
+
*
|
|
41
|
+
* @param this
|
|
42
|
+
* Reference to Grid.
|
|
43
|
+
*/
|
|
44
|
+
function initResizeObserver() {
|
|
45
|
+
destroyResizeObserver.call(this);
|
|
46
|
+
if (!this.container || !this.contentWrapper) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.activeRules = new Set();
|
|
50
|
+
// Synchronously evaluate responsive rules so the first render already
|
|
51
|
+
// uses the correct options (avoids a redundant second render).
|
|
52
|
+
if (!this.updatingResponsive) {
|
|
53
|
+
const rules = this.options?.responsive?.rules || [];
|
|
54
|
+
if (rules.length > 0) {
|
|
55
|
+
const { clientWidth: width, clientHeight: height } = this.container;
|
|
56
|
+
const fakeEntry = {
|
|
57
|
+
contentRect: { width, height }
|
|
58
|
+
};
|
|
59
|
+
const matchingRules = [];
|
|
60
|
+
for (const rule of rules) {
|
|
61
|
+
if (typeof rule._id === 'undefined') {
|
|
62
|
+
rule._id = uniqueKey();
|
|
63
|
+
}
|
|
64
|
+
if (matchResponsiveRule.call(this, rule, fakeEntry)) {
|
|
65
|
+
matchingRules.push(rule);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
this.activeRules = new Set(matchingRules);
|
|
69
|
+
setResponsive.call(this, matchingRules, false);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
73
|
+
onResize.call(this, entries[0]);
|
|
74
|
+
});
|
|
75
|
+
this.resizeObserver.observe(this.contentWrapper);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Destroys the resize observer.
|
|
79
|
+
*
|
|
80
|
+
* @param this
|
|
81
|
+
* Reference to Grid.
|
|
82
|
+
*/
|
|
83
|
+
function destroyResizeObserver() {
|
|
84
|
+
this.resizeObserver?.disconnect();
|
|
85
|
+
delete this.activeRules;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Checks if the responsive rule matches the current grid size.
|
|
89
|
+
*
|
|
90
|
+
* @param this
|
|
91
|
+
* Reference to Grid.
|
|
92
|
+
*
|
|
93
|
+
* @param rule
|
|
94
|
+
* The responsive rule to check.
|
|
95
|
+
*
|
|
96
|
+
* @param entry
|
|
97
|
+
* The resize observer entry.
|
|
98
|
+
*/
|
|
99
|
+
function matchResponsiveRule(rule, entry) {
|
|
100
|
+
const { maxWidth, maxHeight, minWidth, minHeight, callback } = rule.condition;
|
|
101
|
+
return ((!defined(callback) || callback?.call(this, this)) &&
|
|
102
|
+
(!defined(maxWidth) || entry.contentRect.width <= maxWidth) &&
|
|
103
|
+
(!defined(maxHeight) || entry.contentRect.height <= maxHeight) &&
|
|
104
|
+
(!defined(minWidth) || entry.contentRect.width >= minWidth) &&
|
|
105
|
+
(!defined(minHeight) || entry.contentRect.height >= minHeight));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Updates the grid based on the currently active responsive rules.
|
|
109
|
+
*
|
|
110
|
+
* @param this
|
|
111
|
+
* Reference to Grid.
|
|
112
|
+
*
|
|
113
|
+
* @param matchingRules
|
|
114
|
+
* Active responsive rules.
|
|
115
|
+
*
|
|
116
|
+
* @param redraw
|
|
117
|
+
* Whether to redraw the grid. Default is `true`.
|
|
118
|
+
*/
|
|
119
|
+
function setResponsive(matchingRules, redraw = true) {
|
|
120
|
+
const ruleIds = matchingRules.map((rule) => rule._id);
|
|
121
|
+
const ruleIdsString = (ruleIds.toString() || void 0);
|
|
122
|
+
const currentRuleIds = this.currentResponsive?.ruleIds;
|
|
123
|
+
if (ruleIdsString === currentRuleIds || this.updatingResponsive) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
this.updatingResponsive = true;
|
|
127
|
+
let lastUpdate;
|
|
128
|
+
if (this.currentResponsive) {
|
|
129
|
+
const undoOptions = this.currentResponsive.undoOptions;
|
|
130
|
+
this.currentResponsive = void 0;
|
|
131
|
+
if (redraw) {
|
|
132
|
+
lastUpdate = this.update(undoOptions, true);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.update(undoOptions, false);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (ruleIdsString) {
|
|
139
|
+
const mergedOptions = merge(...matchingRules.map((rule) => rule.gridOptions));
|
|
140
|
+
const undoOptions = diffObjects(mergedOptions, this.options || {}, true);
|
|
141
|
+
const columnUndoOptions = getColumnUndoOptions.call(this, mergedOptions);
|
|
142
|
+
if (columnUndoOptions) {
|
|
143
|
+
undoOptions.columns = columnUndoOptions;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
syncColumnIds(undoOptions, mergedOptions);
|
|
147
|
+
}
|
|
148
|
+
this.currentResponsive = {
|
|
149
|
+
ruleIds: ruleIdsString,
|
|
150
|
+
mergedOptions,
|
|
151
|
+
undoOptions
|
|
152
|
+
};
|
|
153
|
+
if (redraw) {
|
|
154
|
+
lastUpdate = this.update(mergedOptions, true);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this.update(mergedOptions, false);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Keep the flag alive until the last queued update finishes so that
|
|
161
|
+
// ResizeObserver callbacks arriving in the meantime are ignored.
|
|
162
|
+
if (lastUpdate !== void 0) {
|
|
163
|
+
void lastUpdate.then(() => {
|
|
164
|
+
this.updatingResponsive = false;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.updatingResponsive = false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Builds undo options for columns by matching them by id.
|
|
173
|
+
*
|
|
174
|
+
* @param this
|
|
175
|
+
* Reference to Grid.
|
|
176
|
+
*
|
|
177
|
+
* @param mergedOptions
|
|
178
|
+
* The merged responsive options used to apply updates.
|
|
179
|
+
*/
|
|
180
|
+
function getColumnUndoOptions(mergedOptions) {
|
|
181
|
+
const mergedColumns = mergedOptions.columns;
|
|
182
|
+
const currentColumns = this.options?.columns;
|
|
183
|
+
if (!mergedColumns || !currentColumns) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const result = [];
|
|
187
|
+
const columnMap = new Map();
|
|
188
|
+
for (let i = 0, iEnd = currentColumns.length; i < iEnd; ++i) {
|
|
189
|
+
const column = currentColumns[i];
|
|
190
|
+
if (typeof column.id === 'string') {
|
|
191
|
+
columnMap.set(column.id, column);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
for (let i = 0, iEnd = mergedColumns.length; i < iEnd; ++i) {
|
|
195
|
+
const mergedColumn = mergedColumns[i];
|
|
196
|
+
const columnId = (typeof mergedColumn?.id === 'string') ?
|
|
197
|
+
mergedColumn.id :
|
|
198
|
+
void 0;
|
|
199
|
+
if (!mergedColumn || !columnId) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const currentColumn = columnMap.get(columnId);
|
|
203
|
+
if (!currentColumn) {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
const columnUndo = diffObjects(mergedColumn, currentColumn, true);
|
|
207
|
+
if (Object.keys(columnUndo).length > 0) {
|
|
208
|
+
columnUndo.id = columnId;
|
|
209
|
+
result.push(columnUndo);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (result.length) {
|
|
213
|
+
return result;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Ensures column options keep their ids when undoing responsive updates.
|
|
218
|
+
*
|
|
219
|
+
* @param undoOptions
|
|
220
|
+
* The undo options to be updated.
|
|
221
|
+
*
|
|
222
|
+
* @param mergedOptions
|
|
223
|
+
* The merged responsive options used to apply updates.
|
|
224
|
+
*/
|
|
225
|
+
function syncColumnIds(undoOptions, mergedOptions) {
|
|
226
|
+
const mergedColumns = mergedOptions.columns;
|
|
227
|
+
const undoColumns = undoOptions.columns;
|
|
228
|
+
if (!mergedColumns || !undoColumns) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
for (let i = 0, iEnd = Math.min(mergedColumns.length, undoColumns.length); i < iEnd; ++i) {
|
|
232
|
+
const mergedColumn = mergedColumns[i];
|
|
233
|
+
const undoColumn = undoColumns[i];
|
|
234
|
+
if (mergedColumn && undoColumn && !('id' in undoColumn)) {
|
|
235
|
+
undoColumn.id = mergedColumn.id;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Handles the resize event.
|
|
241
|
+
*
|
|
242
|
+
* @param this
|
|
243
|
+
* Reference to Grid.
|
|
244
|
+
*
|
|
245
|
+
* @param entry
|
|
246
|
+
* The resize observer entry.
|
|
247
|
+
*/
|
|
248
|
+
function onResize(entry) {
|
|
249
|
+
if (!this.activeRules || this.updatingResponsive) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const rules = this.options?.responsive?.rules || [];
|
|
253
|
+
const matchingRules = [];
|
|
254
|
+
for (const rule of rules) {
|
|
255
|
+
if (typeof rule._id === 'undefined') {
|
|
256
|
+
rule._id = uniqueKey();
|
|
257
|
+
}
|
|
258
|
+
if (matchResponsiveRule.call(this, rule, entry)) {
|
|
259
|
+
matchingRules.push(rule);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
this.activeRules = new Set(matchingRules);
|
|
263
|
+
setResponsive.call(this, matchingRules);
|
|
264
|
+
}
|
|
265
|
+
/* *
|
|
266
|
+
*
|
|
267
|
+
* Default Export
|
|
268
|
+
*
|
|
269
|
+
* */
|
|
270
|
+
export default {
|
|
271
|
+
compose
|
|
272
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { DeepPartial } from '../../../Shared/Types';
|
|
2
|
+
import type { Options } from '../Options';
|
|
3
|
+
import type Grid from '../Grid';
|
|
4
|
+
/**
|
|
5
|
+
* Options for the responsive behavior of the grid.
|
|
6
|
+
*/
|
|
7
|
+
export interface ResponsiveOptions {
|
|
8
|
+
/**
|
|
9
|
+
* A set of rules for responsive settings. The rules are executed from
|
|
10
|
+
* the top down.
|
|
11
|
+
*/
|
|
12
|
+
rules?: Array<RuleOptions>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A rule for the responsive behavior of the grid.
|
|
16
|
+
*/
|
|
17
|
+
export interface RuleOptions {
|
|
18
|
+
/**
|
|
19
|
+
* A full set of grid options to apply as overrides to the general grid
|
|
20
|
+
* options. The grid options are applied when the given rule is active.
|
|
21
|
+
*/
|
|
22
|
+
gridOptions: DeepPartial<Exclude<Options, 'responsive' | 'id'>>;
|
|
23
|
+
/**
|
|
24
|
+
* Under which conditions the rule applies.
|
|
25
|
+
*/
|
|
26
|
+
condition: RuleConditionOptions;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Conditions for the responsive rule.
|
|
30
|
+
*/
|
|
31
|
+
export interface RuleConditionOptions {
|
|
32
|
+
/**
|
|
33
|
+
* A callback function to gain complete control on when the responsive
|
|
34
|
+
* rule applies. Return `true` if it applies. This opens for checking
|
|
35
|
+
* against other metrics than the grid size, for example the document
|
|
36
|
+
* size or other elements.
|
|
37
|
+
*/
|
|
38
|
+
callback?: (this: Grid, grid: Grid) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The responsive rule applies if the grid width is less or equal to this.
|
|
41
|
+
*/
|
|
42
|
+
maxWidth?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The responsive rule applies if the grid height is less or equal to this.
|
|
45
|
+
*/
|
|
46
|
+
maxHeight?: number;
|
|
47
|
+
/**
|
|
48
|
+
* The responsive rule applies if the grid width is greater or equal to
|
|
49
|
+
* this.
|
|
50
|
+
*/
|
|
51
|
+
minWidth?: number;
|
|
52
|
+
/**
|
|
53
|
+
* The responsive rule applies if the grid height is greater or equal to
|
|
54
|
+
* this.
|
|
55
|
+
*/
|
|
56
|
+
minHeight?: number;
|
|
57
|
+
}
|
|
58
|
+
export default ResponsiveOptions;
|
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
*
|
|
16
16
|
* */
|
|
17
17
|
'use strict';
|
|
18
|
-
import U from '../../../../../Core/Utilities.js';
|
|
19
18
|
import GU from '../../../GridUtils.js';
|
|
20
19
|
import Globals from '../../../Globals.js';
|
|
21
20
|
import { conditionsMap } from './FilteringTypes.js';
|
|
22
|
-
|
|
21
|
+
import { defined, fireEvent } from '../../../../../Shared/Utilities.js';
|
|
23
22
|
const { makeHTMLElement } = GU;
|
|
24
23
|
/* *
|
|
25
24
|
*
|
|
@@ -328,7 +327,7 @@ class ColumnFiltering {
|
|
|
328
327
|
renderClearButton(inputWrapper) {
|
|
329
328
|
this.clearButton = makeHTMLElement('button', {
|
|
330
329
|
className: Globals.getClassName('clearFilterButton'),
|
|
331
|
-
innerText: 'Clear filter' // TODO: Lang
|
|
330
|
+
innerText: 'Clear filter' // TODO(lang): Lang
|
|
332
331
|
}, inputWrapper);
|
|
333
332
|
this.clearButton.setAttribute('tabindex', '-1');
|
|
334
333
|
this.clearButton.disabled = !this.isFilteringApplied();
|
|
@@ -7,7 +7,7 @@ import HeaderCell from '../../Header/HeaderCell.js';
|
|
|
7
7
|
declare class FilterCell extends HeaderCell {
|
|
8
8
|
column: Column;
|
|
9
9
|
constructor(row: Row, column: Column);
|
|
10
|
-
render(): void
|
|
10
|
+
render(): Promise<void>;
|
|
11
11
|
onKeyDown(e: KeyboardEvent): void;
|
|
12
12
|
onClick(e: MouseEvent): void;
|
|
13
13
|
}
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* */
|
|
15
15
|
'use strict';
|
|
16
16
|
import HeaderCell from '../../Header/HeaderCell.js';
|
|
17
|
-
import
|
|
18
|
-
const { fireEvent } = U;
|
|
17
|
+
import { fireEvent } from '../../../../../Shared/Utilities.js';
|
|
19
18
|
/* *
|
|
20
19
|
*
|
|
21
20
|
* Class
|
|
@@ -40,10 +39,10 @@ class FilterCell extends HeaderCell {
|
|
|
40
39
|
* Methods
|
|
41
40
|
*
|
|
42
41
|
* */
|
|
43
|
-
render() {
|
|
42
|
+
async render() {
|
|
44
43
|
const { column } = this;
|
|
45
44
|
if (!column) {
|
|
46
|
-
return;
|
|
45
|
+
return Promise.resolve();
|
|
47
46
|
}
|
|
48
47
|
// Render content of th element
|
|
49
48
|
this.row.htmlElement.appendChild(this.htmlElement);
|
|
@@ -48,7 +48,7 @@ class FilterRow extends HeaderRow {
|
|
|
48
48
|
createCell(column) {
|
|
49
49
|
return new FilterCell(this, column);
|
|
50
50
|
}
|
|
51
|
-
renderContent() {
|
|
51
|
+
async renderContent() {
|
|
52
52
|
const vp = this.viewport;
|
|
53
53
|
const enabledColumns = vp.grid.enabledColumns || [];
|
|
54
54
|
vp.theadElement?.appendChild(this.htmlElement);
|
|
@@ -59,7 +59,7 @@ class FilterRow extends HeaderRow {
|
|
|
59
59
|
continue;
|
|
60
60
|
}
|
|
61
61
|
const cell = this.createCell(column);
|
|
62
|
-
cell.render();
|
|
62
|
+
await cell.render();
|
|
63
63
|
if (column.options.filtering?.inline) {
|
|
64
64
|
column.filtering?.renderFilteringContent(cell.htmlElement);
|
|
65
65
|
}
|
|
@@ -12,6 +12,10 @@ declare class ColumnSorting {
|
|
|
12
12
|
* The head element of the column.
|
|
13
13
|
*/
|
|
14
14
|
headerCellElement: HTMLElement;
|
|
15
|
+
/**
|
|
16
|
+
* Last index used from the configured order sequence.
|
|
17
|
+
*/
|
|
18
|
+
private lastOrderSequenceIndex?;
|
|
15
19
|
/**
|
|
16
20
|
* Constructs sorting for a dedicated column.
|
|
17
21
|
*
|
|
@@ -37,6 +41,17 @@ declare class ColumnSorting {
|
|
|
37
41
|
* The column to update.
|
|
38
42
|
*/
|
|
39
43
|
private updateColumnOptions;
|
|
44
|
+
/**
|
|
45
|
+
* Returns sorting order sequence for this column.
|
|
46
|
+
*/
|
|
47
|
+
private getOrderSequence;
|
|
48
|
+
/**
|
|
49
|
+
* Normalizes arbitrary sorting values to valid order states.
|
|
50
|
+
*
|
|
51
|
+
* @param order
|
|
52
|
+
* Value to normalize.
|
|
53
|
+
*/
|
|
54
|
+
private normalizeOrder;
|
|
40
55
|
/**
|
|
41
56
|
* Set sorting order for the column. It will modify the presentation data
|
|
42
57
|
* and rerender the rows.
|
|
@@ -50,7 +65,8 @@ declare class ColumnSorting {
|
|
|
50
65
|
*/
|
|
51
66
|
setOrder(order: ColumnSortingOrder, additive?: boolean): Promise<void>;
|
|
52
67
|
/**
|
|
53
|
-
* Toggle sorting order for the column
|
|
68
|
+
* Toggle sorting order for the column according to the configured
|
|
69
|
+
* sorting order sequence.
|
|
54
70
|
*
|
|
55
71
|
* @param e
|
|
56
72
|
* Optional mouse or keyboard event.
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* */
|
|
16
16
|
'use strict';
|
|
17
17
|
import Globals from '../../Globals.js';
|
|
18
|
-
import
|
|
19
|
-
const { fireEvent } = U;
|
|
18
|
+
import { fireEvent } from '../../../../Shared/Utilities.js';
|
|
20
19
|
/* *
|
|
21
20
|
*
|
|
22
21
|
* Class
|
|
@@ -42,7 +41,8 @@ class ColumnSorting {
|
|
|
42
41
|
*/
|
|
43
42
|
constructor(column, headerCellElement) {
|
|
44
43
|
/**
|
|
45
|
-
* Toggle sorting order for the column
|
|
44
|
+
* Toggle sorting order for the column according to the configured
|
|
45
|
+
* sorting order sequence.
|
|
46
46
|
*
|
|
47
47
|
* @param e
|
|
48
48
|
* Optional mouse or keyboard event.
|
|
@@ -52,18 +52,40 @@ class ColumnSorting {
|
|
|
52
52
|
const querying = viewport.grid.querying;
|
|
53
53
|
const sortingController = querying.sorting;
|
|
54
54
|
const additive = !!e?.shiftKey;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(
|
|
58
|
-
this.column.id
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
let hasCurrentColumnSorting = false;
|
|
56
|
+
const currentOrder = (() => {
|
|
57
|
+
if (additive) {
|
|
58
|
+
const currentSorting = sortingController.currentSortings?.find((sorting) => sorting.columnId === this.column.id);
|
|
59
|
+
hasCurrentColumnSorting = !!currentSorting;
|
|
60
|
+
return this.normalizeOrder(currentSorting?.order);
|
|
61
|
+
}
|
|
62
|
+
const currentSorting = sortingController.currentSorting;
|
|
63
|
+
hasCurrentColumnSorting =
|
|
64
|
+
currentSorting?.columnId === this.column.id;
|
|
65
|
+
return hasCurrentColumnSorting ?
|
|
66
|
+
this.normalizeOrder(currentSorting?.order) :
|
|
67
|
+
null;
|
|
68
|
+
})();
|
|
69
|
+
const orderSequence = this.getOrderSequence();
|
|
70
|
+
if (orderSequence.length < 1) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let nextOrderIndex = 0;
|
|
74
|
+
const lastIndex = this.lastOrderSequenceIndex;
|
|
75
|
+
if (hasCurrentColumnSorting &&
|
|
76
|
+
typeof lastIndex === 'number' &&
|
|
77
|
+
orderSequence[lastIndex] === currentOrder) {
|
|
78
|
+
nextOrderIndex = (lastIndex + 1) % orderSequence.length;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const currentOrderIndex = orderSequence.indexOf(currentOrder);
|
|
82
|
+
nextOrderIndex = (currentOrderIndex === -1 ?
|
|
83
|
+
0 :
|
|
84
|
+
(currentOrderIndex + 1) % orderSequence.length);
|
|
85
|
+
}
|
|
86
|
+
this.lastOrderSequenceIndex = nextOrderIndex;
|
|
87
|
+
const nextOrder = orderSequence[nextOrderIndex];
|
|
88
|
+
void this.setOrder(nextOrder, additive);
|
|
67
89
|
};
|
|
68
90
|
this.column = column;
|
|
69
91
|
this.headerCellElement = headerCellElement;
|
|
@@ -155,6 +177,27 @@ class ColumnSorting {
|
|
|
155
177
|
}
|
|
156
178
|
}
|
|
157
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Returns sorting order sequence for this column.
|
|
182
|
+
*/
|
|
183
|
+
getOrderSequence() {
|
|
184
|
+
return this.column.options.sorting?.orderSequence || [
|
|
185
|
+
'asc',
|
|
186
|
+
'desc',
|
|
187
|
+
null
|
|
188
|
+
];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Normalizes arbitrary sorting values to valid order states.
|
|
192
|
+
*
|
|
193
|
+
* @param order
|
|
194
|
+
* Value to normalize.
|
|
195
|
+
*/
|
|
196
|
+
normalizeOrder(order) {
|
|
197
|
+
return order === 'asc' || order === 'desc' ?
|
|
198
|
+
order :
|
|
199
|
+
null;
|
|
200
|
+
}
|
|
158
201
|
/**
|
|
159
202
|
* Set sorting order for the column. It will modify the presentation data
|
|
160
203
|
* and rerender the rows.
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
'use strict';
|
|
17
17
|
import GridUtils from '../../GridUtils.js';
|
|
18
18
|
import Globals from '../../Globals.js';
|
|
19
|
-
import
|
|
19
|
+
import { fireEvent } from '../../../../Shared/Utilities.js';
|
|
20
20
|
const { makeHTMLElement } = GridUtils;
|
|
21
|
-
const { fireEvent } = Utils;
|
|
22
21
|
/* *
|
|
23
22
|
*
|
|
24
23
|
* Class
|
|
@@ -58,7 +57,6 @@ class ColumnsResizer {
|
|
|
58
57
|
const vp = this.viewport;
|
|
59
58
|
vp.columnResizing.resize(this, diff);
|
|
60
59
|
vp.reflow();
|
|
61
|
-
vp.rowsVirtualizer.adjustRowHeights();
|
|
62
60
|
fireEvent(this.draggedColumn, 'afterResize', {
|
|
63
61
|
target: this.draggedColumn,
|
|
64
62
|
originalEvent: e
|