@highcharts/grid-pro 2.2.0 → 2.3.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/LICENSE.txt +6 -0
- package/README.md +15 -9
- package/css/grid-pro.css +1262 -1122
- package/css/modules/grid-base-variables.css +131 -0
- package/css/modules/grid-button-variables.css +140 -0
- package/css/modules/grid-caption-variables.css +11 -0
- package/css/modules/grid-description-variables.css +11 -0
- package/css/modules/grid-input-variables.css +114 -0
- package/css/modules/grid-link-variables.css +18 -0
- package/css/modules/grid-menu-variables.css +50 -0
- package/css/modules/grid-pagination-variables.css +12 -0
- package/css/modules/grid-popup-variables.css +24 -0
- package/css/modules/grid-pro.css +234 -0
- package/css/modules/grid-table-variables.css +385 -0
- package/css/modules/grid-theme-default.css +55 -0
- package/es-modules/Accessibility/A11yI18n.js +1 -2
- package/es-modules/Accessibility/Accessibility.js +1 -2
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +2 -2
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +5 -6
- package/es-modules/Accessibility/Components/LegendComponent.js +1 -2
- package/es-modules/Accessibility/Components/MenuComponent.js +1 -2
- package/es-modules/Accessibility/Components/NavigatorComponent.js +3 -4
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +1 -2
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +1 -2
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +3 -4
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +3 -4
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +1 -2
- package/es-modules/Accessibility/Components/ZoomComponent.js +1 -2
- package/es-modules/Accessibility/FocusBorder.js +1 -2
- package/es-modules/Accessibility/KeyboardNavigation.js +1 -2
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +1 -2
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +11 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +7 -2
- package/es-modules/Accessibility/Options/LangDefaults.js +9 -0
- package/es-modules/Accessibility/ProxyElement.js +2 -5
- package/es-modules/Accessibility/ProxyProvider.js +1 -2
- package/es-modules/Accessibility/Utils/Announcer.js +2 -3
- package/es-modules/Accessibility/Utils/ChartUtilities.js +1 -2
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +2 -2
- package/es-modules/Accessibility/Utils/EventProvider.js +6 -2
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +1 -2
- package/es-modules/Core/Animation/AnimationUtilities.js +1 -2
- package/es-modules/Core/Animation/Fx.js +1 -2
- package/es-modules/Core/Callback.d.ts +9 -2
- package/es-modules/Core/Chart/Chart.js +48 -41
- package/es-modules/Core/Chart/Chart3D.js +1 -2
- package/es-modules/Core/Chart/ChartDefaults.js +11 -0
- package/es-modules/Core/Chart/ChartOptions.d.ts +8 -0
- package/es-modules/Core/Chart/GanttChart.js +1 -2
- package/es-modules/Core/Chart/MapChart.js +1 -2
- package/es-modules/Core/Chart/StockChart.js +2 -3
- package/es-modules/Core/Color/Color.js +1 -2
- package/es-modules/Core/Defaults.js +36 -9
- package/es-modules/Core/Delaunay.d.ts +52 -0
- package/es-modules/Core/Delaunay.js +310 -0
- package/es-modules/Core/Foundation.js +1 -2
- package/es-modules/Core/Geometry/CircleUtilities.js +1 -2
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +1 -2
- package/es-modules/Core/MSPointer.js +1 -2
- package/es-modules/Core/Math3D.js +1 -2
- package/es-modules/Core/Options.d.ts +6 -2
- package/es-modules/Core/Pointer.js +23 -4
- package/es-modules/Core/PointerEvent.d.ts +2 -0
- package/es-modules/Core/Renderer/HTML/AST.js +2 -2
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -2
- package/es-modules/Core/Renderer/RendererUtilities.js +34 -19
- package/es-modules/Core/Responsive.d.ts +4 -2
- package/es-modules/Core/Responsive.js +10 -4
- package/es-modules/Core/Templating.d.ts +1 -1
- package/es-modules/Core/Templating.js +3 -4
- package/es-modules/Core/Time.d.ts +8 -0
- package/es-modules/Core/Time.js +2 -2
- package/es-modules/Core/Tooltip.d.ts +4 -8
- package/es-modules/Core/Tooltip.js +100 -81
- package/es-modules/Core/TooltipOptions.d.ts +44 -1
- package/es-modules/Core/Utilities.d.ts +25 -665
- package/es-modules/Core/Utilities.js +17 -1398
- package/es-modules/Data/ColumnUtils.d.ts +83 -80
- package/es-modules/Data/ColumnUtils.js +103 -113
- package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/CSVConnector.js +3 -4
- package/es-modules/Data/Connectors/DataConnector.d.ts +52 -54
- package/es-modules/Data/Connectors/DataConnector.js +33 -52
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +73 -88
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +4 -2
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
- package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -4
- package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/JSONConnector.js +3 -4
- package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
- package/es-modules/Data/Converters/CSVConverter.js +3 -4
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
- package/es-modules/Data/Converters/DataConverter.js +26 -53
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
- package/es-modules/Data/Converters/DataConverterUtils.js +169 -181
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +3 -3
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
- package/es-modules/Data/Converters/HTMLTableConverter.js +2 -3
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
- package/es-modules/Data/Converters/JSONConverter.js +6 -6
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +2 -2
- package/es-modules/Data/DataCursor.d.ts +65 -70
- package/es-modules/Data/DataCursor.js +119 -139
- package/es-modules/Data/DataEvent.d.ts +55 -57
- package/es-modules/Data/DataPool.d.ts +10 -17
- package/es-modules/Data/DataPool.js +20 -9
- package/es-modules/Data/DataTable.d.ts +111 -113
- package/es-modules/Data/DataTable.js +3 -3
- package/es-modules/Data/DataTableCore.d.ts +9 -9
- package/es-modules/Data/DataTableCore.js +2 -2
- package/es-modules/Data/Formula/FormulaParser.js +1 -2
- package/es-modules/Data/Formula/FormulaProcessor.js +1 -2
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
- package/es-modules/Data/Modifiers/ChainModifier.js +7 -8
- package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
- package/es-modules/Data/Modifiers/DataModifier.js +31 -53
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/FilterModifier.js +3 -4
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/InvertModifier.js +3 -4
- package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/RangeModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
- package/es-modules/Data/Modifiers/SortModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +3 -3
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +1 -1
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +5 -6
- package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
- package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
- package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
- package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
- package/es-modules/Grid/Core/Defaults.js +4 -2
- package/es-modules/Grid/Core/Globals.d.ts +20 -16
- package/es-modules/Grid/Core/Globals.js +10 -8
- package/es-modules/Grid/Core/Grid.d.ts +31 -22
- package/es-modules/Grid/Core/Grid.js +214 -136
- package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
- package/es-modules/Grid/Core/GridUtils.js +50 -3
- package/es-modules/Grid/Core/Options.d.ts +145 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +63 -23
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +1 -2
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
- package/es-modules/Grid/Core/Querying/PaginationController.js +3 -3
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
- package/es-modules/Grid/Core/Querying/QueryingController.js +2 -26
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +3 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +2 -2
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +17 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +58 -15
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +1 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +57 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +397 -118
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +27 -13
- package/es-modules/Grid/Core/Table/Body/TableCell.js +74 -25
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +7 -15
- package/es-modules/Grid/Core/Table/Body/TableRow.js +24 -19
- package/es-modules/Grid/Core/Table/Cell.d.ts +16 -3
- package/es-modules/Grid/Core/Table/Cell.js +36 -3
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +3 -8
- package/es-modules/Grid/Core/Table/Column.d.ts +10 -4
- package/es-modules/Grid/Core/Table/Column.js +23 -34
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +9 -8
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +4 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +7 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +2 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +0 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +4 -14
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +33 -13
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +4 -5
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +3 -3
- package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Row.js +2 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +38 -12
- package/es-modules/Grid/Core/Table/Table.js +184 -91
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +5 -3
- package/es-modules/Grid/Core/UI/Popup.js +7 -9
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
- package/es-modules/Grid/Core/UI/SvgIcons.js +206 -33
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
- package/es-modules/Grid/Core/UI/ToolbarButton.js +8 -26
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +2 -2
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +10 -10
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +34 -32
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +3 -4
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +1 -3
- package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
- package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +1 -2
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +1 -2
- package/es-modules/Grid/Pro/GridEvents.js +1 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +1 -2
- package/es-modules/Shared/BaseForm.js +1 -2
- package/es-modules/Shared/DownloadURL.js +1 -2
- package/es-modules/Shared/TimeBase.js +3 -3
- package/es-modules/Shared/Types.d.ts +7 -0
- package/es-modules/Shared/Utilities.d.ts +576 -0
- package/es-modules/Shared/Utilities.js +1368 -0
- package/es-modules/masters/grid-pro.src.d.ts +15 -11
- package/es-modules/masters/grid-pro.src.js +12 -5
- package/grid-pro.d.ts +15 -11
- package/grid-pro.js +3 -3
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +15 -11
- package/grid-pro.src.js +10408 -8009
- package/package.json +1 -1
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
- package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
import { CellRenderer } from '../CellRenderer.js';
|
|
17
17
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
18
18
|
import DateTimeInputContent from '../ContentTypes/DateTimeInputContent.js';
|
|
19
|
-
import
|
|
20
|
-
const { merge } = U;
|
|
19
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
21
20
|
/* *
|
|
22
21
|
*
|
|
23
22
|
* Class
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
import { CellRenderer } from '../CellRenderer.js';
|
|
17
17
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
18
18
|
import NumberInputContent from '../ContentTypes/NumberInputContent.js';
|
|
19
|
-
import
|
|
20
|
-
const { merge } = U;
|
|
19
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
21
20
|
/* *
|
|
22
21
|
*
|
|
23
22
|
* Class
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
import { CellRenderer } from '../CellRenderer.js';
|
|
18
18
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
19
19
|
import SelectContent from '../ContentTypes/SelectContent.js';
|
|
20
|
-
import
|
|
21
|
-
const { merge } = U;
|
|
20
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
22
21
|
/* *
|
|
23
22
|
*
|
|
24
23
|
* Class
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnyRecord } from '../../../../Shared/Types';
|
|
2
2
|
import type Column from '../../../Core/Table/Column';
|
|
3
3
|
import type TableCell from '../../../Core/Table/Body/TableCell';
|
|
4
|
-
import type
|
|
4
|
+
import type { CellType as DataTableCellType } from '../../../../Data/DataTable';
|
|
5
5
|
import type { EditModeRendererTypeName } from '../../CellEditing/CellEditingComposition';
|
|
6
6
|
import { CellRenderer, CellRendererOptions } from '../CellRenderer.js';
|
|
7
7
|
import SparklineContent from '../ContentTypes/SparklineContent.js';
|
|
@@ -33,7 +33,7 @@ declare class SparklineRenderer extends CellRenderer {
|
|
|
33
33
|
*/
|
|
34
34
|
export interface SparklineRendererOptions extends CellRendererOptions {
|
|
35
35
|
type: 'sparkline';
|
|
36
|
-
chartOptions?: (((this: TableCell, data:
|
|
36
|
+
chartOptions?: (((this: TableCell, data: DataTableCellType) => AnyRecord) | AnyRecord);
|
|
37
37
|
}
|
|
38
38
|
declare module '../CellRendererType' {
|
|
39
39
|
interface CellRendererTypeRegistry {
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
import { CellRenderer } from '../CellRenderer.js';
|
|
18
18
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
19
19
|
import SparklineContent from '../ContentTypes/SparklineContent.js';
|
|
20
|
-
import
|
|
21
|
-
const { merge } = U;
|
|
20
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
22
21
|
/* *
|
|
23
22
|
*
|
|
24
23
|
* Class
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
import { CellRenderer } from '../CellRenderer.js';
|
|
18
18
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
19
19
|
import TextInputContent from '../ContentTypes/TextInputContent.js';
|
|
20
|
-
import
|
|
21
|
-
const { merge } = U;
|
|
20
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
22
21
|
/* *
|
|
23
22
|
*
|
|
24
23
|
* Class
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
import { CellRenderer } from '../CellRenderer.js';
|
|
17
17
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
18
18
|
import TextContent from '../../../Core/Table/CellContent/TextContent.js';
|
|
19
|
-
import
|
|
20
|
-
const { merge } = U;
|
|
19
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
21
20
|
/* *
|
|
22
21
|
*
|
|
23
22
|
* Class
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
import { CellRenderer } from '../CellRenderer.js';
|
|
17
17
|
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
18
18
|
import TimeInputContent from '../ContentTypes/TimeInputContent.js';
|
|
19
|
-
import
|
|
20
|
-
const { merge } = U;
|
|
19
|
+
import { merge } from '../../../../Shared/Utilities.js';
|
|
21
20
|
/* *
|
|
22
21
|
*
|
|
23
22
|
* Class
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
import AST from '../../../Core/Renderer/HTML/AST.js';
|
|
17
17
|
import Globals from '../../Core/Globals.js';
|
|
18
18
|
import GridUtils from '../../Core/GridUtils.js';
|
|
19
|
-
import
|
|
19
|
+
import { defined } from '../../../Shared/Utilities.js';
|
|
20
20
|
const { makeDiv, setHTMLContent } = GridUtils;
|
|
21
|
-
const { defined } = U;
|
|
22
21
|
/* *
|
|
23
22
|
*
|
|
24
23
|
* Class
|
|
@@ -217,32 +216,6 @@ Validator.rulesRegistry = {
|
|
|
217
216
|
Number(rawValue) === 1 || Number(rawValue) === 0),
|
|
218
217
|
notification: 'Value has to be a boolean.'
|
|
219
218
|
},
|
|
220
|
-
ignoreCaseUnique: {
|
|
221
|
-
validate: function ({ rawValue }) {
|
|
222
|
-
const oldValue = String(this.value).toLowerCase();
|
|
223
|
-
const rowValueString = rawValue.toLowerCase();
|
|
224
|
-
if (oldValue === rowValueString) {
|
|
225
|
-
return true;
|
|
226
|
-
}
|
|
227
|
-
const columnData = this.column.data;
|
|
228
|
-
const isDuplicate = columnData?.some((value) => String(value).toLowerCase() ===
|
|
229
|
-
rowValueString);
|
|
230
|
-
return !isDuplicate;
|
|
231
|
-
},
|
|
232
|
-
notification: 'Value must be unique within this column (case-insensitive).'
|
|
233
|
-
},
|
|
234
|
-
unique: {
|
|
235
|
-
validate: function ({ rawValue }) {
|
|
236
|
-
const oldValue = this.value;
|
|
237
|
-
if (oldValue === rawValue) {
|
|
238
|
-
return true;
|
|
239
|
-
}
|
|
240
|
-
const columnData = this.column.data;
|
|
241
|
-
const isDuplicate = columnData?.some((value) => value === rawValue);
|
|
242
|
-
return !isDuplicate;
|
|
243
|
-
},
|
|
244
|
-
notification: 'Value must be unique within this column (case-sensitive).'
|
|
245
|
-
},
|
|
246
219
|
arrayNumber: {
|
|
247
220
|
validate: function ({ rawValue }) {
|
|
248
221
|
return rawValue
|
|
@@ -256,9 +229,8 @@ Validator.rulesRegistry = {
|
|
|
256
229
|
try {
|
|
257
230
|
JSON.parse(rawValue);
|
|
258
231
|
return true;
|
|
259
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
260
232
|
}
|
|
261
|
-
catch
|
|
233
|
+
catch {
|
|
262
234
|
return false;
|
|
263
235
|
}
|
|
264
236
|
},
|
|
@@ -271,8 +243,38 @@ Validator.rulesRegistry = {
|
|
|
271
243
|
return arrayNumberValidate({ rawValue }) ||
|
|
272
244
|
jsonValidate({ rawValue });
|
|
273
245
|
},
|
|
274
|
-
|
|
275
|
-
|
|
246
|
+
notification: 'Value should be a valid JSON or a list of numbers ' +
|
|
247
|
+
'separated by commas.'
|
|
248
|
+
},
|
|
249
|
+
ignoreCaseUnique: {
|
|
250
|
+
validate: function ({ rawValue }) {
|
|
251
|
+
const oldValue = String(this.value).toLowerCase();
|
|
252
|
+
const rowValueString = rawValue.toLowerCase();
|
|
253
|
+
if (oldValue === rowValueString) {
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
// Local dataset only
|
|
257
|
+
// TODO(enhancement): Implement this for remote dataset.
|
|
258
|
+
const columnData = this.column.data;
|
|
259
|
+
const isDuplicate = columnData?.some((value) => (String(value).toLowerCase() ===
|
|
260
|
+
rowValueString));
|
|
261
|
+
return !isDuplicate;
|
|
262
|
+
},
|
|
263
|
+
notification: 'Value must be unique within this column (case-insensitive).'
|
|
264
|
+
},
|
|
265
|
+
unique: {
|
|
266
|
+
validate: function ({ rawValue }) {
|
|
267
|
+
const oldValue = this.value;
|
|
268
|
+
if (oldValue === rawValue) {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
// Local dataset only
|
|
272
|
+
// TODO(enhancement): Implement this for remote dataset.
|
|
273
|
+
const columnData = this.column.data;
|
|
274
|
+
const isDuplicate = columnData?.some((value) => value === rawValue);
|
|
275
|
+
return !isDuplicate;
|
|
276
|
+
},
|
|
277
|
+
notification: 'Value must be unique within this column (case-sensitive).'
|
|
276
278
|
}
|
|
277
279
|
};
|
|
278
280
|
/**
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
'use strict';
|
|
16
16
|
import Validator from './Validator.js';
|
|
17
17
|
import Globals from '../../Core/Globals.js';
|
|
18
|
-
import
|
|
19
|
-
const { addEvent, pushUnique } = U;
|
|
18
|
+
import { addEvent, pushUnique } from '../../../Shared/Utilities.js';
|
|
20
19
|
/* *
|
|
21
20
|
*
|
|
22
21
|
* Composition
|
|
@@ -33,7 +32,7 @@ export function compose(TableClass) {
|
|
|
33
32
|
if (!pushUnique(Globals.composed, 'Validator')) {
|
|
34
33
|
return;
|
|
35
34
|
}
|
|
36
|
-
addEvent(TableClass, '
|
|
35
|
+
addEvent(TableClass, 'beforeInit', initValidatorComposition);
|
|
37
36
|
addEvent(TableClass, 'afterDestroy', destroy);
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
@@ -46,7 +45,7 @@ function initValidatorComposition() {
|
|
|
46
45
|
* Callback function called after table destroy.
|
|
47
46
|
*/
|
|
48
47
|
function destroy() {
|
|
49
|
-
this.validator
|
|
48
|
+
this.validator?.destroy();
|
|
50
49
|
}
|
|
51
50
|
/* *
|
|
52
51
|
*
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
'use strict';
|
|
17
17
|
import CreditsPro from './CreditsPro.js';
|
|
18
18
|
import Globals from '../../Core/Globals.js';
|
|
19
|
-
import U from '../../../Core/Utilities.js';
|
|
20
19
|
import { defaultOptions } from '../../Core/Defaults.js';
|
|
21
|
-
|
|
20
|
+
import { addEvent, merge, pushUnique } from '../../../Shared/Utilities.js';
|
|
22
21
|
/* *
|
|
23
22
|
*
|
|
24
23
|
* Composition
|
|
@@ -38,7 +37,6 @@ export function compose(GridClass) {
|
|
|
38
37
|
merge(true, defaultOptions, {
|
|
39
38
|
credits: CreditsPro.defaultOptions
|
|
40
39
|
});
|
|
41
|
-
// TODO: Change to `beforeLoad` after upgrading grid update.
|
|
42
40
|
addEvent(GridClass, 'afterRenderViewport', initCredits);
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { RemoteFetchCallbackResult } from './RemoteDataProvider';
|
|
2
|
+
import type QueryingController from '../../Core/Querying/QueryingController';
|
|
3
|
+
/**
|
|
4
|
+
* Builds a URL with query parameters for fetching data from the remote server.
|
|
5
|
+
*
|
|
6
|
+
* @param options
|
|
7
|
+
* The options for building the URL.
|
|
8
|
+
*
|
|
9
|
+
* @param state
|
|
10
|
+
* The query state containing the query, offset and limit.
|
|
11
|
+
*
|
|
12
|
+
* @returns
|
|
13
|
+
* The complete URL string with all query parameters.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildUrl(options: DataSourceOptions, state: QueryState): string;
|
|
16
|
+
/**
|
|
17
|
+
* Fetches data from the remote server using the data source options.
|
|
18
|
+
*
|
|
19
|
+
* @param options
|
|
20
|
+
* The options for fetching data from the remote server.
|
|
21
|
+
*
|
|
22
|
+
* @param state
|
|
23
|
+
* The query state containing the query, offset and limit.
|
|
24
|
+
*
|
|
25
|
+
* @returns
|
|
26
|
+
* The fetched data.
|
|
27
|
+
*/
|
|
28
|
+
export declare function dataSourceFetch(options: DataSourceOptions, state: QueryState): Promise<RemoteFetchCallbackResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Serialized configuration alternatively to `fetchCallback`.
|
|
31
|
+
*/
|
|
32
|
+
export interface DataSourceOptions {
|
|
33
|
+
/**
|
|
34
|
+
* The URL template to be used to fetch data from the remote server.
|
|
35
|
+
* Available template variables:
|
|
36
|
+
* - `page` - The current page number.
|
|
37
|
+
* - `pageSize` - The current page size.
|
|
38
|
+
* - `offset` - The current offset ((page - 1) * pageSize).
|
|
39
|
+
* - `limit` - Alias to `pageSize`.
|
|
40
|
+
* - `filter` - The filter conditions.
|
|
41
|
+
* - `sortBy` - The sort by conditions.
|
|
42
|
+
* - `sortOrder` - The sort order.
|
|
43
|
+
*
|
|
44
|
+
* Example: `https://api.example.com/data?page={page}&pageSize={pageSize}`
|
|
45
|
+
*
|
|
46
|
+
* This list can be extended by adding custom template variables to the
|
|
47
|
+
* `templateVariables` option.
|
|
48
|
+
*/
|
|
49
|
+
urlTemplate: string;
|
|
50
|
+
/**
|
|
51
|
+
* Template variables to be replaced in the urlTemplate.
|
|
52
|
+
*/
|
|
53
|
+
templateVariables?: Record<string, (state: QueryState) => string>;
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, empty query parameters are omitted from the URL.
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
omitEmpty?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Callback to parse the response from the remote server.
|
|
61
|
+
*/
|
|
62
|
+
parseResponse?: (res: Response) => Promise<RemoteFetchCallbackResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Timeout (ms) for the remote request. Set to 0 to disable.
|
|
65
|
+
* @default 30000
|
|
66
|
+
*/
|
|
67
|
+
fetchTimeout?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface QueryState {
|
|
70
|
+
query: QueryingController;
|
|
71
|
+
offset: number;
|
|
72
|
+
limit: number;
|
|
73
|
+
signal?: AbortSignal;
|
|
74
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/* *
|
|
2
|
+
*
|
|
3
|
+
* Remote Data Provider class
|
|
4
|
+
*
|
|
5
|
+
* (c) 2020-2025 Highsoft AS
|
|
6
|
+
*
|
|
7
|
+
* License: www.highcharts.com/license
|
|
8
|
+
*
|
|
9
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
10
|
+
*
|
|
11
|
+
* Authors:
|
|
12
|
+
* - Dawid Dragula
|
|
13
|
+
*
|
|
14
|
+
* */
|
|
15
|
+
'use strict';
|
|
16
|
+
import { defined } from '../../../Shared/Utilities.js';
|
|
17
|
+
import T from '../../../Core/Templating.js';
|
|
18
|
+
const { format } = T;
|
|
19
|
+
/* *
|
|
20
|
+
*
|
|
21
|
+
* Definitions
|
|
22
|
+
*
|
|
23
|
+
* */
|
|
24
|
+
/**
|
|
25
|
+
* Mapping from Grid filter operators to standard API filter conditions.
|
|
26
|
+
*/
|
|
27
|
+
const filterOperatorMap = {
|
|
28
|
+
'==': 'equals',
|
|
29
|
+
'===': 'equals',
|
|
30
|
+
'!=': 'doesNotEqual',
|
|
31
|
+
'!==': 'doesNotEqual',
|
|
32
|
+
'>': 'greaterThan',
|
|
33
|
+
'>=': 'greaterThanOrEqualTo',
|
|
34
|
+
'<': 'lessThan',
|
|
35
|
+
'<=': 'lessThanOrEqualTo',
|
|
36
|
+
contains: 'contains',
|
|
37
|
+
startsWith: 'beginsWith',
|
|
38
|
+
endsWith: 'endsWith',
|
|
39
|
+
empty: 'empty'
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Recursively extracts filter conditions from the Grid's FilterCondition
|
|
43
|
+
* structure into a flat array of API filter conditions.
|
|
44
|
+
*
|
|
45
|
+
* @param condition
|
|
46
|
+
* The filter condition from the Grid's filtering modifier.
|
|
47
|
+
*
|
|
48
|
+
* @param filterColumns
|
|
49
|
+
* The array to accumulate filter conditions into.
|
|
50
|
+
*
|
|
51
|
+
* @returns
|
|
52
|
+
* The accumulated filter conditions array.
|
|
53
|
+
*/
|
|
54
|
+
function extractFilterConditions(condition, filterColumns = []) {
|
|
55
|
+
if (!condition) {
|
|
56
|
+
return filterColumns;
|
|
57
|
+
}
|
|
58
|
+
if (condition.operator === 'and' || condition.operator === 'or') {
|
|
59
|
+
// Logical condition - extract from nested conditions
|
|
60
|
+
if (condition.conditions) {
|
|
61
|
+
for (const subCondition of condition.conditions) {
|
|
62
|
+
extractFilterConditions(subCondition, filterColumns);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else if (condition.columnId) {
|
|
67
|
+
// Single condition
|
|
68
|
+
const mappedOperator = filterOperatorMap[condition.operator] || condition.operator;
|
|
69
|
+
filterColumns.push({
|
|
70
|
+
id: condition.columnId,
|
|
71
|
+
condition: mappedOperator,
|
|
72
|
+
value: condition.value
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return filterColumns;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the active sortings from the query state.
|
|
79
|
+
*
|
|
80
|
+
* @param state
|
|
81
|
+
* The query state.
|
|
82
|
+
*
|
|
83
|
+
* @returns
|
|
84
|
+
* The active sortings.
|
|
85
|
+
*/
|
|
86
|
+
const getActiveSortings = (state) => {
|
|
87
|
+
const { currentSortings, currentSorting } = state.query.sorting;
|
|
88
|
+
return (currentSortings ?? (currentSorting ? [currentSorting] : [])).filter((sorting) => defined(sorting?.columnId) && defined(sorting.order));
|
|
89
|
+
};
|
|
90
|
+
const defaultTemplateVariables = {
|
|
91
|
+
page: (state) => (Math.floor(state.offset / (state.limit || 1)) + 1).toFixed(),
|
|
92
|
+
pageSize: (state) => state.limit.toFixed(),
|
|
93
|
+
offset: (state) => state.offset.toFixed(),
|
|
94
|
+
limit: (state) => state.limit.toFixed(),
|
|
95
|
+
format: () => 'js',
|
|
96
|
+
filter: (state) => {
|
|
97
|
+
const filterColumns = [];
|
|
98
|
+
const filterCondition = state.query.filtering.modifier?.options?.condition;
|
|
99
|
+
if (filterCondition) {
|
|
100
|
+
extractFilterConditions(filterCondition, filterColumns);
|
|
101
|
+
}
|
|
102
|
+
if (!filterColumns.length) {
|
|
103
|
+
return '';
|
|
104
|
+
}
|
|
105
|
+
return JSON.stringify({ columns: filterColumns });
|
|
106
|
+
},
|
|
107
|
+
sortBy: (state) => {
|
|
108
|
+
const sortings = getActiveSortings(state);
|
|
109
|
+
if (!sortings.length) {
|
|
110
|
+
return '';
|
|
111
|
+
}
|
|
112
|
+
return sortings.map((sorting) => sorting.columnId).join(',');
|
|
113
|
+
},
|
|
114
|
+
sortOrder: (state) => {
|
|
115
|
+
const sortings = getActiveSortings(state);
|
|
116
|
+
if (!sortings.length) {
|
|
117
|
+
return '';
|
|
118
|
+
}
|
|
119
|
+
const sortOrders = sortings.map((sorting) => sorting.order);
|
|
120
|
+
const uniqueOrders = Array.from(new Set(sortOrders));
|
|
121
|
+
return uniqueOrders.length === 1 ?
|
|
122
|
+
uniqueOrders[0] :
|
|
123
|
+
sortOrders.join(',');
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const defaultParseResponse = async (res) => {
|
|
127
|
+
if (!res.ok) {
|
|
128
|
+
let message = `DataSourceHelper: request failed with status ${res.status} ${res.statusText}`;
|
|
129
|
+
try {
|
|
130
|
+
const body = await res.text();
|
|
131
|
+
if (body) {
|
|
132
|
+
message += ` - ${body}`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
// Ignore response body parsing errors for error responses.
|
|
137
|
+
}
|
|
138
|
+
throw new Error(message);
|
|
139
|
+
}
|
|
140
|
+
const { data, meta } = await res.json();
|
|
141
|
+
return {
|
|
142
|
+
columns: data || {},
|
|
143
|
+
totalRowCount: meta?.totalRowCount || 0,
|
|
144
|
+
rowIds: meta?.rowIds
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Builds a URL with query parameters for fetching data from the remote server.
|
|
149
|
+
*
|
|
150
|
+
* @param options
|
|
151
|
+
* The options for building the URL.
|
|
152
|
+
*
|
|
153
|
+
* @param state
|
|
154
|
+
* The query state containing the query, offset and limit.
|
|
155
|
+
*
|
|
156
|
+
* @returns
|
|
157
|
+
* The complete URL string with all query parameters.
|
|
158
|
+
*/
|
|
159
|
+
export function buildUrl(options, state) {
|
|
160
|
+
const { urlTemplate, templateVariables, omitEmpty } = options;
|
|
161
|
+
const variables = {
|
|
162
|
+
...defaultTemplateVariables,
|
|
163
|
+
...templateVariables
|
|
164
|
+
};
|
|
165
|
+
const context = {};
|
|
166
|
+
// Populate context with template variables in form of getter functions
|
|
167
|
+
// so that only the variables that are actually used in the URL are
|
|
168
|
+
// evaluated.
|
|
169
|
+
Object.keys(variables).forEach((key) => {
|
|
170
|
+
const value = variables[key];
|
|
171
|
+
Object.defineProperty(context, key, {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: () => value(state)
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
const res = format(urlTemplate, context);
|
|
177
|
+
if (omitEmpty ?? true) {
|
|
178
|
+
return res.replace(/&([^=&]+)=([^&]*)/g, (_, key, value) => (value ? `&${key}=${value}` : ''));
|
|
179
|
+
}
|
|
180
|
+
return res;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Fetches data from the remote server using the data source options.
|
|
184
|
+
*
|
|
185
|
+
* @param options
|
|
186
|
+
* The options for fetching data from the remote server.
|
|
187
|
+
*
|
|
188
|
+
* @param state
|
|
189
|
+
* The query state containing the query, offset and limit.
|
|
190
|
+
*
|
|
191
|
+
* @returns
|
|
192
|
+
* The fetched data.
|
|
193
|
+
*/
|
|
194
|
+
export async function dataSourceFetch(options, state) {
|
|
195
|
+
const { parseResponse = defaultParseResponse, fetchTimeout = 30000 } = options;
|
|
196
|
+
try {
|
|
197
|
+
const url = buildUrl(options, state);
|
|
198
|
+
const controller = fetchTimeout > 0 ? new AbortController() : null;
|
|
199
|
+
const externalSignal = state.signal;
|
|
200
|
+
let timeoutId;
|
|
201
|
+
if (controller && externalSignal) {
|
|
202
|
+
if (externalSignal.aborted) {
|
|
203
|
+
controller.abort();
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
externalSignal.addEventListener('abort', () => {
|
|
207
|
+
controller.abort();
|
|
208
|
+
}, { once: true });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (controller) {
|
|
212
|
+
timeoutId = setTimeout(() => {
|
|
213
|
+
controller.abort();
|
|
214
|
+
}, fetchTimeout);
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
const signal = controller?.signal ?? externalSignal;
|
|
218
|
+
const res = signal ?
|
|
219
|
+
await fetch(url, { signal }) :
|
|
220
|
+
await fetch(url);
|
|
221
|
+
const data = await parseResponse(res);
|
|
222
|
+
return data;
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
if (timeoutId) {
|
|
226
|
+
clearTimeout(timeoutId);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
if (err instanceof DOMException && err.name === 'AbortError') {
|
|
232
|
+
return {
|
|
233
|
+
columns: {},
|
|
234
|
+
totalRowCount: 0,
|
|
235
|
+
rowIds: []
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
// eslint-disable-next-line no-console
|
|
239
|
+
console.error('Error fetching data from remote server.\n', err);
|
|
240
|
+
return {
|
|
241
|
+
columns: {},
|
|
242
|
+
totalRowCount: 0,
|
|
243
|
+
rowIds: []
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface QueryFingerprintInput {
|
|
2
|
+
sorting: {
|
|
3
|
+
modifier?: {
|
|
4
|
+
options?: unknown;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
filtering: {
|
|
8
|
+
modifier?: {
|
|
9
|
+
options?: unknown;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
pagination: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
currentPage: number;
|
|
15
|
+
currentPageSize: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates a deterministic fingerprint of the current query state.
|
|
20
|
+
*
|
|
21
|
+
* @param input
|
|
22
|
+
* Minimal query-like object (duck-typed) containing sorting, filtering and
|
|
23
|
+
* pagination state.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createQueryFingerprint(input: QueryFingerprintInput): string;
|
|
26
|
+
/**
|
|
27
|
+
* Serializes a filter condition into a deterministic string.
|
|
28
|
+
*
|
|
29
|
+
* @param condition
|
|
30
|
+
* Filter condition (serializable object, callback, or primitive).
|
|
31
|
+
*/
|
|
32
|
+
export declare function serializeFilterCondition(condition: unknown): string;
|
|
33
|
+
/**
|
|
34
|
+
* Serializes an arbitrary value into a deterministic string.
|
|
35
|
+
*
|
|
36
|
+
* @param value
|
|
37
|
+
* Value to serialize.
|
|
38
|
+
*/
|
|
39
|
+
export declare function serializeValue(value: unknown): string;
|
|
40
|
+
/**
|
|
41
|
+
* Small deterministic hash for strings (djb2-ish), returned as base36.
|
|
42
|
+
*
|
|
43
|
+
* @param str
|
|
44
|
+
* String to hash.
|
|
45
|
+
*/
|
|
46
|
+
export declare function hashString(str: string): string;
|