@highcharts/grid-pro 2.0.1 → 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 +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 +13 -4
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +0 -29
|
@@ -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;
|
|
@@ -21,138 +21,129 @@
|
|
|
21
21
|
*
|
|
22
22
|
* */
|
|
23
23
|
import Globals from '../Globals.js';
|
|
24
|
+
/**
|
|
25
|
+
* The registry of all Grid Svg icons with their SVG path data.
|
|
26
|
+
*/
|
|
27
|
+
export const icons = {
|
|
28
|
+
filter: {
|
|
29
|
+
width: 16,
|
|
30
|
+
height: 14,
|
|
31
|
+
children: [{
|
|
32
|
+
d: 'M2.2571 2.77791C1.75287 2.21437 1.50076 1.93259 1.49125 1.69312C1.48299 1.48509 1.57238 1.28515 1.73292 1.15259C1.91773 1 2.29583 1 3.05202 1H12.9473C13.7035 1 14.0816 1 14.2664 1.15259C14.427 1.28515 14.5163 1.48509 14.5081 1.69312C14.4986 1.93259 14.2465 2.21437 13.7422 2.77791L9.93808 7.02962C9.83756 7.14196 9.78731 7.19813 9.75147 7.26205C9.71969 7.31875 9.69637 7.37978 9.68225 7.44323C9.66633 7.51476 9.66633 7.59013 9.66633 7.74087V11.3056C9.66633 11.436 9.66633 11.5011 9.64531 11.5575C9.62673 11.6073 9.59651 11.6519 9.55717 11.6877C9.51265 11.7281 9.45213 11.7524 9.33108 11.8008L7.06441 12.7074C6.81938 12.8054 6.69687 12.8545 6.59852 12.834C6.51251 12.8161 6.43704 12.765 6.3885 12.6918C6.333 12.6081 6.333 12.4762 6.333 12.2122V7.74087C6.333 7.59013 6.333 7.51476 6.31708 7.44323C6.30296 7.37978 6.27964 7.31875 6.24786 7.26205C6.21203 7.19813 6.16177 7.14196 6.06126 7.02962L2.2571 2.77791Z'
|
|
33
|
+
}]
|
|
34
|
+
},
|
|
35
|
+
menu: {
|
|
36
|
+
width: 4,
|
|
37
|
+
height: 12,
|
|
38
|
+
children: [{
|
|
39
|
+
d: 'M2.00016 6.66675C2.36835 6.66675 2.66683 6.36827 2.66683 6.00008C2.66683 5.63189 2.36835 5.33341 2.00016 5.33341C1.63197 5.33341 1.3335 5.63189 1.3335 6.00008C1.3335 6.36827 1.63197 6.66675 2.00016 6.66675Z'
|
|
40
|
+
}, {
|
|
41
|
+
d: 'M2.00016 2.00008C2.36835 2.00008 2.66683 1.7016 2.66683 1.33341C2.66683 0.965225 2.36835 0.666748 2.00016 0.666748C1.63197 0.666748 1.3335 0.965225 1.3335 1.33341C1.3335 1.7016 1.63197 2.00008 2.00016 2.00008Z'
|
|
42
|
+
}, {
|
|
43
|
+
d: 'M2.00016 11.3334C2.36835 11.3334 2.66683 11.0349 2.66683 10.6667C2.66683 10.2986 2.36835 10.0001 2.00016 10.0001C1.63197 10.0001 1.3335 10.2986 1.3335 10.6667C1.3335 11.0349 1.63197 11.3334 2.00016 11.3334Z'
|
|
44
|
+
}]
|
|
45
|
+
},
|
|
46
|
+
chevronRight: {
|
|
47
|
+
width: 6,
|
|
48
|
+
height: 10,
|
|
49
|
+
children: [{
|
|
50
|
+
d: 'M1 9L5 5L1 1',
|
|
51
|
+
'stroke-width': 1.34
|
|
52
|
+
}]
|
|
53
|
+
},
|
|
54
|
+
checkmark: {
|
|
55
|
+
width: 12,
|
|
56
|
+
height: 9,
|
|
57
|
+
children: [{
|
|
58
|
+
d: 'M11.3332 1L3.99984 8.33333L0.666504 5'
|
|
59
|
+
}]
|
|
60
|
+
},
|
|
61
|
+
upDownArrows: {
|
|
62
|
+
width: 14,
|
|
63
|
+
height: 12,
|
|
64
|
+
children: [{
|
|
65
|
+
d: 'M3.66667 0.666748V11.3334M3.66667 11.3334L1 8.66675M3.66667 11.3334L6.33333 8.66675M10.3333 11.3334V0.666748M10.3333 0.666748L7.66667 3.33341M10.3333 0.666748L13 3.33341'
|
|
66
|
+
}]
|
|
67
|
+
},
|
|
68
|
+
sortAsc: {
|
|
69
|
+
width: 14,
|
|
70
|
+
height: 12,
|
|
71
|
+
children: [{
|
|
72
|
+
d: 'M3.66667 0.666748V11.3334M3.66667 11.3334L1 8.66675M3.66667 11.3334L6.33333 8.66675',
|
|
73
|
+
opacity: 0.2
|
|
74
|
+
}, {
|
|
75
|
+
d: 'M 10.3333 11.3334 V 0.6667 M 10.3333 0.6667 L 7.6667 3.3334 M 10.3333 0.6667 L 13 3.3334'
|
|
76
|
+
}]
|
|
77
|
+
},
|
|
78
|
+
sortDesc: {
|
|
79
|
+
width: 14,
|
|
80
|
+
height: 12,
|
|
81
|
+
children: [{
|
|
82
|
+
d: 'M3.66667 0.666748V11.3334M3.66667 11.3334L1 8.66675M3.66667 11.3334L6.33333 8.66675'
|
|
83
|
+
}, {
|
|
84
|
+
d: 'M 10.3333 11.3334 V 0.6667 M 10.3333 0.6667 L 7.6667 3.3334 M 10.3333 0.6667 L 13 3.3334',
|
|
85
|
+
opacity: 0.2
|
|
86
|
+
}]
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* The default path definitions for the Grid Svg icons.
|
|
91
|
+
*/
|
|
92
|
+
export const pathDefaults = {
|
|
93
|
+
stroke: 'currentColor',
|
|
94
|
+
'stroke-width': 1.33,
|
|
95
|
+
'stroke-linecap': 'round',
|
|
96
|
+
'stroke-linejoin': 'round'
|
|
97
|
+
};
|
|
24
98
|
/* *
|
|
99
|
+
*
|
|
100
|
+
* Functions
|
|
101
|
+
*
|
|
102
|
+
* */
|
|
103
|
+
/**
|
|
104
|
+
* Creates an SVG icon element from the SvgIcons registry.
|
|
25
105
|
*
|
|
26
|
-
*
|
|
106
|
+
* @param name
|
|
107
|
+
* The name of the icon from SvgIcons registry
|
|
27
108
|
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
109
|
+
* @param className
|
|
110
|
+
* CSS class name for the SVG element (default: 'hcg-icon')
|
|
111
|
+
*
|
|
112
|
+
* @returns
|
|
113
|
+
* SVG element with the specified icon
|
|
32
114
|
*/
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, {
|
|
52
|
-
d: 'M2.00016 2.00008C2.36835 2.00008 2.66683 1.7016 2.66683 1.33341C2.66683 0.965225 2.36835 0.666748 2.00016 0.666748C1.63197 0.666748 1.3335 0.965225 1.3335 1.33341C1.3335 1.7016 1.63197 2.00008 2.00016 2.00008Z'
|
|
53
|
-
}, {
|
|
54
|
-
d: 'M2.00016 11.3334C2.36835 11.3334 2.66683 11.0349 2.66683 10.6667C2.66683 10.2986 2.36835 10.0001 2.00016 10.0001C1.63197 10.0001 1.3335 10.2986 1.3335 10.6667C1.3335 11.0349 1.63197 11.3334 2.00016 11.3334Z'
|
|
55
|
-
}]
|
|
56
|
-
},
|
|
57
|
-
chevronRight: {
|
|
58
|
-
width: 6,
|
|
59
|
-
height: 10,
|
|
60
|
-
children: [{
|
|
61
|
-
d: 'M1 9L5 5L1 1',
|
|
62
|
-
'stroke-width': 1.34
|
|
63
|
-
}]
|
|
64
|
-
},
|
|
65
|
-
checkmark: {
|
|
66
|
-
width: 12,
|
|
67
|
-
height: 9,
|
|
68
|
-
children: [{
|
|
69
|
-
d: 'M11.3332 1L3.99984 8.33333L0.666504 5'
|
|
70
|
-
}]
|
|
71
|
-
},
|
|
72
|
-
upDownArrows: {
|
|
73
|
-
width: 14,
|
|
74
|
-
height: 12,
|
|
75
|
-
children: [{
|
|
76
|
-
d: 'M3.66667 0.666748V11.3334M3.66667 11.3334L1 8.66675M3.66667 11.3334L6.33333 8.66675M10.3333 11.3334V0.666748M10.3333 0.666748L7.66667 3.33341M10.3333 0.666748L13 3.33341'
|
|
77
|
-
}]
|
|
78
|
-
},
|
|
79
|
-
sortAsc: {
|
|
80
|
-
width: 14,
|
|
81
|
-
height: 12,
|
|
82
|
-
children: [{
|
|
83
|
-
d: 'M3.66667 0.666748V11.3334M3.66667 11.3334L1 8.66675M3.66667 11.3334L6.33333 8.66675',
|
|
84
|
-
opacity: 0.2
|
|
85
|
-
}, {
|
|
86
|
-
d: 'M 10.3333 11.3334 V 0.6667 M 10.3333 0.6667 L 7.6667 3.3334 M 10.3333 0.6667 L 13 3.3334'
|
|
87
|
-
}]
|
|
88
|
-
},
|
|
89
|
-
sortDesc: {
|
|
90
|
-
width: 14,
|
|
91
|
-
height: 12,
|
|
92
|
-
children: [{
|
|
93
|
-
d: 'M3.66667 0.666748V11.3334M3.66667 11.3334L1 8.66675M3.66667 11.3334L6.33333 8.66675'
|
|
94
|
-
}, {
|
|
95
|
-
d: 'M 10.3333 11.3334 V 0.6667 M 10.3333 0.6667 L 7.6667 3.3334 M 10.3333 0.6667 L 13 3.3334',
|
|
96
|
-
opacity: 0.2
|
|
97
|
-
}]
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* The default path definitions for the Grid Svg icons.
|
|
102
|
-
*/
|
|
103
|
-
SvgIcons.pathDefaults = {
|
|
104
|
-
stroke: 'currentColor',
|
|
105
|
-
'stroke-width': 1.33,
|
|
106
|
-
'stroke-linecap': 'round',
|
|
107
|
-
'stroke-linejoin': 'round'
|
|
108
|
-
};
|
|
109
|
-
/* *
|
|
110
|
-
*
|
|
111
|
-
* Functions
|
|
112
|
-
*
|
|
113
|
-
* */
|
|
114
|
-
/**
|
|
115
|
-
* Creates an SVG icon element from the SvgIcons registry.
|
|
116
|
-
*
|
|
117
|
-
* @param name
|
|
118
|
-
* The name of the icon from SvgIcons registry
|
|
119
|
-
*
|
|
120
|
-
* @param className
|
|
121
|
-
* CSS class name for the SVG element (default: 'hcg-icon')
|
|
122
|
-
*
|
|
123
|
-
* @returns
|
|
124
|
-
* SVG element with the specified icon
|
|
125
|
-
*/
|
|
126
|
-
function createGridIcon(name, className = Globals.getClassName('icon')) {
|
|
127
|
-
const createElement = (type) => document.createElementNS('http://www.w3.org/2000/svg', type);
|
|
128
|
-
const { width = 16, height = 16, viewBox, fill, children } = SvgIcons.icons[name];
|
|
129
|
-
const svg = createElement('svg');
|
|
130
|
-
svg.setAttribute('width', width.toString());
|
|
131
|
-
svg.setAttribute('height', height.toString());
|
|
132
|
-
svg.setAttribute('viewBox', viewBox ?? `0 0 ${width} ${height}`);
|
|
133
|
-
svg.setAttribute('fill', fill ?? 'none');
|
|
134
|
-
for (const childDefinition of children ?? []) {
|
|
135
|
-
const path = createElement('path');
|
|
136
|
-
const attrKeys = new Set([
|
|
137
|
-
...Object.keys(childDefinition),
|
|
138
|
-
...Object.keys(SvgIcons.pathDefaults)
|
|
139
|
-
]);
|
|
140
|
-
for (const attr of attrKeys) {
|
|
141
|
-
const value = childDefinition[attr] ?? SvgIcons.pathDefaults[attr];
|
|
142
|
-
if (value !== void 0) {
|
|
143
|
-
path.setAttribute(attr, value.toString());
|
|
144
|
-
}
|
|
115
|
+
export function createGridIcon(name, className = Globals.getClassName('icon')) {
|
|
116
|
+
const createElement = (type) => document.createElementNS('http://www.w3.org/2000/svg', type);
|
|
117
|
+
const { width = 16, height = 16, viewBox, fill, children } = icons[name];
|
|
118
|
+
const svg = createElement('svg');
|
|
119
|
+
svg.setAttribute('width', width.toString());
|
|
120
|
+
svg.setAttribute('height', height.toString());
|
|
121
|
+
svg.setAttribute('viewBox', viewBox ?? `0 0 ${width} ${height}`);
|
|
122
|
+
svg.setAttribute('fill', fill ?? 'none');
|
|
123
|
+
for (const childDefinition of children ?? []) {
|
|
124
|
+
const path = createElement('path');
|
|
125
|
+
const attrKeys = new Set([
|
|
126
|
+
...Object.keys(childDefinition),
|
|
127
|
+
...Object.keys(pathDefaults)
|
|
128
|
+
]);
|
|
129
|
+
for (const attr of attrKeys) {
|
|
130
|
+
const value = childDefinition[attr] ?? pathDefaults[attr];
|
|
131
|
+
if (value !== void 0) {
|
|
132
|
+
path.setAttribute(attr, value.toString());
|
|
145
133
|
}
|
|
146
|
-
svg.appendChild(path);
|
|
147
134
|
}
|
|
148
|
-
svg.
|
|
149
|
-
return svg;
|
|
135
|
+
svg.appendChild(path);
|
|
150
136
|
}
|
|
151
|
-
|
|
152
|
-
|
|
137
|
+
svg.classList.add(className);
|
|
138
|
+
return svg;
|
|
139
|
+
}
|
|
153
140
|
/* *
|
|
154
141
|
*
|
|
155
142
|
* Default Export
|
|
156
143
|
*
|
|
157
144
|
* */
|
|
158
|
-
export default
|
|
145
|
+
export default {
|
|
146
|
+
createGridIcon,
|
|
147
|
+
icons,
|
|
148
|
+
pathDefaults
|
|
149
|
+
};
|