@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.
Files changed (166) hide show
  1. package/css/grid-pro.css +93 -90
  2. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +2 -0
  3. package/es-modules/Accessibility/Options/LangDefaults.js +6 -1
  4. package/es-modules/Accessibility/Utils/ChartUtilities.js +3 -3
  5. package/es-modules/Core/Chart/Chart.js +1 -1
  6. package/es-modules/Core/Color/ColorString.d.ts +25 -0
  7. package/es-modules/Core/Color/ColorType.d.ts +43 -0
  8. package/es-modules/Core/Color/GradientColor.d.ts +57 -0
  9. package/es-modules/Core/Globals.js +1 -1
  10. package/es-modules/Core/Renderer/AlignObject.d.ts +37 -0
  11. package/es-modules/Core/Renderer/BBoxObject.d.ts +40 -0
  12. package/es-modules/Core/Renderer/CSSObject.d.ts +130 -0
  13. package/es-modules/Core/Renderer/DOMElementType.d.ts +36 -0
  14. package/es-modules/Core/Renderer/DashStyleValue.d.ts +28 -0
  15. package/es-modules/Core/Renderer/FontMetricsObject.d.ts +38 -0
  16. package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +57 -0
  17. package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +19 -0
  18. package/es-modules/Core/Renderer/Position3DObject.d.ts +35 -0
  19. package/es-modules/Core/Renderer/PositionObject.d.ts +28 -0
  20. package/es-modules/Core/Renderer/RectangleObject.d.ts +35 -0
  21. package/es-modules/Core/Renderer/RendererType.d.ts +53 -0
  22. package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +43 -0
  23. package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +44 -0
  24. package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +147 -0
  25. package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +42 -0
  26. package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +42 -0
  27. package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +31 -0
  28. package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +97 -0
  29. package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +40 -0
  30. package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +31 -0
  31. package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +41 -0
  32. package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +50 -0
  33. package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +40 -0
  34. package/es-modules/Core/Renderer/SizeObject.d.ts +28 -0
  35. package/es-modules/Core/Templating.js +6 -7
  36. package/es-modules/Data/Connectors/DataConnector.js +3 -2
  37. package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +1 -1
  38. package/es-modules/Data/DataTable.d.ts +1 -1
  39. package/es-modules/Data/DataTable.js +3 -2
  40. package/es-modules/Data/DataTableCore.js +15 -6
  41. package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +13 -15
  42. package/es-modules/Grid/Core/Credits.d.ts +0 -2
  43. package/es-modules/Grid/Core/Defaults.d.ts +20 -17
  44. package/es-modules/Grid/Core/Defaults.js +116 -114
  45. package/es-modules/Grid/Core/Globals.d.ts +108 -32
  46. package/es-modules/Grid/Core/Globals.js +98 -111
  47. package/es-modules/Grid/Core/Grid.d.ts +51 -17
  48. package/es-modules/Grid/Core/Grid.js +369 -79
  49. package/es-modules/Grid/Core/GridUtils.d.ts +96 -89
  50. package/es-modules/Grid/Core/GridUtils.js +143 -155
  51. package/es-modules/Grid/Core/Options.d.ts +3 -7
  52. package/es-modules/Grid/Core/Pagination/Icons.d.ts +4 -4
  53. package/es-modules/Grid/Core/Pagination/Pagination.d.ts +32 -57
  54. package/es-modules/Grid/Core/Pagination/Pagination.js +206 -214
  55. package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +22 -15
  56. package/es-modules/Grid/Core/Querying/PaginationController.d.ts +32 -9
  57. package/es-modules/Grid/Core/Querying/PaginationController.js +58 -18
  58. package/es-modules/Grid/Core/Querying/SortingController.d.ts +7 -15
  59. package/es-modules/Grid/Core/Querying/SortingController.js +2 -3
  60. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +1 -1
  61. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +32 -4
  62. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +3 -3
  63. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +3 -5
  64. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +1 -5
  65. package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +14 -10
  66. package/es-modules/Grid/Core/Table/Body/TableCell.js +22 -25
  67. package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +0 -2
  68. package/es-modules/Grid/Core/Table/Cell.js +30 -0
  69. package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +2 -7
  70. package/es-modules/Grid/Core/Table/CellContent/TextContent.js +25 -14
  71. package/es-modules/Grid/Core/Table/Column.d.ts +7 -9
  72. package/es-modules/Grid/Core/Table/Column.js +23 -1
  73. package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +2 -2
  74. package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +30 -23
  75. package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +39 -39
  76. package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +1 -1
  77. package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +2 -2
  78. package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +6 -1
  79. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +10 -0
  80. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +2 -2
  81. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +26 -24
  82. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +37 -39
  83. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +1 -1
  84. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +1 -1
  85. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +1 -1
  86. package/es-modules/Grid/Core/Table/Header/HeaderCell.js +3 -4
  87. package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +0 -2
  88. package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +0 -2
  89. package/es-modules/Grid/Core/Table/Table.d.ts +11 -13
  90. package/es-modules/Grid/Core/Table/Table.js +9 -5
  91. package/es-modules/Grid/Core/UI/Button.d.ts +1 -1
  92. package/es-modules/Grid/Core/UI/ContextMenu.d.ts +1 -1
  93. package/es-modules/Grid/Core/UI/ContextMenu.js +1 -1
  94. package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +39 -44
  95. package/es-modules/Grid/Core/UI/ContextMenuButton.js +4 -4
  96. package/es-modules/Grid/Core/UI/Popup.d.ts +17 -19
  97. package/es-modules/Grid/Core/UI/Popup.js +2 -1
  98. package/es-modules/Grid/Core/UI/SvgIcons.d.ts +49 -50
  99. package/es-modules/Grid/Core/UI/SvgIcons.js +114 -123
  100. package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +46 -52
  101. package/es-modules/Grid/Core/UI/ToolbarButton.js +4 -3
  102. package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +6 -8
  103. package/es-modules/Grid/Pro/CellEditing/CellEditing.js +8 -11
  104. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +27 -1
  105. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +149 -149
  106. package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +18 -20
  107. package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +1 -1
  108. package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +19 -17
  109. package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +28 -34
  110. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +12 -1
  111. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +41 -46
  112. package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +2 -2
  113. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +2 -2
  114. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +2 -2
  115. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +4 -2
  116. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +2 -2
  117. package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +3 -1
  118. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -1
  119. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +19 -8
  120. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +17 -13
  121. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +3 -1
  122. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +2 -2
  123. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +18 -20
  124. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +3 -3
  125. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +10 -12
  126. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +3 -3
  127. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +17 -20
  128. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +10 -12
  129. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +3 -3
  130. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +20 -22
  131. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +3 -3
  132. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +40 -42
  133. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +3 -3
  134. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +16 -18
  135. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +14 -22
  136. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +22 -24
  137. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +3 -3
  138. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +10 -12
  139. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +3 -3
  140. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +10 -12
  141. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +3 -3
  142. package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +46 -51
  143. package/es-modules/Grid/Pro/ColumnTypes/Validator.js +62 -77
  144. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +16 -3
  145. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +26 -31
  146. package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +0 -2
  147. package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +12 -11
  148. package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +29 -31
  149. package/es-modules/Grid/Pro/Export/Exporting.d.ts +3 -3
  150. package/es-modules/Grid/Pro/Export/Exporting.js +35 -29
  151. package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +12 -11
  152. package/es-modules/Grid/Pro/Export/ExportingComposition.js +24 -26
  153. package/es-modules/Grid/Pro/GridEvents.d.ts +19 -1
  154. package/es-modules/Grid/Pro/GridEvents.js +6 -2
  155. package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +4 -11
  156. package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +44 -45
  157. package/es-modules/Grid/index.d.ts +1 -0
  158. package/es-modules/masters/grid-pro.src.d.ts +62 -37
  159. package/es-modules/masters/grid-pro.src.js +37 -39
  160. package/grid-pro.d.ts +122 -48
  161. package/grid-pro.js +3 -6
  162. package/grid-pro.js.map +1 -1
  163. package/grid-pro.src.d.ts +122 -48
  164. package/grid-pro.src.js +6650 -6277
  165. package/package.json +13 -4
  166. 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(): Table.ViewportStateMetadata;
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: Table.ViewportStateMetadata): void;
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
- declare namespace Table {
170
- /**
171
- * Represents the metadata of the viewport state. It is used to save the
172
- * state of the viewport and restore it when the data grid is re-rendered.
173
- */
174
- interface ViewportStateMetadata {
175
- scrollTop: number;
176
- scrollLeft: number;
177
- columnResizing: ColumnResizingMode;
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
- const paginationPageSize = grid.pagination?.currentPageSize;
169
- return paginationPageSize ?
170
- paginationPageSize >= threshold :
171
- rowCount >= threshold;
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?.clampCurrentPage();
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.
@@ -4,7 +4,7 @@ import type Popup from './Popup.js';
4
4
  * `Toolbar`.
5
5
  * @private
6
6
  */
7
- interface Button {
7
+ export interface Button {
8
8
  /**
9
9
  * Focuses the button.
10
10
  */
@@ -3,7 +3,7 @@ import ContextMenuButton from './ContextMenuButton.js';
3
3
  /**
4
4
  * The context menu.
5
5
  */
6
- declare abstract class ContextMenu extends Popup {
6
+ export declare abstract class ContextMenu extends Popup {
7
7
  /**
8
8
  * The array of buttons in the context menu.
9
9
  */
@@ -30,7 +30,7 @@ const { makeHTMLElement } = GridUtils;
30
30
  /**
31
31
  * The context menu.
32
32
  */
33
- class ContextMenu extends Popup {
33
+ export class ContextMenu extends Popup {
34
34
  constructor() {
35
35
  /* *
36
36
  *
@@ -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 SvgIcons from './SvgIcons.js';
5
- import Globals from '../Globals.js';
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: ContextMenuButton.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: ContextMenuButton.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?: SvgIcons.GridIconName): void;
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
- declare namespace ContextMenuButton {
88
- /**
89
- * Options for the context menu button.
90
- */
91
- interface Options {
92
- /**
93
- * The label for the button.
94
- */
95
- label?: string;
96
- /**
97
- * The icon for the button.
98
- */
99
- icon?: SvgIcons.GridIconName;
100
- /**
101
- * A class name key applied to the `<li>` wrapper of the button.
102
- */
103
- classNameKey?: Globals.ClassNameKey;
104
- /**
105
- * The icon for the active state of the button.
106
- */
107
- activeIcon?: SvgIcons.GridIconName;
108
- /**
109
- * The icon for the highlighted state of the button.
110
- */
111
- highlightedIcon?: SvgIcons.GridIconName;
112
- /**
113
- * The tooltip string for the button.
114
- */
115
- tooltip?: string;
116
- /**
117
- * If the chevron icon should be rendered.
118
- */
119
- chevron?: boolean;
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 SvgIcons from './SvgIcons.js';
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(SvgIcons.createGridIcon('chevronRight'));
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 = SvgIcons.createGridIcon(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?: Popup.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
- declare namespace Popup {
128
- interface Options {
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
- * Whether to position the popup next to the anchor element (`true`), or
131
- * directly below it (`false`). Defaults to `false`.
138
+ * The prefix of the header label, placed before the label.
132
139
  */
133
- nextToAnchor?: boolean;
140
+ category?: string;
134
141
  /**
135
- * The header of the popup.
142
+ * The label of the header.
136
143
  */
137
- header?: {
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
- * Registry of all Grid Svg icons with their SVG path data.
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
- declare namespace SvgIcons {
6
- /**
7
- * The name of the icon from SvgIcons registry
8
- */
9
- type GridIconName = ('filter' | 'menu' | 'chevronRight' | 'checkmark' | 'upDownArrows' | 'sortAsc' | 'sortDesc');
10
- /**
11
- * The registry of all Grid Svg icons with their SVG path data.
12
- */
13
- const icons: Record<GridIconName, SVGDefinition>;
14
- /**
15
- * The default path definitions for the Grid Svg icons.
16
- */
17
- const pathDefaults: Partial<PathDefinition>;
18
- /**
19
- * The definition of a path for a Grid Svg icon.
20
- */
21
- interface PathDefinition {
22
- d: string;
23
- stroke?: string;
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
- export default SvgIcons;
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;