@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.
Files changed (164) hide show
  1. package/css/grid-pro.css +69 -85
  2. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +2 -0
  3. package/es-modules/Accessibility/Options/LangDefaults.js +6 -1
  4. package/es-modules/Accessibility/Utils/ChartUtilities.js +3 -3
  5. package/es-modules/Core/Color/ColorString.d.ts +25 -0
  6. package/es-modules/Core/Color/ColorType.d.ts +43 -0
  7. package/es-modules/Core/Color/GradientColor.d.ts +57 -0
  8. package/es-modules/Core/Globals.js +1 -1
  9. package/es-modules/Core/Renderer/AlignObject.d.ts +37 -0
  10. package/es-modules/Core/Renderer/BBoxObject.d.ts +40 -0
  11. package/es-modules/Core/Renderer/CSSObject.d.ts +130 -0
  12. package/es-modules/Core/Renderer/DOMElementType.d.ts +36 -0
  13. package/es-modules/Core/Renderer/DashStyleValue.d.ts +28 -0
  14. package/es-modules/Core/Renderer/FontMetricsObject.d.ts +38 -0
  15. package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +57 -0
  16. package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +19 -0
  17. package/es-modules/Core/Renderer/Position3DObject.d.ts +35 -0
  18. package/es-modules/Core/Renderer/PositionObject.d.ts +28 -0
  19. package/es-modules/Core/Renderer/RectangleObject.d.ts +35 -0
  20. package/es-modules/Core/Renderer/RendererType.d.ts +53 -0
  21. package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +43 -0
  22. package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +44 -0
  23. package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +147 -0
  24. package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +42 -0
  25. package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +42 -0
  26. package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +31 -0
  27. package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +97 -0
  28. package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +40 -0
  29. package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +31 -0
  30. package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +41 -0
  31. package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +50 -0
  32. package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +40 -0
  33. package/es-modules/Core/Renderer/SizeObject.d.ts +28 -0
  34. package/es-modules/Core/Templating.js +6 -7
  35. package/es-modules/Data/Connectors/DataConnector.js +3 -2
  36. package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +1 -1
  37. package/es-modules/Data/DataTable.d.ts +1 -1
  38. package/es-modules/Data/DataTable.js +3 -2
  39. package/es-modules/Data/DataTableCore.js +15 -6
  40. package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +13 -15
  41. package/es-modules/Grid/Core/Credits.d.ts +0 -2
  42. package/es-modules/Grid/Core/Defaults.d.ts +20 -17
  43. package/es-modules/Grid/Core/Defaults.js +116 -114
  44. package/es-modules/Grid/Core/Globals.d.ts +108 -32
  45. package/es-modules/Grid/Core/Globals.js +98 -111
  46. package/es-modules/Grid/Core/Grid.d.ts +51 -17
  47. package/es-modules/Grid/Core/Grid.js +369 -79
  48. package/es-modules/Grid/Core/GridUtils.d.ts +96 -89
  49. package/es-modules/Grid/Core/GridUtils.js +143 -155
  50. package/es-modules/Grid/Core/Options.d.ts +3 -7
  51. package/es-modules/Grid/Core/Pagination/Icons.d.ts +4 -4
  52. package/es-modules/Grid/Core/Pagination/Pagination.d.ts +32 -57
  53. package/es-modules/Grid/Core/Pagination/Pagination.js +206 -214
  54. package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +22 -15
  55. package/es-modules/Grid/Core/Querying/PaginationController.d.ts +32 -9
  56. package/es-modules/Grid/Core/Querying/PaginationController.js +58 -18
  57. package/es-modules/Grid/Core/Querying/SortingController.d.ts +7 -15
  58. package/es-modules/Grid/Core/Querying/SortingController.js +2 -3
  59. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +1 -1
  60. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +32 -4
  61. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +3 -3
  62. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +3 -5
  63. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +1 -5
  64. package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +14 -10
  65. package/es-modules/Grid/Core/Table/Body/TableCell.js +19 -21
  66. package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +0 -2
  67. package/es-modules/Grid/Core/Table/Cell.js +30 -0
  68. package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +2 -7
  69. package/es-modules/Grid/Core/Table/CellContent/TextContent.js +25 -14
  70. package/es-modules/Grid/Core/Table/Column.d.ts +7 -9
  71. package/es-modules/Grid/Core/Table/Column.js +23 -1
  72. package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +2 -2
  73. package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +30 -23
  74. package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +39 -39
  75. package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +1 -1
  76. package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +2 -2
  77. package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +6 -1
  78. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +10 -0
  79. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +2 -2
  80. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +26 -24
  81. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +37 -39
  82. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +1 -1
  83. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +1 -1
  84. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +1 -1
  85. package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +0 -2
  86. package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +0 -2
  87. package/es-modules/Grid/Core/Table/Table.d.ts +11 -13
  88. package/es-modules/Grid/Core/Table/Table.js +9 -5
  89. package/es-modules/Grid/Core/UI/Button.d.ts +1 -1
  90. package/es-modules/Grid/Core/UI/ContextMenu.d.ts +1 -1
  91. package/es-modules/Grid/Core/UI/ContextMenu.js +1 -1
  92. package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +39 -44
  93. package/es-modules/Grid/Core/UI/ContextMenuButton.js +4 -4
  94. package/es-modules/Grid/Core/UI/Popup.d.ts +17 -19
  95. package/es-modules/Grid/Core/UI/Popup.js +2 -1
  96. package/es-modules/Grid/Core/UI/SvgIcons.d.ts +49 -50
  97. package/es-modules/Grid/Core/UI/SvgIcons.js +114 -123
  98. package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +46 -52
  99. package/es-modules/Grid/Core/UI/ToolbarButton.js +4 -3
  100. package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +6 -8
  101. package/es-modules/Grid/Pro/CellEditing/CellEditing.js +8 -11
  102. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +27 -1
  103. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +149 -149
  104. package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +18 -20
  105. package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +1 -1
  106. package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +19 -17
  107. package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +28 -34
  108. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +12 -1
  109. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +41 -46
  110. package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +2 -2
  111. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +2 -2
  112. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +2 -2
  113. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +4 -2
  114. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +2 -2
  115. package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +3 -1
  116. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -1
  117. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +19 -8
  118. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +17 -13
  119. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +3 -1
  120. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +2 -2
  121. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +18 -20
  122. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +3 -3
  123. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +10 -12
  124. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +3 -3
  125. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +17 -20
  126. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +10 -12
  127. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +3 -3
  128. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +20 -22
  129. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +3 -3
  130. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +40 -42
  131. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +3 -3
  132. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +16 -18
  133. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +14 -22
  134. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +22 -24
  135. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +3 -3
  136. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +10 -12
  137. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +3 -3
  138. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +10 -12
  139. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +3 -3
  140. package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +46 -51
  141. package/es-modules/Grid/Pro/ColumnTypes/Validator.js +62 -77
  142. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +16 -3
  143. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +26 -31
  144. package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +0 -2
  145. package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +12 -11
  146. package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +29 -31
  147. package/es-modules/Grid/Pro/Export/Exporting.d.ts +3 -3
  148. package/es-modules/Grid/Pro/Export/Exporting.js +35 -29
  149. package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +12 -11
  150. package/es-modules/Grid/Pro/Export/ExportingComposition.js +24 -26
  151. package/es-modules/Grid/Pro/GridEvents.d.ts +19 -1
  152. package/es-modules/Grid/Pro/GridEvents.js +6 -2
  153. package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +4 -11
  154. package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +44 -45
  155. package/es-modules/Grid/index.d.ts +1 -0
  156. package/es-modules/masters/grid-pro.src.d.ts +62 -37
  157. package/es-modules/masters/grid-pro.src.js +37 -39
  158. package/grid-pro.d.ts +122 -48
  159. package/grid-pro.js +3 -6
  160. package/grid-pro.js.map +1 -1
  161. package/grid-pro.src.d.ts +122 -48
  162. package/grid-pro.src.js +6645 -6270
  163. package/package.json +13 -4
  164. 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
