@highcharts/grid-pro 2.0.1 → 2.1.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/css/grid-pro.css +69 -85
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +2 -0
- package/es-modules/Accessibility/Options/LangDefaults.js +6 -1
- package/es-modules/Accessibility/Utils/ChartUtilities.js +3 -3
- package/es-modules/Core/Color/ColorString.d.ts +25 -0
- package/es-modules/Core/Color/ColorType.d.ts +43 -0
- package/es-modules/Core/Color/GradientColor.d.ts +57 -0
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/Renderer/AlignObject.d.ts +37 -0
- package/es-modules/Core/Renderer/BBoxObject.d.ts +40 -0
- package/es-modules/Core/Renderer/CSSObject.d.ts +130 -0
- package/es-modules/Core/Renderer/DOMElementType.d.ts +36 -0
- package/es-modules/Core/Renderer/DashStyleValue.d.ts +28 -0
- package/es-modules/Core/Renderer/FontMetricsObject.d.ts +38 -0
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +57 -0
- package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +19 -0
- package/es-modules/Core/Renderer/Position3DObject.d.ts +35 -0
- package/es-modules/Core/Renderer/PositionObject.d.ts +28 -0
- package/es-modules/Core/Renderer/RectangleObject.d.ts +35 -0
- package/es-modules/Core/Renderer/RendererType.d.ts +53 -0
- package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +43 -0
- package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +44 -0
- package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +147 -0
- package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +42 -0
- package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +42 -0
- package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +31 -0
- package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +97 -0
- package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +40 -0
- package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +31 -0
- package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +41 -0
- package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +50 -0
- package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +40 -0
- package/es-modules/Core/Renderer/SizeObject.d.ts +28 -0
- package/es-modules/Core/Templating.js +6 -7
- package/es-modules/Data/Connectors/DataConnector.js +3 -2
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +1 -1
- package/es-modules/Data/DataTable.d.ts +1 -1
- package/es-modules/Data/DataTable.js +3 -2
- package/es-modules/Data/DataTableCore.js +15 -6
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +13 -15
- package/es-modules/Grid/Core/Credits.d.ts +0 -2
- package/es-modules/Grid/Core/Defaults.d.ts +20 -17
- package/es-modules/Grid/Core/Defaults.js +116 -114
- package/es-modules/Grid/Core/Globals.d.ts +108 -32
- package/es-modules/Grid/Core/Globals.js +98 -111
- package/es-modules/Grid/Core/Grid.d.ts +51 -17
- package/es-modules/Grid/Core/Grid.js +369 -79
- package/es-modules/Grid/Core/GridUtils.d.ts +96 -89
- package/es-modules/Grid/Core/GridUtils.js +143 -155
- package/es-modules/Grid/Core/Options.d.ts +3 -7
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +4 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +32 -57
- package/es-modules/Grid/Core/Pagination/Pagination.js +206 -214
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +22 -15
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +32 -9
- package/es-modules/Grid/Core/Querying/PaginationController.js +58 -18
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +7 -15
- package/es-modules/Grid/Core/Querying/SortingController.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +32 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +3 -5
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +1 -5
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +14 -10
- package/es-modules/Grid/Core/Table/Body/TableCell.js +19 -21
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Cell.js +30 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +2 -7
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +25 -14
- package/es-modules/Grid/Core/Table/Column.d.ts +7 -9
- package/es-modules/Grid/Core/Table/Column.js +23 -1
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +2 -2
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +30 -23
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +39 -39
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +1 -1
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +2 -2
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +10 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +2 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +26 -24
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +37 -39
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +11 -13
- package/es-modules/Grid/Core/Table/Table.js +9 -5
- package/es-modules/Grid/Core/UI/Button.d.ts +1 -1
- package/es-modules/Grid/Core/UI/ContextMenu.d.ts +1 -1
- package/es-modules/Grid/Core/UI/ContextMenu.js +1 -1
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +39 -44
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +4 -4
- package/es-modules/Grid/Core/UI/Popup.d.ts +17 -19
- package/es-modules/Grid/Core/UI/Popup.js +2 -1
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +49 -50
- package/es-modules/Grid/Core/UI/SvgIcons.js +114 -123
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +46 -52
- package/es-modules/Grid/Core/UI/ToolbarButton.js +4 -3
- package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +6 -8
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +8 -11
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +27 -1
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +149 -149
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +18 -20
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +19 -17
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +28 -34
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +12 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +41 -46
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +19 -8
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +17 -13
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +18 -20
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +17 -20
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +20 -22
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +40 -42
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +16 -18
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +14 -22
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +22 -24
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +46 -51
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +62 -77
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +16 -3
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +26 -31
- package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +0 -2
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +12 -11
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +29 -31
- package/es-modules/Grid/Pro/Export/Exporting.d.ts +3 -3
- package/es-modules/Grid/Pro/Export/Exporting.js +35 -29
- package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +12 -11
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +24 -26
- package/es-modules/Grid/Pro/GridEvents.d.ts +19 -1
- package/es-modules/Grid/Pro/GridEvents.js +6 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +4 -11
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +44 -45
- package/es-modules/Grid/index.d.ts +1 -0
- package/es-modules/masters/grid-pro.src.d.ts +62 -37
- package/es-modules/masters/grid-pro.src.js +37 -39
- package/grid-pro.d.ts +122 -48
- package/grid-pro.js +3 -6
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +122 -48
- package/grid-pro.src.js +6645 -6270
- package/package.json +5 -4
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +0 -29
|
@@ -18,7 +18,7 @@ import CellContent from './CellContent.js';
|
|
|
18
18
|
import GridUtils from '../../GridUtils.js';
|
|
19
19
|
const { setHTMLContent } = GridUtils;
|
|
20
20
|
import Utils from '../../../../Core/Utilities.js';
|
|
21
|
-
const { defined } = Utils;
|
|
21
|
+
const { defined, isString } = Utils;
|
|
22
22
|
/* *
|
|
23
23
|
*
|
|
24
24
|
* Class
|
|
@@ -28,10 +28,20 @@ const { defined } = Utils;
|
|
|
28
28
|
* Represents a text type of content.
|
|
29
29
|
*/
|
|
30
30
|
class TextContent extends CellContent {
|
|
31
|
+
/* *
|
|
32
|
+
*
|
|
33
|
+
* Constructor
|
|
34
|
+
*
|
|
35
|
+
* */
|
|
31
36
|
constructor(cell) {
|
|
32
37
|
super(cell);
|
|
33
38
|
this.add();
|
|
34
39
|
}
|
|
40
|
+
/* *
|
|
41
|
+
*
|
|
42
|
+
* Methods
|
|
43
|
+
*
|
|
44
|
+
* */
|
|
35
45
|
add() {
|
|
36
46
|
this.update();
|
|
37
47
|
}
|
|
@@ -66,7 +76,13 @@ class TextContent extends CellContent {
|
|
|
66
76
|
(format ? cell.format(format) : value + '');
|
|
67
77
|
}
|
|
68
78
|
else if (isDefaultFormat) {
|
|
69
|
-
|
|
79
|
+
const formattedValue = formatter?.call(cell);
|
|
80
|
+
if (isString(formattedValue)) {
|
|
81
|
+
cellContent = formattedValue;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
cellContent = value + '';
|
|
85
|
+
}
|
|
70
86
|
}
|
|
71
87
|
else if (isDefaultFormatter) {
|
|
72
88
|
cellContent = format ? cell.format(format) : value + '';
|
|
@@ -76,20 +92,15 @@ class TextContent extends CellContent {
|
|
|
76
92
|
}
|
|
77
93
|
/* *
|
|
78
94
|
*
|
|
79
|
-
*
|
|
95
|
+
* Static Properties
|
|
80
96
|
*
|
|
81
97
|
* */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
number: '{value}',
|
|
89
|
-
'boolean': '{value}',
|
|
90
|
-
datetime: '{value:%Y-%m-%d %H:%M:%S}'
|
|
91
|
-
};
|
|
92
|
-
})(TextContent || (TextContent = {}));
|
|
98
|
+
TextContent.defaultFormatsForDataTypes = {
|
|
99
|
+
string: '{value}',
|
|
100
|
+
number: '{value}',
|
|
101
|
+
'boolean': '{value}',
|
|
102
|
+
datetime: '{value:%Y-%m-%d %H:%M:%S}'
|
|
103
|
+
};
|
|
93
104
|
/* *
|
|
94
105
|
*
|
|
95
106
|
* Default Export
|
|
@@ -10,7 +10,7 @@ import TableCell from './Body/TableCell';
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents a column in the data grid.
|
|
12
12
|
*/
|
|
13
|
-
declare class Column {
|
|
13
|
+
export declare class Column {
|
|
14
14
|
/**
|
|
15
15
|
* The viewport (table) the column belongs to.
|
|
16
16
|
*/
|
|
@@ -18,7 +18,7 @@ declare class Column {
|
|
|
18
18
|
/**
|
|
19
19
|
* Type of the data in the column.
|
|
20
20
|
*/
|
|
21
|
-
readonly dataType:
|
|
21
|
+
readonly dataType: ColumnDataType;
|
|
22
22
|
/**
|
|
23
23
|
* The cells of the column.
|
|
24
24
|
*/
|
|
@@ -35,7 +35,7 @@ declare class Column {
|
|
|
35
35
|
* The options of the column as a proxy that provides merged access to
|
|
36
36
|
* original options and defaults if not defined in the individual options.
|
|
37
37
|
*/
|
|
38
|
-
readonly options:
|
|
38
|
+
readonly options: NoIdColumnOptions;
|
|
39
39
|
/**
|
|
40
40
|
* The index of the column in the viewport.
|
|
41
41
|
*/
|
|
@@ -126,11 +126,9 @@ declare class Column {
|
|
|
126
126
|
* The formatted string.
|
|
127
127
|
*/
|
|
128
128
|
format(template: string): string;
|
|
129
|
-
update(options:
|
|
130
|
-
update(options:
|
|
131
|
-
}
|
|
132
|
-
declare namespace Column {
|
|
133
|
-
type Options = Omit<IndividualColumnOptions, 'id'>;
|
|
134
|
-
type DataType = 'string' | 'number' | 'boolean' | 'datetime';
|
|
129
|
+
update(options: NoIdColumnOptions, render?: boolean): void;
|
|
130
|
+
update(options: NoIdColumnOptions, render?: true): Promise<void>;
|
|
135
131
|
}
|
|
132
|
+
export type NoIdColumnOptions = Omit<IndividualColumnOptions, 'id'>;
|
|
133
|
+
export type ColumnDataType = 'string' | 'number' | 'boolean' | 'datetime';
|
|
136
134
|
export default Column;
|
|
@@ -30,7 +30,7 @@ const { createOptionsProxy } = GridUtils;
|
|
|
30
30
|
/**
|
|
31
31
|
* Represents a column in the data grid.
|
|
32
32
|
*/
|
|
33
|
-
class Column {
|
|
33
|
+
export class Column {
|
|
34
34
|
/* *
|
|
35
35
|
*
|
|
36
36
|
* Constructor
|
|
@@ -208,6 +208,28 @@ class Column {
|
|
|
208
208
|
format(template) {
|
|
209
209
|
return Templating.format(template, this, this.viewport.grid);
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Sets the new column options to the userOptions field.
|
|
213
|
+
*
|
|
214
|
+
* @param options
|
|
215
|
+
* The options to set.
|
|
216
|
+
*
|
|
217
|
+
* @param overwrite
|
|
218
|
+
* Whether to overwrite the existing column options with the new ones.
|
|
219
|
+
* Default is `false`.
|
|
220
|
+
*
|
|
221
|
+
* @returns
|
|
222
|
+
* The difference between the previous and the new column options in form
|
|
223
|
+
* of a record of `[column.id]: column.options`.
|
|
224
|
+
*
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
setOptions(options, overwrite = false) {
|
|
228
|
+
return this.viewport.grid.setColumnOptions([{
|
|
229
|
+
id: this.id,
|
|
230
|
+
...options
|
|
231
|
+
}], overwrite);
|
|
232
|
+
}
|
|
211
233
|
/**
|
|
212
234
|
* Updates the column with new options.
|
|
213
235
|
*
|
|
@@ -46,11 +46,11 @@ class AdjacentResizingMode extends ResizingMode {
|
|
|
46
46
|
const newW = Math.round(Math.max(colW + diff, minWidth) * 10) / 10;
|
|
47
47
|
this.columnWidths[column.id] = newW;
|
|
48
48
|
this.columnWidthUnits[column.id] = 0; // Always save in px
|
|
49
|
-
column.
|
|
49
|
+
column.setOptions({ width: newW });
|
|
50
50
|
if (nextCol) {
|
|
51
51
|
const newNextW = this.columnWidths[nextCol.id] = Math.round(Math.max((resizer.nextColumnStartWidth ?? 0) + colW - newW, minWidth) * 10) / 10;
|
|
52
52
|
this.columnWidthUnits[nextCol.id] = 0; // Always save in px
|
|
53
|
-
nextCol.
|
|
53
|
+
nextCol.setOptions({ width: newNextW });
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -3,30 +3,37 @@ import ResizingMode from './ResizingMode.js';
|
|
|
3
3
|
import AdjacentResizingMode from './AdjacentResizingMode.js';
|
|
4
4
|
import IndependentResizingMode from './IndependentResizingMode.js';
|
|
5
5
|
import DistributedResizingMode from './DistributedResizingMode.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
export type ColumnResizingMode = keyof typeof types;
|
|
7
|
+
/**
|
|
8
|
+
* Abstract class representing a column resizing mode.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AbstractStrategy: typeof ResizingMode;
|
|
11
|
+
/**
|
|
12
|
+
* Registry of column resizing modes.
|
|
13
|
+
*/
|
|
14
|
+
export declare const types: {
|
|
15
|
+
adjacent: typeof AdjacentResizingMode;
|
|
16
|
+
distributed: typeof DistributedResizingMode;
|
|
17
|
+
independent: typeof IndependentResizingMode;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new column resizing mode instance based on the
|
|
21
|
+
* viewport's options.
|
|
22
|
+
*
|
|
23
|
+
* @param viewport
|
|
24
|
+
* The table that the column resizing mode is applied to.
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
* The proper column resizing mode.
|
|
28
|
+
*/
|
|
29
|
+
export declare function initMode(viewport: Table): ResizingMode;
|
|
30
|
+
declare const _default: {
|
|
31
|
+
readonly initMode: typeof initMode;
|
|
32
|
+
readonly types: {
|
|
15
33
|
adjacent: typeof AdjacentResizingMode;
|
|
16
34
|
distributed: typeof DistributedResizingMode;
|
|
17
35
|
independent: typeof IndependentResizingMode;
|
|
18
36
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* viewport's options.
|
|
23
|
-
*
|
|
24
|
-
* @param viewport
|
|
25
|
-
* The table that the column resizing mode is applied to.
|
|
26
|
-
*
|
|
27
|
-
* @returns
|
|
28
|
-
* The proper column resizing mode.
|
|
29
|
-
*/
|
|
30
|
-
function initMode(viewport: Table): ResizingMode;
|
|
31
|
-
}
|
|
32
|
-
export default ColumnResizing;
|
|
37
|
+
readonly AbstractStrategy: typeof ResizingMode;
|
|
38
|
+
};
|
|
39
|
+
export default _default;
|
|
@@ -19,50 +19,50 @@ import IndependentResizingMode from './IndependentResizingMode.js';
|
|
|
19
19
|
import DistributedResizingMode from './DistributedResizingMode.js';
|
|
20
20
|
/* *
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
* Definitions
|
|
23
23
|
*
|
|
24
24
|
* */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'default \'adjacent\' mode.');
|
|
57
|
-
ModeConstructor = ColumnResizing.types.adjacent;
|
|
58
|
-
}
|
|
59
|
-
return new ModeConstructor(viewport);
|
|
25
|
+
/**
|
|
26
|
+
* Abstract class representing a column resizing mode.
|
|
27
|
+
*/
|
|
28
|
+
export const AbstractStrategy = ResizingMode;
|
|
29
|
+
/**
|
|
30
|
+
* Registry of column resizing modes.
|
|
31
|
+
*/
|
|
32
|
+
export const types = {
|
|
33
|
+
adjacent: AdjacentResizingMode,
|
|
34
|
+
distributed: DistributedResizingMode,
|
|
35
|
+
independent: IndependentResizingMode
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new column resizing mode instance based on the
|
|
39
|
+
* viewport's options.
|
|
40
|
+
*
|
|
41
|
+
* @param viewport
|
|
42
|
+
* The table that the column resizing mode is applied to.
|
|
43
|
+
*
|
|
44
|
+
* @returns
|
|
45
|
+
* The proper column resizing mode.
|
|
46
|
+
*/
|
|
47
|
+
export function initMode(viewport) {
|
|
48
|
+
const modeName = viewport.grid.options?.rendering?.columns?.resizing?.mode ||
|
|
49
|
+
'adjacent';
|
|
50
|
+
let ModeConstructor = types[modeName];
|
|
51
|
+
if (!ModeConstructor) {
|
|
52
|
+
// eslint-disable-next-line no-console
|
|
53
|
+
console.warn(`Unknown column resizing mode: '${modeName}'. Applied ` +
|
|
54
|
+
'default \'adjacent\' mode.');
|
|
55
|
+
ModeConstructor = types.adjacent;
|
|
60
56
|
}
|
|
61
|
-
|
|
62
|
-
}
|
|
57
|
+
return new ModeConstructor(viewport);
|
|
58
|
+
}
|
|
63
59
|
/* *
|
|
64
60
|
*
|
|
65
61
|
* Default Export
|
|
66
62
|
*
|
|
67
63
|
* */
|
|
68
|
-
export default
|
|
64
|
+
export default {
|
|
65
|
+
initMode,
|
|
66
|
+
types,
|
|
67
|
+
AbstractStrategy
|
|
68
|
+
};
|
|
@@ -42,7 +42,7 @@ class DistributedResizingMode extends ResizingMode {
|
|
|
42
42
|
// Set the width of the resized column.
|
|
43
43
|
const width = this.columnWidths[column.id] = Math.round(Math.max((resizer.columnStartWidth || 0) + diff, ResizingMode.getMinWidth(column)) * 10) / 10;
|
|
44
44
|
this.columnWidthUnits[column.id] = 0; // Set to px
|
|
45
|
-
column.
|
|
45
|
+
column.setOptions({ width });
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/* *
|
|
@@ -50,9 +50,9 @@ class IndependentResizingMode extends ResizingMode {
|
|
|
50
50
|
const rcWidth = this.columnWidths[rightCol.id] =
|
|
51
51
|
rightCol.getWidth();
|
|
52
52
|
this.columnWidthUnits[rightCol.id] = 0; // Set to px
|
|
53
|
-
rightCol.
|
|
53
|
+
rightCol.setOptions({ width: rcWidth });
|
|
54
54
|
}
|
|
55
|
-
column.
|
|
55
|
+
column.setOptions({ width });
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
/* *
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColumnResizingMode } from '
|
|
1
|
+
import type { ColumnResizingMode } from './ColumnResizing';
|
|
2
2
|
import type Table from '../Table';
|
|
3
3
|
import type Column from '../Column.js';
|
|
4
4
|
import type ColumnsResizer from '../Actions/ColumnsResizer';
|
|
@@ -30,6 +30,11 @@ declare abstract class ResizingMode {
|
|
|
30
30
|
* should be maintained when the table is destroyed and recreated.
|
|
31
31
|
*/
|
|
32
32
|
invalidated?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the column distribution strategy is dirty. This flag is used to
|
|
35
|
+
* determine whether the column widths should be re-loaded.
|
|
36
|
+
*/
|
|
37
|
+
isDirty?: boolean;
|
|
33
38
|
/**
|
|
34
39
|
* Creates a new column distribution strategy.
|
|
35
40
|
*
|
|
@@ -92,6 +92,15 @@ class HeaderCellToolbar {
|
|
|
92
92
|
container.removeEventListener('keydown', onKeyDown);
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Refreshes the state of the toolbar buttons.
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
refreshState() {
|
|
100
|
+
for (const button of this.buttons) {
|
|
101
|
+
button.refreshState();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
95
104
|
/**
|
|
96
105
|
* Destroys all buttons of the toolbar.
|
|
97
106
|
*/
|
|
@@ -142,6 +151,7 @@ class HeaderCellToolbar {
|
|
|
142
151
|
destroyer();
|
|
143
152
|
}
|
|
144
153
|
this.eventListenerDestroyers.length = 0;
|
|
154
|
+
this.clearButtons();
|
|
145
155
|
this.columnResizeObserver?.disconnect();
|
|
146
156
|
delete this.columnResizeObserver;
|
|
147
157
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type Button from '../../../UI/Button';
|
|
2
2
|
import ColumnFiltering from '../../Actions/ColumnFiltering/ColumnFiltering.js';
|
|
3
|
-
import Popup from '../../../UI/Popup.js';
|
|
3
|
+
import Popup, { PopupOptions } from '../../../UI/Popup.js';
|
|
4
4
|
/**
|
|
5
5
|
* The column filtering popup.
|
|
6
6
|
*/
|
|
@@ -21,7 +21,7 @@ declare class FilterPopup extends Popup {
|
|
|
21
21
|
* @param options
|
|
22
22
|
* Popup options.
|
|
23
23
|
*/
|
|
24
|
-
constructor(filtering: ColumnFiltering, button: Button, options?:
|
|
24
|
+
constructor(filtering: ColumnFiltering, button: Button, options?: PopupOptions);
|
|
25
25
|
show(anchorElement?: HTMLElement): void;
|
|
26
26
|
protected renderContent(contentElement: HTMLElement): void;
|
|
27
27
|
protected onKeyDown(event: KeyboardEvent): void;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import type Column from '../../Column';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the column is filtered.
|
|
4
|
+
*
|
|
5
|
+
* @param column
|
|
6
|
+
* The column to check.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isFiltered(column: Column): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the column is sorted.
|
|
11
|
+
*
|
|
12
|
+
* @param column
|
|
13
|
+
* The column to check.
|
|
14
|
+
*
|
|
15
|
+
* @param order
|
|
16
|
+
* Optional sorting order to check for.
|
|
17
|
+
*
|
|
18
|
+
* @returns
|
|
19
|
+
* True if the column is sorted. In case of `order` is provided, true
|
|
20
|
+
* only if the column is sorted in the provided order.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isSorted(column: Column, order?: ('asc' | 'desc')): boolean;
|
|
23
|
+
declare const _default: {
|
|
24
|
+
readonly isFiltered: typeof isFiltered;
|
|
25
|
+
readonly isSorted: typeof isSorted;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -18,48 +18,46 @@
|
|
|
18
18
|
* Namespace
|
|
19
19
|
*
|
|
20
20
|
* */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Checks if the column is filtered.
|
|
23
|
+
*
|
|
24
|
+
* @param column
|
|
25
|
+
* The column to check.
|
|
26
|
+
*/
|
|
27
|
+
export function isFiltered(column) {
|
|
28
|
+
const { condition, value } = column.options.filtering || {};
|
|
29
|
+
return !!(condition && (['empty', 'notEmpty', 'true', 'false'].includes(condition) ||
|
|
30
|
+
(value !== void 0 && value !== '') // Accept null and 0
|
|
31
|
+
));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the column is sorted.
|
|
35
|
+
*
|
|
36
|
+
* @param column
|
|
37
|
+
* The column to check.
|
|
38
|
+
*
|
|
39
|
+
* @param order
|
|
40
|
+
* Optional sorting order to check for.
|
|
41
|
+
*
|
|
42
|
+
* @returns
|
|
43
|
+
* True if the column is sorted. In case of `order` is provided, true
|
|
44
|
+
* only if the column is sorted in the provided order.
|
|
45
|
+
*/
|
|
46
|
+
export function isSorted(column, order) {
|
|
47
|
+
const { currentSorting } = column.viewport.grid.querying.sorting || {};
|
|
48
|
+
if (currentSorting?.columnId !== column.id) {
|
|
49
|
+
return false;
|
|
34
50
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* @param column
|
|
40
|
-
* The column to check.
|
|
41
|
-
*
|
|
42
|
-
* @param order
|
|
43
|
-
* Optional sorting order to check for.
|
|
44
|
-
*
|
|
45
|
-
* @returns
|
|
46
|
-
* True if the column is sorted. In case of `order` is provided, true
|
|
47
|
-
* only if the column is sorted in the provided order.
|
|
48
|
-
*/
|
|
49
|
-
function isSorted(column, order) {
|
|
50
|
-
const { currentSorting } = column.viewport.grid.querying.sorting || {};
|
|
51
|
-
if (currentSorting?.columnId !== column.id) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
return order ?
|
|
55
|
-
currentSorting?.order === order :
|
|
56
|
-
!!currentSorting?.order;
|
|
57
|
-
}
|
|
58
|
-
StateHelpers.isSorted = isSorted;
|
|
59
|
-
})(StateHelpers || (StateHelpers = {}));
|
|
51
|
+
return order ?
|
|
52
|
+
currentSorting?.order === order :
|
|
53
|
+
!!currentSorting?.order;
|
|
54
|
+
}
|
|
60
55
|
/* *
|
|
61
56
|
*
|
|
62
57
|
* Default Export
|
|
63
58
|
*
|
|
64
59
|
* */
|
|
65
|
-
export default
|
|
60
|
+
export default {
|
|
61
|
+
isFiltered,
|
|
62
|
+
isSorted
|
|
63
|
+
};
|
package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare class FilterToolbarButton extends ToolbarButton {
|
|
|
5
5
|
toolbar?: ColumnToolbar;
|
|
6
6
|
popup?: FilterPopup;
|
|
7
7
|
constructor();
|
|
8
|
-
|
|
8
|
+
refreshState(): void;
|
|
9
9
|
protected addEventListeners(): void;
|
|
10
10
|
protected clickHandler(event: MouseEvent): void;
|
|
11
11
|
}
|
package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare class MenuToolbarButton extends ToolbarButton {
|
|
|
6
6
|
popup?: MenuPopup;
|
|
7
7
|
constructor();
|
|
8
8
|
protected clickHandler(event: MouseEvent): void;
|
|
9
|
-
|
|
9
|
+
refreshState(): void;
|
|
10
10
|
protected addEventListeners(): void;
|
|
11
11
|
}
|
|
12
12
|
export default MenuToolbarButton;
|
package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare class SortToolbarButton extends ToolbarButton {
|
|
|
4
4
|
toolbar?: ColumnToolbar;
|
|
5
5
|
constructor();
|
|
6
6
|
protected clickHandler(event: MouseEvent): void;
|
|
7
|
-
|
|
7
|
+
refreshState(): void;
|
|
8
8
|
protected addEventListeners(): void;
|
|
9
9
|
protected renderActiveIndicator(): void;
|
|
10
10
|
}
|
|
@@ -135,7 +135,7 @@ declare class Table {
|
|
|
135
135
|
* @returns
|
|
136
136
|
* The viewport state metadata.
|
|
137
137
|
*/
|
|
138
|
-
getStateMeta():
|
|
138
|
+
getStateMeta(): ViewportStateMetadata;
|
|
139
139
|
/**
|
|
140
140
|
* Apply the metadata to the viewport state. It is used to restore the state
|
|
141
141
|
* of the viewport when the data grid is re-rendered.
|
|
@@ -143,7 +143,7 @@ declare class Table {
|
|
|
143
143
|
* @param meta
|
|
144
144
|
* The viewport state metadata.
|
|
145
145
|
*/
|
|
146
|
-
applyStateMeta(meta:
|
|
146
|
+
applyStateMeta(meta: ViewportStateMetadata): void;
|
|
147
147
|
/**
|
|
148
148
|
* Sets the focus anchor cell.
|
|
149
149
|
*
|
|
@@ -166,16 +166,14 @@ declare class Table {
|
|
|
166
166
|
*/
|
|
167
167
|
getRow(id: number): TableRow | undefined;
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
focusCursor?: [number, number];
|
|
179
|
-
}
|
|
169
|
+
/**
|
|
170
|
+
* Represents the metadata of the viewport state. It is used to save the
|
|
171
|
+
* state of the viewport and restore it when the data grid is re-rendered.
|
|
172
|
+
*/
|
|
173
|
+
export interface ViewportStateMetadata {
|
|
174
|
+
scrollTop: number;
|
|
175
|
+
scrollLeft: number;
|
|
176
|
+
columnResizing: ColumnResizingMode;
|
|
177
|
+
focusCursor?: [number, number];
|
|
180
178
|
}
|
|
181
179
|
export default Table;
|