@highcharts/grid-pro 2.0.0 → 2.1.0
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 +93 -90
- 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/Chart/Chart.js +1 -1
- 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 +22 -25
- 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/HeaderCell.js +3 -4
- 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 +6650 -6277
- package/package.json +13 -4
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +0 -29
|
@@ -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;
|
|
@@ -165,10 +165,10 @@ class Table {
|
|
|
165
165
|
// instead of the original data table row count.
|
|
166
166
|
const rowCount = Number(grid.dataTable?.rowCount);
|
|
167
167
|
const threshold = rows?.virtualizationThreshold ?? 50;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
if (grid.pagination) {
|
|
169
|
+
return grid.querying.pagination.currentPageSize >= threshold;
|
|
170
|
+
}
|
|
171
|
+
return rowCount >= threshold;
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Loads the columns of the table.
|
|
@@ -194,7 +194,7 @@ class Table {
|
|
|
194
194
|
if (vp.focusCursor) {
|
|
195
195
|
focusedRowId = vp.dataTable.getOriginalRowIndex(vp.focusCursor[0]);
|
|
196
196
|
}
|
|
197
|
-
vp.grid.pagination
|
|
197
|
+
vp.grid.querying.pagination.clampPage();
|
|
198
198
|
// Update data
|
|
199
199
|
const oldRowsCount = (vp.rows[vp.rows.length - 1]?.index ?? -1) + 1;
|
|
200
200
|
await vp.grid.querying.proceed();
|
|
@@ -238,11 +238,14 @@ class Table {
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
+
vp.grid.dirtyFlags.delete('rows');
|
|
241
242
|
}
|
|
242
243
|
/**
|
|
243
244
|
* Reflows the table's content dimensions.
|
|
244
245
|
*/
|
|
245
246
|
reflow() {
|
|
247
|
+
// TODO: More `needsReflow` logic can be added in the future to avoid
|
|
248
|
+
// unnecessary reflows of the table parts.
|
|
246
249
|
this.columnResizing.reflow();
|
|
247
250
|
// Reflow the head
|
|
248
251
|
this.header?.reflow();
|
|
@@ -254,6 +257,7 @@ class Table {
|
|
|
254
257
|
this.grid.popups.forEach((popup) => {
|
|
255
258
|
popup.reflow();
|
|
256
259
|
});
|
|
260
|
+
this.grid.dirtyFlags.delete('reflow');
|
|
257
261
|
}
|
|
258
262
|
/**
|
|
259
263
|
* Scrolls the table to the specified row.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type ContextMenu from './ContextMenu';
|
|
2
2
|
import type Button from './Button';
|
|
3
3
|
import type Popup from './Popup';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
declare class ContextMenuButton implements Button {
|
|
4
|
+
import { GridIconName } from './SvgIcons.js';
|
|
5
|
+
import { ClassNameKey } from '../Globals.js';
|
|
6
|
+
export declare class ContextMenuButton implements Button {
|
|
7
7
|
/**
|
|
8
8
|
* The wrapper `<li>` element for the button.
|
|
9
9
|
*/
|
|
@@ -24,7 +24,7 @@ declare class ContextMenuButton implements Button {
|
|
|
24
24
|
/**
|
|
25
25
|
* The options for the context menu button.
|
|
26
26
|
*/
|
|
27
|
-
protected options:
|
|
27
|
+
protected options: ContextMenuButtonOptions;
|
|
28
28
|
/**
|
|
29
29
|
* The container for the icon element.
|
|
30
30
|
*/
|
|
@@ -41,7 +41,7 @@ declare class ContextMenuButton implements Button {
|
|
|
41
41
|
* The span element for the label.
|
|
42
42
|
*/
|
|
43
43
|
private spanEl?;
|
|
44
|
-
constructor(options:
|
|
44
|
+
constructor(options: ContextMenuButtonOptions);
|
|
45
45
|
/**
|
|
46
46
|
* Adds the button to the context menu.
|
|
47
47
|
*
|
|
@@ -57,7 +57,7 @@ declare class ContextMenuButton implements Button {
|
|
|
57
57
|
* @param icon
|
|
58
58
|
* The icon to set.
|
|
59
59
|
*/
|
|
60
|
-
setIcon(icon?:
|
|
60
|
+
setIcon(icon?: GridIconName): void;
|
|
61
61
|
setActive(active: boolean): void;
|
|
62
62
|
setHighlighted(highlighted: boolean): void;
|
|
63
63
|
/**
|
|
@@ -84,43 +84,38 @@ declare class ContextMenuButton implements Button {
|
|
|
84
84
|
*/
|
|
85
85
|
private removeEventListeners;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* The click handler for the button.
|
|
122
|
-
*/
|
|
123
|
-
onClick?: (event: MouseEvent, button: ContextMenuButton) => void;
|
|
124
|
-
}
|
|
87
|
+
export interface ContextMenuButtonOptions {
|
|
88
|
+
/**
|
|
89
|
+
* The label for the button.
|
|
90
|
+
*/
|
|
91
|
+
label?: string;
|
|
92
|
+
/**
|
|
93
|
+
* The icon for the button.
|
|
94
|
+
*/
|
|
95
|
+
icon?: GridIconName;
|
|
96
|
+
/**
|
|
97
|
+
* A class name key applied to the `<li>` wrapper of the button.
|
|
98
|
+
*/
|
|
99
|
+
classNameKey?: ClassNameKey;
|
|
100
|
+
/**
|
|
101
|
+
* The icon for the active state of the button.
|
|
102
|
+
*/
|
|
103
|
+
activeIcon?: GridIconName;
|
|
104
|
+
/**
|
|
105
|
+
* The icon for the highlighted state of the button.
|
|
106
|
+
*/
|
|
107
|
+
highlightedIcon?: GridIconName;
|
|
108
|
+
/**
|
|
109
|
+
* The tooltip string for the button.
|
|
110
|
+
*/
|
|
111
|
+
tooltip?: string;
|
|
112
|
+
/**
|
|
113
|
+
* If the chevron icon should be rendered.
|
|
114
|
+
*/
|
|
115
|
+
chevron?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* The click handler for the button.
|
|
118
|
+
*/
|
|
119
|
+
onClick?: (event: MouseEvent, button: ContextMenuButton) => void;
|
|
125
120
|
}
|
|
126
121
|
export default ContextMenuButton;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* */
|
|
15
15
|
'use strict';
|
|
16
|
-
import
|
|
16
|
+
import { createGridIcon } from './SvgIcons.js';
|
|
17
17
|
import Globals from '../Globals.js';
|
|
18
18
|
import GridUtils from '../GridUtils.js';
|
|
19
19
|
const { makeHTMLElement } = GridUtils;
|
|
@@ -22,7 +22,7 @@ const { makeHTMLElement } = GridUtils;
|
|
|
22
22
|
* Class
|
|
23
23
|
*
|
|
24
24
|
* */
|
|
25
|
-
class ContextMenuButton {
|
|
25
|
+
export class ContextMenuButton {
|
|
26
26
|
/* *
|
|
27
27
|
*
|
|
28
28
|
* Constructor
|
|
@@ -80,7 +80,7 @@ class ContextMenuButton {
|
|
|
80
80
|
buttonEl.setAttribute('tabindex', '-1');
|
|
81
81
|
this.refreshState();
|
|
82
82
|
if (cfg.chevron) {
|
|
83
|
-
chevronEl.appendChild(
|
|
83
|
+
chevronEl.appendChild(createGridIcon('chevronRight'));
|
|
84
84
|
}
|
|
85
85
|
if (cfg.icon) {
|
|
86
86
|
this.setIcon(cfg.icon);
|
|
@@ -111,7 +111,7 @@ class ContextMenuButton {
|
|
|
111
111
|
if (!icon) {
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
this.icon =
|
|
114
|
+
this.icon = createGridIcon(icon);
|
|
115
115
|
this.iconWrapper?.appendChild(this.icon);
|
|
116
116
|
}
|
|
117
117
|
setActive(active) {
|
|
@@ -3,7 +3,7 @@ import type Button from './Button';
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstract base class for for Grid popups.
|
|
5
5
|
*/
|
|
6
|
-
declare abstract class Popup {
|
|
6
|
+
export declare abstract class Popup {
|
|
7
7
|
/**
|
|
8
8
|
* The popup container element.
|
|
9
9
|
*/
|
|
@@ -48,7 +48,7 @@ declare abstract class Popup {
|
|
|
48
48
|
* @param options
|
|
49
49
|
* Popup options.
|
|
50
50
|
*/
|
|
51
|
-
constructor(grid: Grid, button?: Button, options?:
|
|
51
|
+
constructor(grid: Grid, button?: Button, options?: PopupOptions);
|
|
52
52
|
/**
|
|
53
53
|
* Renders the popup content.
|
|
54
54
|
*
|
|
@@ -124,26 +124,24 @@ declare abstract class Popup {
|
|
|
124
124
|
*/
|
|
125
125
|
private removeEventListeners;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
export interface PopupOptions {
|
|
128
|
+
/**
|
|
129
|
+
* Whether to position the popup next to the anchor element (`true`), or
|
|
130
|
+
* directly below it (`false`). Defaults to `false`.
|
|
131
|
+
*/
|
|
132
|
+
nextToAnchor?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* The header of the popup.
|
|
135
|
+
*/
|
|
136
|
+
header?: {
|
|
129
137
|
/**
|
|
130
|
-
*
|
|
131
|
-
* directly below it (`false`). Defaults to `false`.
|
|
138
|
+
* The prefix of the header label, placed before the label.
|
|
132
139
|
*/
|
|
133
|
-
|
|
140
|
+
category?: string;
|
|
134
141
|
/**
|
|
135
|
-
* The
|
|
142
|
+
* The label of the header.
|
|
136
143
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
* The prefix of the header label, placed before the label.
|
|
140
|
-
*/
|
|
141
|
-
category?: string;
|
|
142
|
-
/**
|
|
143
|
-
* The label of the header.
|
|
144
|
-
*/
|
|
145
|
-
label: string;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
144
|
+
label: string;
|
|
145
|
+
};
|
|
148
146
|
}
|
|
149
147
|
export default Popup;
|
|
@@ -26,7 +26,7 @@ const { fireEvent } = U;
|
|
|
26
26
|
/**
|
|
27
27
|
* Abstract base class for for Grid popups.
|
|
28
28
|
*/
|
|
29
|
-
class Popup {
|
|
29
|
+
export class Popup {
|
|
30
30
|
/* *
|
|
31
31
|
*
|
|
32
32
|
* Constructor
|
|
@@ -96,6 +96,7 @@ class Popup {
|
|
|
96
96
|
if (!this.container) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
+
fireEvent(this, 'beforeHide');
|
|
99
100
|
this.grid.popups.delete(this);
|
|
100
101
|
this.isVisible = false;
|
|
101
102
|
// Remove event listeners
|
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Icons are designed for a 24x24 viewBox and use stroke-based rendering.
|
|
2
|
+
* The name of the icon from SvgIcons registry
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'stroke-width'?: number;
|
|
25
|
-
'stroke-linecap'?: string;
|
|
26
|
-
'stroke-linejoin'?: string;
|
|
27
|
-
opacity?: number;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The definition of an SVG for a Grid Svg icon.
|
|
31
|
-
*/
|
|
32
|
-
interface SVGDefinition {
|
|
33
|
-
width?: number;
|
|
34
|
-
height?: number;
|
|
35
|
-
viewBox?: string;
|
|
36
|
-
fill?: string;
|
|
37
|
-
children?: PathDefinition[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Creates an SVG icon element from the SvgIcons registry.
|
|
41
|
-
*
|
|
42
|
-
* @param name
|
|
43
|
-
* The name of the icon from SvgIcons registry
|
|
44
|
-
*
|
|
45
|
-
* @param className
|
|
46
|
-
* CSS class name for the SVG element (default: 'hcg-icon')
|
|
47
|
-
*
|
|
48
|
-
* @returns
|
|
49
|
-
* SVG element with the specified icon
|
|
50
|
-
*/
|
|
51
|
-
function createGridIcon(name: GridIconName, className?: string): SVGElement;
|
|
4
|
+
export type GridIconName = ('filter' | 'menu' | 'chevronRight' | 'checkmark' | 'upDownArrows' | 'sortAsc' | 'sortDesc');
|
|
5
|
+
/**
|
|
6
|
+
* The registry of all Grid Svg icons with their SVG path data.
|
|
7
|
+
*/
|
|
8
|
+
export declare const icons: Record<GridIconName, SVGDefinition>;
|
|
9
|
+
/**
|
|
10
|
+
* The default path definitions for the Grid Svg icons.
|
|
11
|
+
*/
|
|
12
|
+
export declare const pathDefaults: Partial<PathDefinition>;
|
|
13
|
+
/**
|
|
14
|
+
* The definition of a path for a Grid Svg icon.
|
|
15
|
+
*/
|
|
16
|
+
export interface PathDefinition {
|
|
17
|
+
d: string;
|
|
18
|
+
stroke?: string;
|
|
19
|
+
'stroke-width'?: number;
|
|
20
|
+
'stroke-linecap'?: string;
|
|
21
|
+
'stroke-linejoin'?: string;
|
|
22
|
+
opacity?: number;
|
|
52
23
|
}
|
|
53
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The definition of an SVG for a Grid Svg icon.
|
|
26
|
+
*/
|
|
27
|
+
export interface SVGDefinition {
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
viewBox?: string;
|
|
31
|
+
fill?: string;
|
|
32
|
+
children?: PathDefinition[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates an SVG icon element from the SvgIcons registry.
|
|
36
|
+
*
|
|
37
|
+
* @param name
|
|
38
|
+
* The name of the icon from SvgIcons registry
|
|
39
|
+
*
|
|
40
|
+
* @param className
|
|
41
|
+
* CSS class name for the SVG element (default: 'hcg-icon')
|
|
42
|
+
*
|
|
43
|
+
* @returns
|
|
44
|
+
* SVG element with the specified icon
|
|
45
|
+
*/
|
|
46
|
+
export declare function createGridIcon(name: GridIconName, className?: string): SVGElement;
|
|
47
|
+
declare const _default: {
|
|
48
|
+
readonly createGridIcon: typeof createGridIcon;
|
|
49
|
+
readonly icons: Record<GridIconName, SVGDefinition>;
|
|
50
|
+
readonly pathDefaults: Partial<PathDefinition>;
|
|
51
|
+
};
|
|
52
|
+
export default _default;
|