- declare namespace GridUtils {
22
- /**
23
- * Parameters for the makeHTMLElement utils function.
24
- */
25
- interface MakeHTMLElementParameters {
26
- className?: string;
27
- id?: string;
28
- innerText?: string;
29
- innerHTML?: string;
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
- export default GridUtils;
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
- * Namespace
28
+ * @param tagName
29
+ * The tag name of the element.
23
30
  *
24
- * */
25
- var GridUtils;
26
- (function (GridUtils) {
27
- /* *
28
- *
29
- * Declarations
30
- *
31
- * */
32
- /* *
33
- *
34
- * Functions
35
- *
36
- * */
37
- /**
38
- * Creates a HTML element with the provided options.
39
- *
40
- * @param tagName
41
- * The tag name of the element.
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
- GridUtils.makeDiv = makeDiv;
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
- GridUtils.isHTML = isHTML;
96
- /**
97
- * Returns a string containing plain text format by removing HTML tags
98
- *
99
- * @param text
100
- * String to be sanitized
101
- *
102
- * @returns
103
- * Sanitized plain text string
104
- */
105
- function sanitizeText(text) {
106
- try {
107
- return new DOMParser().parseFromString(text, 'text/html')
108
- .body.textContent || '';
109
- }
110
- catch {
111
- return '';
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
- GridUtils.sanitizeText = sanitizeText;
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
- GridUtils.setHTMLContent = setHTMLContent;
136
- /**
137
- * Creates a proxy that, when reading a property, first returns the value
138
- * from the original options of a given entity; if it is not defined, it
139
- * falls back to the value from the defaults (default options), recursively
140
- * for nested objects. Setting values on the proxy will change the original
141
- * options object (1st argument), not the defaults (2nd argument).
142
- *
143
- * @param options
144
- * The specific options object.
145
- *
146
- * @param defaultOptions
147
- * The default options to fall back to.
148
- *
149
- * @returns
150
- * A proxy that provides merged access to options and defaults.
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
- GridUtils.createOptionsProxy = createOptionsProxy;
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
- GridUtils.formatText = formatText;
185
- })(GridUtils || (GridUtils = {}));
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 GridUtils;
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 ColumnResizing from './Table/ColumnResizing/ColumnResizing';
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?: Column.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: string;
3
- previous: string;
4
- next: string;
5
- last: string;
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;