@highcharts/grid-pro 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/grid-pro.css +69 -85
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +2 -0
- package/es-modules/Accessibility/Options/LangDefaults.js +6 -1
- package/es-modules/Accessibility/Utils/ChartUtilities.js +3 -3
- package/es-modules/Core/Color/ColorString.d.ts +25 -0
- package/es-modules/Core/Color/ColorType.d.ts +43 -0
- package/es-modules/Core/Color/GradientColor.d.ts +57 -0
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/Renderer/AlignObject.d.ts +37 -0
- package/es-modules/Core/Renderer/BBoxObject.d.ts +40 -0
- package/es-modules/Core/Renderer/CSSObject.d.ts +130 -0
- package/es-modules/Core/Renderer/DOMElementType.d.ts +36 -0
- package/es-modules/Core/Renderer/DashStyleValue.d.ts +28 -0
- package/es-modules/Core/Renderer/FontMetricsObject.d.ts +38 -0
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +57 -0
- package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +19 -0
- package/es-modules/Core/Renderer/Position3DObject.d.ts +35 -0
- package/es-modules/Core/Renderer/PositionObject.d.ts +28 -0
- package/es-modules/Core/Renderer/RectangleObject.d.ts +35 -0
- package/es-modules/Core/Renderer/RendererType.d.ts +53 -0
- package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +43 -0
- package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +44 -0
- package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +147 -0
- package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +42 -0
- package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +42 -0
- package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +31 -0
- package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +97 -0
- package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +40 -0
- package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +31 -0
- package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +41 -0
- package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +50 -0
- package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +40 -0
- package/es-modules/Core/Renderer/SizeObject.d.ts +28 -0
- package/es-modules/Core/Templating.js +6 -7
- package/es-modules/Data/Connectors/DataConnector.js +3 -2
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +1 -1
- package/es-modules/Data/DataTable.d.ts +1 -1
- package/es-modules/Data/DataTable.js +3 -2
- package/es-modules/Data/DataTableCore.js +15 -6
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +13 -15
- package/es-modules/Grid/Core/Credits.d.ts +0 -2
- package/es-modules/Grid/Core/Defaults.d.ts +20 -17
- package/es-modules/Grid/Core/Defaults.js +116 -114
- package/es-modules/Grid/Core/Globals.d.ts +108 -32
- package/es-modules/Grid/Core/Globals.js +98 -111
- package/es-modules/Grid/Core/Grid.d.ts +51 -17
- package/es-modules/Grid/Core/Grid.js +369 -79
- package/es-modules/Grid/Core/GridUtils.d.ts +96 -89
- package/es-modules/Grid/Core/GridUtils.js +143 -155
- package/es-modules/Grid/Core/Options.d.ts +3 -7
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +4 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +32 -57
- package/es-modules/Grid/Core/Pagination/Pagination.js +206 -214
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +22 -15
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +32 -9
- package/es-modules/Grid/Core/Querying/PaginationController.js +58 -18
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +7 -15
- package/es-modules/Grid/Core/Querying/SortingController.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +32 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +3 -5
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +1 -5
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +14 -10
- package/es-modules/Grid/Core/Table/Body/TableCell.js +19 -21
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Cell.js +30 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +2 -7
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +25 -14
- package/es-modules/Grid/Core/Table/Column.d.ts +7 -9
- package/es-modules/Grid/Core/Table/Column.js +23 -1
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +2 -2
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +30 -23
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +39 -39
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +1 -1
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +2 -2
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +10 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +2 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +26 -24
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +37 -39
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +0 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +11 -13
- package/es-modules/Grid/Core/Table/Table.js +9 -5
- package/es-modules/Grid/Core/UI/Button.d.ts +1 -1
- package/es-modules/Grid/Core/UI/ContextMenu.d.ts +1 -1
- package/es-modules/Grid/Core/UI/ContextMenu.js +1 -1
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +39 -44
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +4 -4
- package/es-modules/Grid/Core/UI/Popup.d.ts +17 -19
- package/es-modules/Grid/Core/UI/Popup.js +2 -1
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +49 -50
- package/es-modules/Grid/Core/UI/SvgIcons.js +114 -123
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +46 -52
- package/es-modules/Grid/Core/UI/ToolbarButton.js +4 -3
- package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +6 -8
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +8 -11
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +27 -1
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +149 -149
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +18 -20
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +19 -17
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +28 -34
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +12 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +41 -46
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +19 -8
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +17 -13
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +3 -1
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +18 -20
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +17 -20
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +20 -22
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +40 -42
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +16 -18
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +14 -22
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +22 -24
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +10 -12
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +3 -3
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +46 -51
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +62 -77
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +16 -3
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +26 -31
- package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +0 -2
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +12 -11
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +29 -31
- package/es-modules/Grid/Pro/Export/Exporting.d.ts +3 -3
- package/es-modules/Grid/Pro/Export/Exporting.js +35 -29
- package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +12 -11
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +24 -26
- package/es-modules/Grid/Pro/GridEvents.d.ts +19 -1
- package/es-modules/Grid/Pro/GridEvents.js +6 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +4 -11
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +44 -45
- package/es-modules/Grid/index.d.ts +1 -0
- package/es-modules/masters/grid-pro.src.d.ts +62 -37
- package/es-modules/masters/grid-pro.src.js +37 -39
- package/grid-pro.d.ts +122 -48
- package/grid-pro.js +3 -6
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +122 -48
- package/grid-pro.src.js +6645 -6270
- package/package.json +13 -4
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +0 -29
|
@@ -18,93 +18,100 @@ export interface GridEventListener {
|
|
|
18
18
|
eventName: keyof HTMLElementEventMap;
|
|
19
19
|
listener: EventListener;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
style?: Partial<CSSStyleDeclaration>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Creates a HTML element with the provided options.
|
|
34
|
-
*
|
|
35
|
-
* @param tagName
|
|
36
|
-
* The tag name of the element.
|
|
37
|
-
*
|
|
38
|
-
* @param params
|
|
39
|
-
* The parameters of the element.
|
|
40
|
-
*
|
|
41
|
-
* @param parent
|
|
42
|
-
* The parent element.
|
|
43
|
-
*/
|
|
44
|
-
function makeHTMLElement<T extends HTMLElement>(tagName: string, params?: MakeHTMLElementParameters, parent?: HTMLElement): T;
|
|
45
|
-
/**
|
|
46
|
-
* Creates a div element with the provided class name and id.
|
|
47
|
-
*
|
|
48
|
-
* @param className
|
|
49
|
-
* The class name of the div.
|
|
50
|
-
*
|
|
51
|
-
* @param id
|
|
52
|
-
* The id of the element.
|
|
53
|
-
*/
|
|
54
|
-
function makeDiv(className: string, id?: string): HTMLElement;
|
|
55
|
-
/**
|
|
56
|
-
* Check if there's a possibility that the given string is an HTML
|
|
57
|
-
* (contains '<').
|
|
58
|
-
*
|
|
59
|
-
* @param str
|
|
60
|
-
* Text to verify.
|
|
61
|
-
*/
|
|
62
|
-
function isHTML(str: string): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Returns a string containing plain text format by removing HTML tags
|
|
65
|
-
*
|
|
66
|
-
* @param text
|
|
67
|
-
* String to be sanitized
|
|
68
|
-
*
|
|
69
|
-
* @returns
|
|
70
|
-
* Sanitized plain text string
|
|
71
|
-
*/
|
|
72
|
-
function sanitizeText(text: string): string;
|
|
73
|
-
/**
|
|
74
|
-
* Sets an element's content, checking whether it is HTML or plain text.
|
|
75
|
-
* Should be used instead of element.innerText when the content can be HTML.
|
|
76
|
-
*
|
|
77
|
-
* @param element
|
|
78
|
-
* Parent element where the content should be.
|
|
79
|
-
*
|
|
80
|
-
* @param content
|
|
81
|
-
* Content to render.
|
|
82
|
-
*/
|
|
83
|
-
function setHTMLContent(element: HTMLElement, content: string): void;
|
|
84
|
-
/**
|
|
85
|
-
* Creates a proxy that, when reading a property, first returns the value
|
|
86
|
-
* from the original options of a given entity; if it is not defined, it
|
|
87
|
-
* falls back to the value from the defaults (default options), recursively
|
|
88
|
-
* for nested objects. Setting values on the proxy will change the original
|
|
89
|
-
* options object (1st argument), not the defaults (2nd argument).
|
|
90
|
-
*
|
|
91
|
-
* @param options
|
|
92
|
-
* The specific options object.
|
|
93
|
-
*
|
|
94
|
-
* @param defaultOptions
|
|
95
|
-
* The default options to fall back to.
|
|
96
|
-
*
|
|
97
|
-
* @returns
|
|
98
|
-
* A proxy that provides merged access to options and defaults.
|
|
99
|
-
*/
|
|
100
|
-
function createOptionsProxy<T extends object>(options: T, defaultOptions?: Partial<T>): T;
|
|
101
|
-
/**
|
|
102
|
-
* Format text with placeholders. Used for lang texts.
|
|
103
|
-
*
|
|
104
|
-
* @param template The text template with placeholders
|
|
105
|
-
* @param values Object containing values to replace placeholders
|
|
106
|
-
* @returns Formatted text
|
|
107
|
-
*/
|
|
108
|
-
function formatText(template: string, values: Record<string, string | number>): string;
|
|
21
|
+
/**
|
|
22
|
+
* Parameters for the makeHTMLElement utils function.
|
|
23
|
+
*/
|
|
24
|
+
export interface MakeHTMLElementParameters {
|
|
25
|
+
className?: string;
|
|
26
|
+
id?: string;
|
|
27
|
+
innerText?: string;
|
|
28
|
+
innerHTML?: string;
|
|
29
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
109
30
|
}
|
|
110
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Creates a HTML element with the provided options.
|
|
33
|
+
*
|
|
34
|
+
* @param tagName
|
|
35
|
+
* The tag name of the element.
|
|
36
|
+
*
|
|
37
|
+
* @param params
|
|
38
|
+
* The parameters of the element.
|
|
39
|
+
*
|
|
40
|
+
* @param parent
|
|
41
|
+
* The parent element.
|
|
42
|
+
*/
|
|
43
|
+
export declare function makeHTMLElement<T extends HTMLElement>(tagName: string, params?: MakeHTMLElementParameters, parent?: HTMLElement): T;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a div element with the provided class name and id.
|
|
46
|
+
*
|
|
47
|
+
* @param className
|
|
48
|
+
* The class name of the div.
|
|
49
|
+
*
|
|
50
|
+
* @param id
|
|
51
|
+
* The id of the element.
|
|
52
|
+
*/
|
|
53
|
+
export declare function makeDiv(className: string, id?: string): HTMLElement;
|
|
54
|
+
/**
|
|
55
|
+
* Check if there's a possibility that the given string is an HTML
|
|
56
|
+
* (contains '<').
|
|
57
|
+
*
|
|
58
|
+
* @param str
|
|
59
|
+
* Text to verify.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isHTML(str: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Returns a string containing plain text format by removing HTML tags
|
|
64
|
+
*
|
|
65
|
+
* @param text
|
|
66
|
+
* String to be sanitized
|
|
67
|
+
*
|
|
68
|
+
* @returns
|
|
69
|
+
* Sanitized plain text string
|
|
70
|
+
*/
|
|
71
|
+
export declare function sanitizeText(text: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Sets an element's content, checking whether it is HTML or plain text.
|
|
74
|
+
* Should be used instead of element.innerText when the content can be HTML.
|
|
75
|
+
*
|
|
76
|
+
* @param element
|
|
77
|
+
* Parent element where the content should be.
|
|
78
|
+
*
|
|
79
|
+
* @param content
|
|
80
|
+
* Content to render.
|
|
81
|
+
*/
|
|
82
|
+
export declare function setHTMLContent(element: HTMLElement, content: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a proxy that, when reading a property, first returns the value
|
|
85
|
+
* from the original options of a given entity; if it is not defined, it
|
|
86
|
+
* falls back to the value from the defaults (default options), recursively
|
|
87
|
+
* for nested objects. Setting values on the proxy will change the original
|
|
88
|
+
* options object (1st argument), not the defaults (2nd argument).
|
|
89
|
+
*
|
|
90
|
+
* @param options
|
|
91
|
+
* The specific options object.
|
|
92
|
+
*
|
|
93
|
+
* @param defaultOptions
|
|
94
|
+
* The default options to fall back to.
|
|
95
|
+
*
|
|
96
|
+
* @returns
|
|
97
|
+
* A proxy that provides merged access to options and defaults.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createOptionsProxy<T extends object>(options: T, defaultOptions?: Partial<T>): T;
|
|
100
|
+
/**
|
|
101
|
+
* Format text with placeholders. Used for lang texts.
|
|
102
|
+
*
|
|
103
|
+
* @param template The text template with placeholders
|
|
104
|
+
* @param values Object containing values to replace placeholders
|
|
105
|
+
* @returns Formatted text
|
|
106
|
+
*/
|
|
107
|
+
export declare function formatText(template: string, values: Record<string, string | number>): string;
|
|
108
|
+
declare const _default: {
|
|
109
|
+
readonly makeHTMLElement: typeof makeHTMLElement;
|
|
110
|
+
readonly makeDiv: typeof makeDiv;
|
|
111
|
+
readonly isHTML: typeof isHTML;
|
|
112
|
+
readonly sanitizeText: typeof sanitizeText;
|
|
113
|
+
readonly setHTMLContent: typeof setHTMLContent;
|
|
114
|
+
readonly createOptionsProxy: typeof createOptionsProxy;
|
|
115
|
+
readonly formatText: typeof formatText;
|
|
116
|
+
};
|
|
117
|
+
export default _default;
|
|
@@ -18,174 +18,162 @@ const { isObject } = U;
|
|
|
18
18
|
AST.allowedAttributes.push('srcset', 'media');
|
|
19
19
|
AST.allowedTags.push('picture', 'source');
|
|
20
20
|
/* *
|
|
21
|
+
*
|
|
22
|
+
* Functions
|
|
23
|
+
*
|
|
24
|
+
* */
|
|
25
|
+
/**
|
|
26
|
+
* Creates a HTML element with the provided options.
|
|
21
27
|
*
|
|
22
|
-
*
|
|
28
|
+
* @param tagName
|
|
29
|
+
* The tag name of the element.
|
|
23
30
|
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* @param params
|
|
44
|
-
* The parameters of the element.
|
|
45
|
-
*
|
|
46
|
-
* @param parent
|
|
47
|
-
* The parent element.
|
|
48
|
-
*/
|
|
49
|
-
function makeHTMLElement(tagName, params, parent) {
|
|
50
|
-
const element = document.createElement(tagName);
|
|
51
|
-
if (params) {
|
|
52
|
-
const paramsKeys = Object.keys(params);
|
|
53
|
-
for (let i = 0; i < paramsKeys.length; i++) {
|
|
54
|
-
const key = paramsKeys[i];
|
|
55
|
-
const value = params[key];
|
|
56
|
-
if (value !== void 0) {
|
|
57
|
-
if (key === 'style') {
|
|
58
|
-
Object.assign(element.style, value);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
element[key] = value;
|
|
62
|
-
}
|
|
31
|
+
* @param params
|
|
32
|
+
* The parameters of the element.
|
|
33
|
+
*
|
|
34
|
+
* @param parent
|
|
35
|
+
* The parent element.
|
|
36
|
+
*/
|
|
37
|
+
export function makeHTMLElement(tagName, params, parent) {
|
|
38
|
+
const element = document.createElement(tagName);
|
|
39
|
+
if (params) {
|
|
40
|
+
const paramsKeys = Object.keys(params);
|
|
41
|
+
for (let i = 0; i < paramsKeys.length; i++) {
|
|
42
|
+
const key = paramsKeys[i];
|
|
43
|
+
const value = params[key];
|
|
44
|
+
if (value !== void 0) {
|
|
45
|
+
if (key === 'style') {
|
|
46
|
+
Object.assign(element.style, value);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
element[key] = value;
|
|
63
50
|
}
|
|
64
51
|
}
|
|
65
52
|
}
|
|
66
|
-
if (parent) {
|
|
67
|
-
parent.appendChild(element);
|
|
68
|
-
}
|
|
69
|
-
return element;
|
|
70
|
-
}
|
|
71
|
-
GridUtils.makeHTMLElement = makeHTMLElement;
|
|
72
|
-
/**
|
|
73
|
-
* Creates a div element with the provided class name and id.
|
|
74
|
-
*
|
|
75
|
-
* @param className
|
|
76
|
-
* The class name of the div.
|
|
77
|
-
*
|
|
78
|
-
* @param id
|
|
79
|
-
* The id of the element.
|
|
80
|
-
*/
|
|
81
|
-
function makeDiv(className, id) {
|
|
82
|
-
return makeHTMLElement('div', { className, id });
|
|
83
53
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* Check if there's a possibility that the given string is an HTML
|
|
87
|
-
* (contains '<').
|
|
88
|
-
*
|
|
89
|
-
* @param str
|
|
90
|
-
* Text to verify.
|
|
91
|
-
*/
|
|
92
|
-
function isHTML(str) {
|
|
93
|
-
return str.indexOf('<') !== -1;
|
|
54
|
+
if (parent) {
|
|
55
|
+
parent.appendChild(element);
|
|
94
56
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
57
|
+
return element;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a div element with the provided class name and id.
|
|
61
|
+
*
|
|
62
|
+
* @param className
|
|
63
|
+
* The class name of the div.
|
|
64
|
+
*
|
|
65
|
+
* @param id
|
|
66
|
+
* The id of the element.
|
|
67
|
+
*/
|
|
68
|
+
export function makeDiv(className, id) {
|
|
69
|
+
return makeHTMLElement('div', { className, id });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Check if there's a possibility that the given string is an HTML
|
|
73
|
+
* (contains '<').
|
|
74
|
+
*
|
|
75
|
+
* @param str
|
|
76
|
+
* Text to verify.
|
|
77
|
+
*/
|
|
78
|
+
export function isHTML(str) {
|
|
79
|
+
return str.indexOf('<') !== -1;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns a string containing plain text format by removing HTML tags
|
|
83
|
+
*
|
|
84
|
+
* @param text
|
|
85
|
+
* String to be sanitized
|
|
86
|
+
*
|
|
87
|
+
* @returns
|
|
88
|
+
* Sanitized plain text string
|
|
89
|
+
*/
|
|
90
|
+
export function sanitizeText(text) {
|
|
91
|
+
try {
|
|
92
|
+
return new DOMParser().parseFromString(text, 'text/html')
|
|
93
|
+
.body.textContent || '';
|
|
113
94
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
* Sets an element's content, checking whether it is HTML or plain text.
|
|
117
|
-
* Should be used instead of element.innerText when the content can be HTML.
|
|
118
|
-
*
|
|
119
|
-
* @param element
|
|
120
|
-
* Parent element where the content should be.
|
|
121
|
-
*
|
|
122
|
-
* @param content
|
|
123
|
-
* Content to render.
|
|
124
|
-
*/
|
|
125
|
-
function setHTMLContent(element, content) {
|
|
126
|
-
if (isHTML(content)) {
|
|
127
|
-
element.innerHTML = AST.emptyHTML;
|
|
128
|
-
const formattedNodes = new AST(content);
|
|
129
|
-
formattedNodes.addToDOM(element);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
element.innerText = content;
|
|
133
|
-
}
|
|
95
|
+
catch {
|
|
96
|
+
return '';
|
|
134
97
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
*/
|
|
152
|
-
function createOptionsProxy(options, defaultOptions = {}) {
|
|
153
|
-
const handler = (defaults = {}) => ({
|
|
154
|
-
get(target, prop) {
|
|
155
|
-
const targetValue = target[prop];
|
|
156
|
-
const defaultValue = defaults[prop];
|
|
157
|
-
if (isObject(targetValue, true)) {
|
|
158
|
-
return new Proxy(targetValue, handler(defaultValue ?? {}));
|
|
159
|
-
}
|
|
160
|
-
return targetValue ?? defaultValue;
|
|
161
|
-
},
|
|
162
|
-
set(target, prop, value) {
|
|
163
|
-
target[prop] = value;
|
|
164
|
-
return true;
|
|
165
|
-
},
|
|
166
|
-
deleteProperty(target, prop) {
|
|
167
|
-
delete target[prop];
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
return new Proxy(options, handler(defaultOptions));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Sets an element's content, checking whether it is HTML or plain text.
|
|
101
|
+
* Should be used instead of element.innerText when the content can be HTML.
|
|
102
|
+
*
|
|
103
|
+
* @param element
|
|
104
|
+
* Parent element where the content should be.
|
|
105
|
+
*
|
|
106
|
+
* @param content
|
|
107
|
+
* Content to render.
|
|
108
|
+
*/
|
|
109
|
+
export function setHTMLContent(element, content) {
|
|
110
|
+
if (isHTML(content)) {
|
|
111
|
+
element.innerHTML = AST.emptyHTML;
|
|
112
|
+
const formattedNodes = new AST(content);
|
|
113
|
+
formattedNodes.addToDOM(element);
|
|
172
114
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
* Format text with placeholders. Used for lang texts.
|
|
176
|
-
*
|
|
177
|
-
* @param template The text template with placeholders
|
|
178
|
-
* @param values Object containing values to replace placeholders
|
|
179
|
-
* @returns Formatted text
|
|
180
|
-
*/
|
|
181
|
-
function formatText(template, values) {
|
|
182
|
-
return template.replace(/\{(\w+)\}/g, (match, key) => (values[key] !== void 0 ? String(values[key]) : match));
|
|
115
|
+
else {
|
|
116
|
+
element.innerText = content;
|
|
183
117
|
}
|
|
184
|
-
|
|
185
|
-
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Creates a proxy that, when reading a property, first returns the value
|
|
121
|
+
* from the original options of a given entity; if it is not defined, it
|
|
122
|
+
* falls back to the value from the defaults (default options), recursively
|
|
123
|
+
* for nested objects. Setting values on the proxy will change the original
|
|
124
|
+
* options object (1st argument), not the defaults (2nd argument).
|
|
125
|
+
*
|
|
126
|
+
* @param options
|
|
127
|
+
* The specific options object.
|
|
128
|
+
*
|
|
129
|
+
* @param defaultOptions
|
|
130
|
+
* The default options to fall back to.
|
|
131
|
+
*
|
|
132
|
+
* @returns
|
|
133
|
+
* A proxy that provides merged access to options and defaults.
|
|
134
|
+
*/
|
|
135
|
+
export function createOptionsProxy(options, defaultOptions = {}) {
|
|
136
|
+
const handler = (defaults = {}) => ({
|
|
137
|
+
get(target, prop) {
|
|
138
|
+
const targetValue = target[prop];
|
|
139
|
+
const defaultValue = defaults[prop];
|
|
140
|
+
if (isObject(targetValue, true)) {
|
|
141
|
+
return new Proxy(targetValue, handler(defaultValue ?? {}));
|
|
142
|
+
}
|
|
143
|
+
return targetValue ?? defaultValue;
|
|
144
|
+
},
|
|
145
|
+
set(target, prop, value) {
|
|
146
|
+
target[prop] = value;
|
|
147
|
+
return true;
|
|
148
|
+
},
|
|
149
|
+
deleteProperty(target, prop) {
|
|
150
|
+
delete target[prop];
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
return new Proxy(options, handler(defaultOptions));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Format text with placeholders. Used for lang texts.
|
|
158
|
+
*
|
|
159
|
+
* @param template The text template with placeholders
|
|
160
|
+
* @param values Object containing values to replace placeholders
|
|
161
|
+
* @returns Formatted text
|
|
162
|
+
*/
|
|
163
|
+
export function formatText(template, values) {
|
|
164
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => (values[key] !== void 0 ? String(values[key]) : match));
|
|
165
|
+
}
|
|
186
166
|
/* *
|
|
187
167
|
*
|
|
188
168
|
* Default Export
|
|
189
169
|
*
|
|
190
170
|
* */
|
|
191
|
-
export default
|
|
171
|
+
export default {
|
|
172
|
+
makeHTMLElement,
|
|
173
|
+
makeDiv,
|
|
174
|
+
isHTML,
|
|
175
|
+
sanitizeText,
|
|
176
|
+
setHTMLContent,
|
|
177
|
+
createOptionsProxy,
|
|
178
|
+
formatText
|
|
179
|
+
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { A11yOptions, HeaderCellA11yOptions, LangAccessibilityOptions } from './Accessibility/A11yOptions';
|
|
2
2
|
import type { PaginationLangOptions, PaginationOptions } from './Pagination/PaginationOptions';
|
|
3
|
-
import type
|
|
3
|
+
import type { ColumnResizingMode } from './Table/ColumnResizing/ColumnResizing';
|
|
4
|
+
import type { ColumnDataType } from './Table/Column';
|
|
4
5
|
import type DataTable from '../../Data/DataTable';
|
|
5
6
|
import type DataTableOptions from '../../Data/DataTableOptions';
|
|
6
7
|
import type Cell from './Table/Cell';
|
|
7
|
-
import type Column from './Table/Column';
|
|
8
8
|
import type { LangOptionsCore } from '../../Shared/LangOptionsCore';
|
|
9
9
|
import type { Condition as ColumnFilteringCondition } from './Table/Actions/ColumnFiltering/FilteringTypes';
|
|
10
|
-
/**
|
|
11
|
-
* The resizing strategy of the columns in the grid structure.
|
|
12
|
-
*/
|
|
13
|
-
export type ColumnResizingMode = ColumnResizing.ModeType;
|
|
14
10
|
/**
|
|
15
11
|
* Callback function to be called when a header event is triggered. Returns a
|
|
16
12
|
* formatted cell's string.
|
|
@@ -254,7 +250,7 @@ export interface ColumnOptions {
|
|
|
254
250
|
* If not set, the data type is inferred from the first cell in the
|
|
255
251
|
* column.
|
|
256
252
|
*/
|
|
257
|
-
dataType?:
|
|
253
|
+
dataType?: ColumnDataType;
|
|
258
254
|
/**
|
|
259
255
|
* Options for all the header cells in the column.
|
|
260
256
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const icons: {
|
|
2
|
-
first:
|
|
3
|
-
previous:
|
|
4
|
-
next:
|
|
5
|
-
last:
|
|
2
|
+
readonly first: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\"><path d=\"M5 9L1 5L5 1M9 9L5 5L9 1\" stroke=\"currentColor\" stroke-width=\"1.34\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>";
|
|
3
|
+
readonly previous: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 8 10\" fill=\"none\"><path d=\"M5 9L1 5L5 1\" stroke=\"currentColor\" stroke-width=\"1.34\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>";
|
|
4
|
+
readonly next: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 4 10\" fill=\"none\"><path d=\"M1 1L5 5L1 9\" stroke=\"currentColor\" stroke-width=\"1.34\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>";
|
|
5
|
+
readonly last: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\"><path d=\"M5 1L9 5L5 9M1 1L5 5L1 9\" stroke=\"currentColor\" stroke-width=\"1.34\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>";
|
|
6
6
|
};
|
|
7
7
|
export default icons;
|