@highcharts/grid-pro 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/grid-pro.css +69 -85
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +2 -0
- package/es-modules/Accessibility/Options/LangDefaults.js +6 -1
- package/es-modules/Accessibility/Utils/ChartUtilities.js +3 -3
- package/es-modules/Core/Color/ColorString.d.ts +25 -0
- package/es-modules/Core/Color/ColorType.d.ts +43 -0
- package/es-modules/Core/Color/GradientColor.d.ts +57 -0
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/Renderer/AlignObject.d.ts +37 -0
- package/es-modules/Core/Renderer/BBoxObject.d.ts +40 -0
- package/es-modules/Core/Renderer/CSSObject.d.ts +130 -0
- package/es-modules/Core/Renderer/DOMElementType.d.ts +36 -0
- package/es-modules/Core/Renderer/DashStyleValue.d.ts +28 -0
- package/es-modules/Core/Renderer/FontMetricsObject.d.ts +38 -0
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +57 -0
- package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +19 -0
- package/es-modules/Core/Renderer/Position3DObject.d.ts +35 -0
- package/es-modules/Core/Renderer/PositionObject.d.ts +28 -0
- package/es-modules/Core/Renderer/RectangleObject.d.ts +35 -0
- package/es-modules/Core/Renderer/RendererType.d.ts +53 -0
- package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +43 -0
- package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +44 -0
- package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +147 -0
- package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +42 -0
- package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +42 -0
- package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +31 -0
- package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +97 -0
- package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +40 -0
- package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +31 -0
- package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +41 -0
- package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +50 -0
- package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +40 -0
- package/es-modules/Core/Renderer/SizeObject.d.ts +28 -0
- package/es-modules/Core/Templating.js +6 -7
- package/es-modules/Data/Connectors/DataConnector.js +3 -2
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +1 -1
- package/es-modules/Data/DataTable.d.ts +1 -1
- package/es-modules/Data/DataTable.js +3 -2
- package/es-modules/Data/DataTableCore.js +15 -6
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +13 -15
- package/es-modules/Grid/Core/Credits.d.ts +0 -2
- package/es-modules/Grid/Core/Defaults.d.ts +20 -17
- package/es-modules/Grid/Core/Defaults.js +116 -114
- package/es-modules/Grid/Core/Globals.d.ts +108 -32
- package/es-modules/Grid/Core/Globals.js +98 -111
- package/es-modules/Grid/Core/Grid.d.ts +51 -17
- package/es-modules/Grid/Core/Grid.js +369 -79
- package/es-modules/Grid/Core/GridUtils.d.ts +96 -89
- package/es-modules/Grid/Core/GridUtils.js +143 -155
- package/es-modules/Grid/Core/Options.d.ts +3 -7
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +4 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +32 -57
- package/es-modules/Grid/Core/Pagination/Pagination.js +206 -214
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +22 -15
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +32 -9
- package/es-modules/Grid/Core/Querying/PaginationController.js +58 -18
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +7 -15
- package/es-modules/Grid/Core/Querying/SortingController.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +32 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +3 -5
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +1 -5
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +14 -10
- package/es-modules/Grid/Core/Table/Body/TableCell.js +19 -21
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Cell.js +30 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +2 -7
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +25 -14
- package/es-modules/Grid/Core/Table/Column.d.ts +7 -9
- package/es-modules/Grid/Core/Table/Column.js +23 -1
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +2 -2
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +30 -23
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +39 -39
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +1 -1
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +2 -2
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +10 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +2 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +26 -24
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +37 -39
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +11 -13
- package/es-modules/Grid/Core/Table/Table.js +9 -5
- package/es-modules/Grid/Core/UI/Button.d.ts +1 -1
- package/es-modules/Grid/Core/UI/ContextMenu.d.ts +1 -1
- package/es-modules/Grid/Core/UI/ContextMenu.js +1 -1
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +39 -44
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +4 -4
- package/es-modules/Grid/Core/UI/Popup.d.ts +17 -19
- package/es-modules/Grid/Core/UI/Popup.js +2 -1
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +49 -50
- package/es-modules/Grid/Core/UI/SvgIcons.js +114 -123
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +46 -52
- package/es-modules/Grid/Core/UI/ToolbarButton.js +4 -3
- package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +6 -8
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +8 -11
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +27 -1
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +149 -149
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +18 -20
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +19 -17
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +28 -34
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +12 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +41 -46
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +19 -8
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +17 -13
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +18 -20
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +17 -20
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +20 -22
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +40 -42
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +16 -18
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +14 -22
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +22 -24
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +46 -51
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +62 -77
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +16 -3
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +26 -31
- package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +0 -2
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +12 -11
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +29 -31
- package/es-modules/Grid/Pro/Export/Exporting.d.ts +3 -3
- package/es-modules/Grid/Pro/Export/Exporting.js +35 -29
- package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +12 -11
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +24 -26
- package/es-modules/Grid/Pro/GridEvents.d.ts +19 -1
- package/es-modules/Grid/Pro/GridEvents.js +6 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +4 -11
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +44 -45
- package/es-modules/Grid/index.d.ts +1 -0
- package/es-modules/masters/grid-pro.src.d.ts +62 -37
- package/es-modules/masters/grid-pro.src.js +37 -39
- package/grid-pro.d.ts +122 -48
- package/grid-pro.js +3 -6
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +122 -48
- package/grid-pro.src.js +6645 -6270
- package/package.json +5 -4
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +0 -29
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { CellRendererTypeRegistry } from './CellRendererType';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Record of cell renderer classes
|
|
4
|
+
*/
|
|
5
|
+
export declare const types: CellRendererTypeRegistry;
|
|
6
|
+
/**
|
|
7
|
+
* Method used to register new cell renderer classes.
|
|
8
|
+
*
|
|
9
|
+
* @param key
|
|
10
|
+
* Registry key of the cell renderer class.
|
|
11
|
+
*
|
|
12
|
+
* @param CellRendererClass
|
|
13
|
+
* Cell renderer class (aka class constructor) to register.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerRenderer<T extends keyof CellRendererTypeRegistry>(key: T, CellRendererClass: CellRendererTypeRegistry[T]): boolean;
|
|
16
|
+
declare const _default: {
|
|
17
|
+
readonly types: CellRendererTypeRegistry;
|
|
18
|
+
readonly registerRenderer: typeof registerRenderer;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -15,44 +15,38 @@
|
|
|
15
15
|
'use strict';
|
|
16
16
|
/* *
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Constants
|
|
19
19
|
*
|
|
20
20
|
* */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* Cell renderer class (aka class constructor) to register.
|
|
45
|
-
*/
|
|
46
|
-
function registerRenderer(key, CellRendererClass) {
|
|
47
|
-
return (!!key &&
|
|
48
|
-
!CellRendererRegistry.types[key] &&
|
|
49
|
-
!!(CellRendererRegistry.types[key] = CellRendererClass));
|
|
50
|
-
}
|
|
51
|
-
CellRendererRegistry.registerRenderer = registerRenderer;
|
|
52
|
-
})(CellRendererRegistry || (CellRendererRegistry = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Record of cell renderer classes
|
|
23
|
+
*/
|
|
24
|
+
export const types = {};
|
|
25
|
+
/* *
|
|
26
|
+
*
|
|
27
|
+
* Functions
|
|
28
|
+
*
|
|
29
|
+
* */
|
|
30
|
+
/**
|
|
31
|
+
* Method used to register new cell renderer classes.
|
|
32
|
+
*
|
|
33
|
+
* @param key
|
|
34
|
+
* Registry key of the cell renderer class.
|
|
35
|
+
*
|
|
36
|
+
* @param CellRendererClass
|
|
37
|
+
* Cell renderer class (aka class constructor) to register.
|
|
38
|
+
*/
|
|
39
|
+
export function registerRenderer(key, CellRendererClass) {
|
|
40
|
+
return (!!key &&
|
|
41
|
+
!types[key] &&
|
|
42
|
+
!!(types[key] = CellRendererClass));
|
|
43
|
+
}
|
|
53
44
|
/* *
|
|
54
45
|
*
|
|
55
46
|
* Default Export
|
|
56
47
|
*
|
|
57
48
|
* */
|
|
58
|
-
export default
|
|
49
|
+
export default {
|
|
50
|
+
types,
|
|
51
|
+
registerRenderer
|
|
52
|
+
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import type Column from '../../Core/Table/Column';
|
|
1
2
|
import type CellRendererType from './CellRendererType';
|
|
3
|
+
/**
|
|
4
|
+
* Extends the grid classes with cell editing functionality.
|
|
5
|
+
*
|
|
6
|
+
* @param ColumnClass
|
|
7
|
+
* The class to extend.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compose(ColumnClass: typeof Column): void;
|
|
2
10
|
declare module '../../Core/Options' {
|
|
3
11
|
interface ColumnCellOptions {
|
|
4
12
|
/**
|
|
@@ -15,4 +23,7 @@ declare module '../../Core/Table/Column' {
|
|
|
15
23
|
cellRenderer: CellRendererType;
|
|
16
24
|
}
|
|
17
25
|
}
|
|
18
|
-
|
|
26
|
+
declare const _default: {
|
|
27
|
+
readonly compose: typeof compose;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -23,57 +23,52 @@ const { addEvent, pushUnique } = U;
|
|
|
23
23
|
*
|
|
24
24
|
* */
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Extends the grid classes with cell editing functionality.
|
|
27
|
+
*
|
|
28
|
+
* @param ColumnClass
|
|
29
|
+
* The class to extend.
|
|
27
30
|
*/
|
|
28
|
-
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
* Extends the grid classes with cell editing functionality.
|
|
32
|
-
*
|
|
33
|
-
* @param ColumnClass
|
|
34
|
-
* The class to extend.
|
|
35
|
-
*/
|
|
36
|
-
function compose(ColumnClass) {
|
|
37
|
-
if (!pushUnique(Globals.composed, 'CellRenderers')) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
addEvent(ColumnClass, 'afterInit', afterColumnInit);
|
|
41
|
-
ColumnClass.prototype.createCellContent = createCellContent;
|
|
42
|
-
}
|
|
43
|
-
CellRenderersComposition.compose = compose;
|
|
44
|
-
/**
|
|
45
|
-
* Init a type of content for a column.
|
|
46
|
-
* @param this
|
|
47
|
-
* Current column.
|
|
48
|
-
*/
|
|
49
|
-
function afterColumnInit() {
|
|
50
|
-
const rendererType = this.options.cells?.renderer?.type || 'text';
|
|
51
|
-
let Renderer = CellRendererRegistry.types[rendererType];
|
|
52
|
-
if (!Renderer) {
|
|
53
|
-
// eslint-disable-next-line no-console
|
|
54
|
-
console.warn(`The cell renderer of type "${rendererType}" is not registered. Using default text renderer instead.`);
|
|
55
|
-
Renderer = CellRendererRegistry.types.text;
|
|
56
|
-
}
|
|
57
|
-
this.cellRenderer = new Renderer(this, this.options.cells?.renderer || {});
|
|
31
|
+
export function compose(ColumnClass) {
|
|
32
|
+
if (!pushUnique(Globals.composed, 'CellRenderers')) {
|
|
33
|
+
return;
|
|
58
34
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
35
|
+
addEvent(ColumnClass, 'afterInit', afterColumnInit);
|
|
36
|
+
ColumnClass.prototype.createCellContent = createCellContent;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Init a type of content for a column.
|
|
40
|
+
* @param this
|
|
41
|
+
* Current column.
|
|
42
|
+
*/
|
|
43
|
+
function afterColumnInit() {
|
|
44
|
+
const rendererType = this.options.cells?.renderer?.type || 'text';
|
|
45
|
+
let Renderer = CellRendererRegistry.types[rendererType];
|
|
46
|
+
if (!Renderer) {
|
|
47
|
+
// eslint-disable-next-line no-console
|
|
48
|
+
console.warn(`The cell renderer of type "${rendererType}" is not registered. Using default text renderer instead.`);
|
|
49
|
+
Renderer = CellRendererRegistry.types.text;
|
|
72
50
|
}
|
|
73
|
-
|
|
51
|
+
this.cellRenderer = new Renderer(this, this.options.cells?.renderer || {});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Render content of cell.
|
|
55
|
+
* @param this
|
|
56
|
+
* Current column.
|
|
57
|
+
*
|
|
58
|
+
* @param cell
|
|
59
|
+
* Current cell.
|
|
60
|
+
*
|
|
61
|
+
* @returns
|
|
62
|
+
* Formatted cell content.
|
|
63
|
+
*/
|
|
64
|
+
function createCellContent(cell) {
|
|
65
|
+
return this.cellRenderer.render(cell);
|
|
66
|
+
}
|
|
74
67
|
/* *
|
|
75
68
|
*
|
|
76
69
|
* Default Export
|
|
77
70
|
*
|
|
78
71
|
* */
|
|
79
|
-
export default
|
|
72
|
+
export default {
|
|
73
|
+
compose
|
|
74
|
+
};
|
|
@@ -38,7 +38,7 @@ class CheckboxContent extends CellContentPro {
|
|
|
38
38
|
this.changeHandler(e);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
void this.cell.
|
|
41
|
+
void this.cell.editValue(this.value);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
this.onKeyDown = (e) => {
|
|
@@ -66,6 +66,7 @@ class CheckboxContent extends CellContentPro {
|
|
|
66
66
|
input.tabIndex = -1;
|
|
67
67
|
input.type = 'checkbox';
|
|
68
68
|
input.name = cell.column.id + '-' + cell.row.id;
|
|
69
|
+
input.classList.add(Globals.getClassName('input'));
|
|
69
70
|
if (options.attributes) {
|
|
70
71
|
Object.entries(options.attributes).forEach(([key, value]) => {
|
|
71
72
|
input.setAttribute(key, value);
|
|
@@ -73,7 +74,6 @@ class CheckboxContent extends CellContentPro {
|
|
|
73
74
|
}
|
|
74
75
|
this.update();
|
|
75
76
|
parentElement.appendChild(this.input);
|
|
76
|
-
input.classList.add(Globals.classNamePrefix + 'field-auto-width');
|
|
77
77
|
input.addEventListener('change', this.onChange);
|
|
78
78
|
input.addEventListener('keydown', this.onKeyDown);
|
|
79
79
|
input.addEventListener('blur', this.onBlur);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EditModeContent } from '../../CellEditing/CellEditMode.js';
|
|
2
|
-
import type
|
|
2
|
+
import type { DateInputRendererOptions } from '../Renderers/DateInputRenderer.js';
|
|
3
3
|
import DateInputContentBase from './DateInputContentBase.js';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a date input type of cell content.
|
|
6
6
|
*/
|
|
7
7
|
declare class DateInputContent extends DateInputContentBase implements EditModeContent {
|
|
8
|
-
options:
|
|
8
|
+
options: DateInputRendererOptions;
|
|
9
9
|
protected getInputType(): 'date';
|
|
10
10
|
protected convertToInputValue(): string;
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { DateInputRendererBaseOptions } from '../Renderers/DateInputRendererBase';
|
|
2
2
|
import type { EditModeContent } from '../../CellEditing/CellEditMode';
|
|
3
3
|
import type TableCell from '../../../Core/Table/Body/TableCell';
|
|
4
4
|
import CellContentPro from '../CellContentPro.js';
|
|
@@ -17,7 +17,7 @@ declare abstract class DateInputContentBase extends CellContentPro implements Ed
|
|
|
17
17
|
/**
|
|
18
18
|
* Options of the renderer.
|
|
19
19
|
*/
|
|
20
|
-
options:
|
|
20
|
+
options: DateInputRendererBaseOptions;
|
|
21
21
|
/**
|
|
22
22
|
* The HTML input element representing the date input.
|
|
23
23
|
*/
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* */
|
|
15
15
|
'use strict';
|
|
16
16
|
import CellContentPro from '../CellContentPro.js';
|
|
17
|
+
import Globals from '../../../Core/Globals.js';
|
|
17
18
|
/* *
|
|
18
19
|
*
|
|
19
20
|
* Class
|
|
@@ -50,7 +51,7 @@ class DateInputContentBase extends CellContentPro {
|
|
|
50
51
|
}
|
|
51
52
|
if (e.key === 'Enter') {
|
|
52
53
|
this.cell.htmlElement.focus();
|
|
53
|
-
void this.cell.
|
|
54
|
+
void this.cell.editValue(this.value);
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
this.onBlur = (e) => {
|
|
@@ -58,7 +59,7 @@ class DateInputContentBase extends CellContentPro {
|
|
|
58
59
|
this.blurHandler(e);
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
void this.cell.
|
|
62
|
+
void this.cell.editValue(this.value);
|
|
62
63
|
};
|
|
63
64
|
this.onCellKeyDown = (e) => {
|
|
64
65
|
if (e.key === ' ') {
|
|
@@ -85,6 +86,7 @@ class DateInputContentBase extends CellContentPro {
|
|
|
85
86
|
input.tabIndex = -1;
|
|
86
87
|
input.type = this.getInputType();
|
|
87
88
|
input.name = cell.column.id + '-' + cell.row.id;
|
|
89
|
+
input.classList.add(Globals.getClassName('input'));
|
|
88
90
|
if (options.attributes) {
|
|
89
91
|
Object.entries(options.attributes).forEach(([key, value]) => {
|
|
90
92
|
input.setAttribute(key, value);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EditModeContent } from '../../CellEditing/CellEditMode.js';
|
|
2
|
-
import type
|
|
2
|
+
import type { DateTimeInputRendererOptions } from '../Renderers/DateTimeInputRenderer.js';
|
|
3
3
|
import DateInputContentBase from './DateInputContentBase.js';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a datetime input type of cell content.
|
|
6
6
|
*/
|
|
7
7
|
declare class DateTimeInputContent extends DateInputContentBase implements EditModeContent {
|
|
8
|
-
options:
|
|
8
|
+
options: DateTimeInputRendererOptions;
|
|
9
9
|
protected getInputType(): 'datetime-local';
|
|
10
10
|
protected convertToInputValue(): string;
|
|
11
11
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
'use strict';
|
|
16
16
|
import CellContentPro from '../CellContentPro.js';
|
|
17
17
|
import U from '../../../../Core/Utilities.js';
|
|
18
|
+
import Globals from '../../../Core/Globals.js';
|
|
18
19
|
const { defined } = U;
|
|
19
20
|
/* *
|
|
20
21
|
*
|
|
@@ -45,7 +46,7 @@ class NumberInputContent extends CellContentPro {
|
|
|
45
46
|
this.changeHandler(e);
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
|
-
void this.cell.
|
|
49
|
+
void this.cell.editValue(this.value);
|
|
49
50
|
};
|
|
50
51
|
this.onKeyDown = (e) => {
|
|
51
52
|
e.stopPropagation();
|
|
@@ -90,6 +91,7 @@ class NumberInputContent extends CellContentPro {
|
|
|
90
91
|
input.type = 'number';
|
|
91
92
|
input.tabIndex = -1;
|
|
92
93
|
input.name = cell.column.id + '-' + cell.row.id;
|
|
94
|
+
input.classList.add(Globals.getClassName('input'));
|
|
93
95
|
if (options.attributes) {
|
|
94
96
|
Object.entries(options.attributes).forEach(([key, value]) => {
|
|
95
97
|
input.setAttribute(key, value);
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
'use strict';
|
|
17
17
|
import CellContentPro from '../CellContentPro.js';
|
|
18
18
|
import AST from '../../../../Core/Renderer/HTML/AST.js';
|
|
19
|
+
import Globals from '../../../Core/Globals.js';
|
|
19
20
|
/* *
|
|
20
21
|
*
|
|
21
22
|
* Class
|
|
@@ -46,7 +47,7 @@ class SelectContent extends CellContentPro {
|
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
48
49
|
this.cell.htmlElement.focus();
|
|
49
|
-
void this.cell.
|
|
50
|
+
void this.cell.editValue(this.value);
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
this.onKeyDown = (e) => {
|
|
@@ -86,6 +87,7 @@ class SelectContent extends CellContentPro {
|
|
|
86
87
|
const select = this.select = document.createElement('select');
|
|
87
88
|
select.tabIndex = -1;
|
|
88
89
|
select.name = cell.column.id + '-' + cell.row.id;
|
|
90
|
+
select.classList.add(Globals.getClassName('input'));
|
|
89
91
|
if (options.attributes) {
|
|
90
92
|
Object.entries(options.attributes).forEach(([key, value]) => {
|
|
91
93
|
select.setAttribute(key, value);
|
|
@@ -7,8 +7,27 @@ import CellContentPro from '../CellContentPro.js';
|
|
|
7
7
|
* Represents a sparkline type of cell content.
|
|
8
8
|
*/
|
|
9
9
|
declare class SparklineContent extends CellContentPro {
|
|
10
|
+
/**
|
|
11
|
+
* Highcharts namespace used by the Sparkline Renderer.
|
|
12
|
+
* This is set to `undefined` by default, and should be set to the
|
|
13
|
+
* Highcharts namespace before using the Sparkline Renderer.
|
|
14
|
+
*/
|
|
15
|
+
static H: undefined | typeof HighchartsNamespace;
|
|
16
|
+
/**
|
|
17
|
+
* The default chart options for the sparkline content.
|
|
18
|
+
*/
|
|
10
19
|
static defaultChartOptions: DeepPartial<HighchartsNamespace.Options>;
|
|
20
|
+
/**
|
|
21
|
+
* The Highcharts chart instance.
|
|
22
|
+
*/
|
|
11
23
|
chart?: HighchartsNamespace.Chart;
|
|
24
|
+
/**
|
|
25
|
+
* The parent element for the sparkline content.
|
|
26
|
+
*/
|
|
27
|
+
private parentElement;
|
|
28
|
+
/**
|
|
29
|
+
* The HTML container element for the chart.
|
|
30
|
+
*/
|
|
12
31
|
private chartContainer?;
|
|
13
32
|
constructor(cell: TableCell, renderer: SparklineRenderer, parentElement?: HTMLElement);
|
|
14
33
|
protected add(parentElement?: HTMLElement): void;
|
|
@@ -17,12 +36,4 @@ declare class SparklineContent extends CellContentPro {
|
|
|
17
36
|
private getProcessedOptions;
|
|
18
37
|
private onKeyDown;
|
|
19
38
|
}
|
|
20
|
-
declare namespace SparklineContent {
|
|
21
|
-
/**
|
|
22
|
-
* Highcharts namespace used by the Sparkline Renderer.
|
|
23
|
-
* This is set to `undefined` by default, and should be set to the
|
|
24
|
-
* Highcharts namespace before using the Sparkline Renderer.
|
|
25
|
-
*/
|
|
26
|
-
let H: undefined | typeof HighchartsNamespace;
|
|
27
|
-
}
|
|
28
39
|
export default SparklineContent;
|
|
@@ -37,7 +37,8 @@ class SparklineContent extends CellContentPro {
|
|
|
37
37
|
this.onKeyDown = () => {
|
|
38
38
|
this.cell.htmlElement.focus();
|
|
39
39
|
};
|
|
40
|
-
this.
|
|
40
|
+
this.parentElement = parentElement ?? this.cell.htmlElement;
|
|
41
|
+
this.add(this.parentElement);
|
|
41
42
|
}
|
|
42
43
|
/* *
|
|
43
44
|
*
|
|
@@ -49,15 +50,22 @@ class SparklineContent extends CellContentPro {
|
|
|
49
50
|
if (!H || !defined(this.cell.value)) {
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
53
|
+
this.parentElement = parentElement;
|
|
52
54
|
this.chartContainer = document.createElement('div');
|
|
53
|
-
parentElement.classList.add(Globals.getClassName('noPadding'));
|
|
54
|
-
parentElement.appendChild(this.chartContainer);
|
|
55
|
+
this.parentElement.classList.add(Globals.getClassName('noPadding'));
|
|
56
|
+
this.parentElement.appendChild(this.chartContainer);
|
|
55
57
|
this.chart = H.Chart.chart(this.chartContainer, merge(SparklineContent.defaultChartOptions, this.getProcessedOptions()));
|
|
56
58
|
this.chartContainer.addEventListener('click', this.onKeyDown);
|
|
57
59
|
}
|
|
58
60
|
update() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
if (this.chart) {
|
|
62
|
+
const chartOptions = this.getProcessedOptions();
|
|
63
|
+
this.chart.update(chartOptions, true, false, chartOptions.chart?.animation);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.destroy();
|
|
67
|
+
this.add(this.parentElement);
|
|
68
|
+
}
|
|
61
69
|
}
|
|
62
70
|
destroy() {
|
|
63
71
|
this.chartContainer?.removeEventListener('keydown', this.onKeyDown);
|
|
@@ -65,7 +73,7 @@ class SparklineContent extends CellContentPro {
|
|
|
65
73
|
this.chartContainer?.remove();
|
|
66
74
|
delete this.chart;
|
|
67
75
|
delete this.chartContainer;
|
|
68
|
-
this.
|
|
76
|
+
this.parentElement.classList.remove(Globals.getClassName('noPadding'));
|
|
69
77
|
}
|
|
70
78
|
getProcessedOptions() {
|
|
71
79
|
const renderer = this.renderer;
|
|
@@ -89,6 +97,9 @@ class SparklineContent extends CellContentPro {
|
|
|
89
97
|
return options;
|
|
90
98
|
}
|
|
91
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* The default chart options for the sparkline content.
|
|
102
|
+
*/
|
|
92
103
|
SparklineContent.defaultChartOptions = {
|
|
93
104
|
chart: {
|
|
94
105
|
height: 40,
|
|
@@ -142,13 +153,6 @@ SparklineContent.defaultChartOptions = {
|
|
|
142
153
|
}
|
|
143
154
|
}
|
|
144
155
|
};
|
|
145
|
-
/* *
|
|
146
|
-
*
|
|
147
|
-
* Namespace
|
|
148
|
-
*
|
|
149
|
-
* */
|
|
150
|
-
(function (SparklineContent) {
|
|
151
|
-
})(SparklineContent || (SparklineContent = {}));
|
|
152
156
|
/* *
|
|
153
157
|
*
|
|
154
158
|
* Default Export
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
'use strict';
|
|
17
17
|
import CellContentPro from '../CellContentPro.js';
|
|
18
18
|
import U from '../../../../Core/Utilities.js';
|
|
19
|
+
import Globals from '../../../Core/Globals.js';
|
|
19
20
|
const { defined } = U;
|
|
20
21
|
/* *
|
|
21
22
|
*
|
|
@@ -42,7 +43,7 @@ class TextInputContent extends CellContentPro {
|
|
|
42
43
|
this.changeHandler(e);
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
|
-
void this.cell.
|
|
46
|
+
void this.cell.editValue(e.target.value);
|
|
46
47
|
};
|
|
47
48
|
this.onKeyDown = (e) => {
|
|
48
49
|
e.stopPropagation();
|
|
@@ -86,6 +87,7 @@ class TextInputContent extends CellContentPro {
|
|
|
86
87
|
const { options } = this.renderer;
|
|
87
88
|
input.tabIndex = -1;
|
|
88
89
|
input.name = cell.column.id + '-' + cell.row.id;
|
|
90
|
+
input.classList.add(Globals.getClassName('input'));
|
|
89
91
|
if (options.attributes) {
|
|
90
92
|
Object.entries(options.attributes).forEach(([key, value]) => {
|
|
91
93
|
input.setAttribute(key, value);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EditModeContent } from '../../CellEditing/CellEditMode.js';
|
|
2
|
-
import type
|
|
2
|
+
import type { TimeInputRendererOptions } from '../Renderers/TimeInputRenderer.js';
|
|
3
3
|
import DateInputContentBase from './DateInputContentBase.js';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a time input type of cell content.
|
|
6
6
|
*/
|
|
7
7
|
declare class TimeInputContent extends DateInputContentBase implements EditModeContent {
|
|
8
|
-
options:
|
|
8
|
+
options: TimeInputRendererOptions;
|
|
9
9
|
protected getInputType(): 'time';
|
|
10
10
|
get value(): number;
|
|
11
11
|
protected convertToInputValue(): string;
|
|
@@ -2,7 +2,7 @@ import type Column from '../../../Core/Table/Column';
|
|
|
2
2
|
import type { EditModeRenderer } from '../../CellEditing/CellEditMode';
|
|
3
3
|
import type TableCell from '../../../Core/Table/Body/TableCell';
|
|
4
4
|
import type { EditModeRendererTypeName } from '../../CellEditing/CellEditingComposition';
|
|
5
|
-
import CellRenderer from '../CellRenderer.js';
|
|
5
|
+
import { CellRenderer, CellRendererOptions } from '../CellRenderer.js';
|
|
6
6
|
import CheckboxContent from '../ContentTypes/CheckboxContent.js';
|
|
7
7
|
/**
|
|
8
8
|
* Renderer for the Checkbox in a column.
|
|
@@ -15,32 +15,30 @@ declare class CheckboxRenderer extends CellRenderer implements EditModeRenderer
|
|
|
15
15
|
/**
|
|
16
16
|
* Default options for the checkbox renderer.
|
|
17
17
|
*/
|
|
18
|
-
static defaultOptions:
|
|
19
|
-
options:
|
|
20
|
-
constructor(column: Column, options: Partial<
|
|
18
|
+
static defaultOptions: CheckboxRendererOptions;
|
|
19
|
+
options: CheckboxRendererOptions;
|
|
20
|
+
constructor(column: Column, options: Partial<CellRendererOptions>);
|
|
21
21
|
render(cell: TableCell, parentElement?: HTMLElement): CheckboxContent;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Options to control the checkbox renderer content.
|
|
25
|
+
*/
|
|
26
|
+
export interface CheckboxRendererOptions extends CellRendererOptions {
|
|
27
|
+
type: 'checkbox';
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* Whether the checkbox is disabled.
|
|
26
30
|
*/
|
|
27
|
-
|
|
28
|
-
type: 'checkbox';
|
|
29
|
-
/**
|
|
30
|
-
* Whether the checkbox is disabled.
|
|
31
|
-
*/
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Attributes to control the checkbox.
|
|
35
|
-
*/
|
|
36
|
-
attributes?: CheckboxAttributes;
|
|
37
|
-
}
|
|
31
|
+
disabled?: boolean;
|
|
38
32
|
/**
|
|
39
33
|
* Attributes to control the checkbox.
|
|
40
34
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
attributes?: CheckboxAttributes;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Attributes to control the checkbox.
|
|
39
|
+
*/
|
|
40
|
+
export interface CheckboxAttributes {
|
|
41
|
+
checked?: boolean;
|
|
44
42
|
}
|
|
45
43
|
declare module '../CellRendererType' {
|
|
46
44
|
interface CellRendererTypeRegistry {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
*
|
|
15
15
|
* */
|
|
16
16
|
'use strict';
|
|
17
|
-
import CellRenderer from '../CellRenderer.js';
|
|
18
|
-
import
|
|
17
|
+
import { CellRenderer } from '../CellRenderer.js';
|
|
18
|
+
import { registerRenderer } from '../CellRendererRegistry.js';
|
|
19
19
|
import CheckboxContent from '../ContentTypes/CheckboxContent.js';
|
|
20
20
|
import U from '../../../../Core/Utilities.js';
|
|
21
21
|
const { merge } = U;
|
|
@@ -56,7 +56,7 @@ CheckboxRenderer.defaultEditingRenderer = 'checkbox';
|
|
|
56
56
|
CheckboxRenderer.defaultOptions = {
|
|
57
57
|
type: 'checkbox'
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
registerRenderer('checkbox', CheckboxRenderer);
|
|
60
60
|
/* *
|
|
61
61
|
*
|
|
62
62
|
* Default Export
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type Column from '../../../Core/Table/Column';
|
|
2
|
-
import type
|
|
2
|
+
import type { DateInputRendererBaseOptions } from './DateInputRendererBase';
|
|
3
3
|
import type TableCell from '../../../Core/Table/Body/TableCell';
|
|
4
4
|
import type { EditModeRenderer } from '../../CellEditing/CellEditMode';
|
|
5
5
|
import type { EditModeRendererTypeName } from '../../CellEditing/CellEditingComposition';
|
|
6
|
-
import CellRenderer from '../CellRenderer.js';
|
|
6
|
+
import { CellRenderer, CellRendererOptions } from '../CellRenderer.js';
|
|
7
7
|
import DateInputContent from '../ContentTypes/DateInputContent.js';
|
|
8
8
|
/**
|
|
9
9
|
* Renderer for the Select in a column..
|
|
@@ -16,18 +16,16 @@ declare class DateInputRenderer extends CellRenderer implements EditModeRenderer
|
|
|
16
16
|
/**
|
|
17
17
|
* Default options for the date input renderer.
|
|
18
18
|
*/
|
|
19
|
-
static defaultOptions:
|
|
20
|
-
options:
|
|
21
|
-
constructor(column: Column, options: Partial<
|
|
19
|
+
static defaultOptions: DateInputRendererOptions;
|
|
20
|
+
options: DateInputRendererOptions;
|
|
21
|
+
constructor(column: Column, options: Partial<CellRendererOptions>);
|
|
22
22
|
render(cell: TableCell, parentElement?: HTMLElement): DateInputContent;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type: 'dateInput';
|
|
30
|
-
}
|
|
24
|
+
/**
|
|
25
|
+
* Options to control the date input renderer content.
|
|
26
|
+
*/
|
|
27
|
+
export interface DateInputRendererOptions extends DateInputRendererBaseOptions {
|
|
28
|
+
type: 'dateInput';
|
|
31
29
|
}
|
|
32
30
|
declare module '../CellRendererType' {
|
|
33
31
|
interface CellRendererTypeRegistry {
|