@datarailsshared/dr_renderer 1.5.150 → 1.5.159

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 (54) hide show
  1. package/package.json +5 -2
  2. package/src/charts/dr_donut_chart.d.ts +79 -0
  3. package/src/charts/dr_donut_chart.js +7 -2
  4. package/src/charts/dr_gauge_categories_summary_chart.d.ts +136 -0
  5. package/src/charts/dr_gauge_chart.d.ts +18 -0
  6. package/src/charts/dr_gauge_chart.js +31 -0
  7. package/src/dr-renderer-helpers.d.ts +18 -0
  8. package/src/dr-renderer-helpers.js +2 -2
  9. package/src/dr_pivottable.d.ts +2 -0
  10. package/src/dr_pivottable.js +32 -75
  11. package/src/errors.js +1 -0
  12. package/src/{types/graph-table-renderer.d.ts → graph-table-renderer.d.ts} +57 -4
  13. package/src/graph-table-renderer.js +74 -2
  14. package/src/highcharts_renderer.d.ts +5 -0
  15. package/src/highcharts_renderer.js +1 -0
  16. package/src/index.d.ts +83 -86
  17. package/src/index.js +77 -3
  18. package/src/novix_renderer.d.ts +2 -0
  19. package/src/novix_renderer.js +7 -0
  20. package/src/options/builders.js +1 -0
  21. package/src/options/constants.js +1 -0
  22. package/src/options/elements.js +1 -0
  23. package/src/options/helpers.js +1 -0
  24. package/src/options/index.js +1 -0
  25. package/src/options/presets.js +1 -0
  26. package/src/pivot-table/freeze-panes/constants.d.ts +26 -0
  27. package/src/pivot-table/freeze-panes/constants.js +42 -0
  28. package/src/pivot-table/freeze-panes/freeze-panes.css +282 -0
  29. package/src/pivot-table/freeze-panes/index.d.ts +115 -0
  30. package/src/pivot-table/freeze-panes/index.js +143 -0
  31. package/src/pivot-table/freeze-panes/sticky-strategy.d.ts +38 -0
  32. package/src/pivot-table/freeze-panes/sticky-strategy.js +247 -0
  33. package/src/pivot-table/freeze-panes/transform-strategy.d.ts +61 -0
  34. package/src/pivot-table/freeze-panes/transform-strategy.js +131 -0
  35. package/src/pivot.css +2 -98
  36. package/src/published_items_renderer.d.ts +10 -0
  37. package/src/seriesPointStyles-helper.d.ts +2 -0
  38. package/src/smart_queries_helper.d.ts +12 -0
  39. package/src/value.formatter.d.ts +3 -0
  40. package/tests/dr-renderer-helpers.test.js +29 -0
  41. package/tests/pivot-table/freeze-panes/constants.test.js +92 -0
  42. package/tests/pivot-table/freeze-panes/index.test.js +193 -0
  43. package/tests/pivot-table/freeze-panes/sticky-strategy.test.js +542 -0
  44. package/tests/pivot-table/freeze-panes/transform-strategy.test.js +304 -0
  45. package/tsconfig.json +7 -10
  46. package/src/types/index.d.ts +0 -12
  47. package/tsconfig.tsbuildinfo +0 -1
  48. /package/src/{types/errors.d.ts → errors.d.ts} +0 -0
  49. /package/src/{types/options → options}/builders.d.ts +0 -0
  50. /package/src/{types/options → options}/constants.d.ts +0 -0
  51. /package/src/{types/options → options}/elements.d.ts +0 -0
  52. /package/src/{types/options → options}/helpers.d.ts +0 -0
  53. /package/src/{types/options → options}/index.d.ts +0 -0
  54. /package/src/{types/options → options}/presets.d.ts +0 -0
@@ -1,6 +1,7 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @typedef {Object} HighChartsRenderer
3
- * @property {(rows: Rows, options: GTROptions | null, isTable: boolean, widget: any, pivotModel?: PivotModel) => string} rhPivotViewV2
4
+ * @property {(rows: Rows, options: GTROptions | null, isTable: boolean, widget: any, pivotModel?: PivotModel) => TableRenderResult} rhPivotViewV2
4
5
  */
5
6
 
6
7
  /**
@@ -31,6 +32,27 @@
31
32
  * @typedef {Record<string, Record<string, number | string> | number | string>[]} Rows - BE data response
32
33
  */
33
34
 
35
+ /**
36
+ * Interface for objects with a destroy cleanup method
37
+ * @typedef {Object} Destroyable
38
+ * @property {() => void} destroy - Cleanup method to release resources
39
+ */
40
+
41
+ /**
42
+ * HTMLElement enriched with library cleanup method
43
+ * @typedef {HTMLElement & Destroyable} DestroyableHTMLElement
44
+ */
45
+
46
+ /**
47
+ * Array enriched with library cleanup method (used by NovixRenderer Handsontable path)
48
+ * @typedef {Array<any> & Destroyable} DestroyableArray
49
+ */
50
+
51
+ /**
52
+ * Result from table rendering - can be a destroyable element, array, or string
53
+ * @typedef {DestroyableHTMLElement | DestroyableArray | string} TableRenderResult
54
+ */
55
+
34
56
  export class GraphTableRenderer {
35
57
  /**
36
58
  * @type {PivotModel | undefined}
@@ -69,6 +91,12 @@ export class GraphTableRenderer {
69
91
  */
70
92
  #hcInstance = null;
71
93
 
94
+ /**
95
+ * Stores the table render result for cleanup
96
+ * @type {TableRenderResult | null}
97
+ */
98
+ #tableResult = null;
99
+
72
100
  /**
73
101
  *
74
102
  * @param {HighChartsRenderer} hcr
@@ -131,8 +159,15 @@ export class GraphTableRenderer {
131
159
  delete this.#options.rendererOptions.hcInstance;
132
160
  }
133
161
 
162
+ /**
163
+ * Renders table view of the data
164
+ * @param {any} [widget] - Widget configuration
165
+ * @returns {TableRenderResult} - Render result with destroy method for cleanup
166
+ */
134
167
  renderTable(widget = null) {
135
- return this.#hcr.rhPivotViewV2(this.#rows, this.#options, true, widget, this.#pivotModel);
168
+ const result = this.#hcr.rhPivotViewV2(this.#rows, this.#options, true, widget, this.#pivotModel);
169
+ this.#tableResult = result;
170
+ return result;
136
171
  }
137
172
 
138
173
  renderChart(widget = null) {
@@ -142,6 +177,43 @@ export class GraphTableRenderer {
142
177
  });
143
178
  return chart;
144
179
  }
180
+
181
+ /**
182
+ * Destroys the renderer instance and cleans up all resources.
183
+ * This includes:
184
+ * - Destroying the Highcharts instance (if exists)
185
+ * - Calling destroy on table result (freeze panes observers, Handsontable instances, etc.)
186
+ * - Disposing the pivot model
187
+ * - Resetting internal state
188
+ * @returns {void}
189
+ */
190
+ destroy() {
191
+ if (this.#hcInstance && typeof this.#hcInstance.destroy === 'function') {
192
+ try {
193
+ this.#hcInstance.destroy();
194
+ } catch (e) {
195
+ console.warn('[dr_renderer] Error destroying Highcharts instance:', e);
196
+ }
197
+ }
198
+ this.#hcInstance = null;
199
+
200
+ if (this.#tableResult && typeof this.#tableResult !== 'string') {
201
+ const result = /** @type {Destroyable} */ (this.#tableResult);
202
+ if (typeof result.destroy === 'function') {
203
+ try {
204
+ result.destroy();
205
+ } catch (e) {
206
+ console.warn('[dr_renderer] Error destroying table result:', e);
207
+ }
208
+ }
209
+ }
210
+ this.#tableResult = null;
211
+
212
+ this.disposePivotModel();
213
+
214
+ this.#options = null;
215
+ this.#rows = [];
216
+ }
145
217
  }
146
218
 
147
219
  export default GraphTableRenderer;
@@ -0,0 +1,5 @@
1
+ export = getHighchartsRenderer;
2
+ /**
3
+ * @param {EnvironmentOptions} envOptions
4
+ */
5
+ declare function getHighchartsRenderer($: any, document: any, Highcharts: any, default_colors: any, highchartsRenderer: any, DataFormatter: any, lodash: any, moment_lib: any, isNewAngular: any, envOptions: EnvironmentOptions): any;
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  const helpers = require('./dr-renderer-helpers');
2
3
  const { DrGaugeChart, GAUGE_OPTIONS_DEFAULT } = require('./charts/dr_gauge_chart');
3
4
  const { DrDonutChart } = require('./charts/dr_donut_chart');
package/src/index.d.ts CHANGED
@@ -1,86 +1,83 @@
1
- export * from './types';
2
- import DataFormatterType = require('./dataformatter');
3
- import * as ErrorTypes from './types/errors';
4
- import * as OptionsTypes from './types/options/index';
5
- import { GraphTableRenderer as GraphTableRendererClass } from './types/graph-table-renderer';
6
-
7
- declare module '*.css' {
8
- const content: { [className: string]: string };
9
- export default content;
10
- }
11
-
12
- declare namespace DrRenderFactory {
13
- interface ColorsOptions {
14
- colors: string[];
15
- variance_color: string | null;
16
- }
17
-
18
- interface InitOptions {
19
- $: any;
20
- window: Window;
21
- document: Document;
22
- Handsontable?: any;
23
- }
24
-
25
- interface HighchartsRendererOptions {
26
- $: any;
27
- document: Document;
28
- Highcharts: any;
29
- default_colors: ColorsOptions;
30
- highchartsRenderer: any;
31
- lodash: any;
32
- moment_lib: any;
33
- isNewAngular: boolean;
34
- }
35
-
36
- interface EnvironmentOptions {
37
- features?: string[];
38
- disable_animation?: boolean;
39
- fiscal_year_starts_from?: number;
40
- fiscal_year_back?: boolean;
41
- enableStackedPercentCharts?: boolean;
42
-
43
- /** TODO: remove in DR-42736 */
44
- enabledNewWidgetValueFormatting?: boolean;
45
-
46
- /** Allow specifying custom gauge goal title */
47
- enableGaugeDynamicGoal?: boolean;
48
- }
49
-
50
- interface Factory {
51
- init($: any, window: Window, document: Document, Handsontable?: any): void;
52
- getInitHighchartsRenderer(
53
- $: any,
54
- document: Document,
55
- Highcharts: any,
56
- default_colors: ColorsOptions,
57
- highchartsRenderer: any,
58
- lodash: any,
59
- moment_lib: any,
60
- isNewAngular: boolean,
61
- envOptions?: EnvironmentOptions
62
- ): any;
63
- getInitPublishedItemsRenderer(publishedItemsRenderer: any, bind?: any): any;
64
-
65
- DataFormatter: typeof DataFormatterType;
66
-
67
- // Options builder module
68
- options: typeof OptionsTypes;
69
-
70
- // Error types and classes
71
- RendererErrorCodes: typeof ErrorTypes.RendererErrorCodes;
72
- BaseRendererError: typeof ErrorTypes.BaseRendererError;
73
- TooMuchDataError: typeof ErrorTypes.TooMuchDataError;
74
- NoDataError: typeof ErrorTypes.NoDataError;
75
- DataConflictError: typeof ErrorTypes.DataConflictError;
76
- GaugeConfigurationError: typeof ErrorTypes.GaugeConfigurationError;
77
- GenericRenderingError: typeof ErrorTypes.GenericRenderingError;
78
- GenericComputationalError: typeof ErrorTypes.GenericComputationalError;
79
-
80
- // GraphTableRenderer class
81
- GraphTableRenderer: typeof GraphTableRendererClass;
82
- }
83
- }
84
-
85
- declare const dr_render_factory: DrRenderFactory.Factory;
86
- export = dr_render_factory;
1
+ /**
2
+ * Sets the freeze panes mode globally.
3
+ * Call this before rendering tables to change the freeze panes behavior.
4
+ * @param {import('./pivot-table/freeze-panes/constants').FreezePanesMode} mode - 'transform' (legacy) or 'sticky' (native CSS)
5
+ * @returns {void}
6
+ */
7
+ export function setFreezePanesMode(mode: import("./pivot-table/freeze-panes/constants").FreezePanesMode): void;
8
+ /**
9
+ * Initializes the DR renderer with required dependencies.
10
+ * @param {*} $ - jQuery instance
11
+ * @param {Window & { DataFormatter?: any }} window - Window object
12
+ * @param {Document} document - Document object
13
+ * @param {*} [Handsontable] - Optional Handsontable instance
14
+ * @returns {void}
15
+ */
16
+ export function init($: any, window: Window & {
17
+ DataFormatter?: any;
18
+ }, document: Document, Handsontable?: any): void;
19
+ /**
20
+ * Creates and initializes a Highcharts renderer.
21
+ * @param {*} $ - jQuery instance
22
+ * @param {Document} document - Document object
23
+ * @param {*} Highcharts - Highcharts library
24
+ * @param {ColorsOptions} default_colors - Default color configuration
25
+ * @param {*} highchartsRenderer - Highcharts renderer instance
26
+ * @param {*} lodash - Lodash library
27
+ * @param {*} moment_lib - Moment.js library
28
+ * @param {boolean} isNewAngular - Whether using new Angular
29
+ * @param {EnvironmentOptions} [envOptions] - Environment configuration
30
+ * @returns {*}
31
+ */
32
+ export function getInitHighchartsRenderer($: any, document: Document, Highcharts: any, default_colors: ColorsOptions, highchartsRenderer: any, lodash: any, moment_lib: any, isNewAngular: boolean, envOptions?: EnvironmentOptions): any;
33
+ /**
34
+ * Creates and initializes a published items renderer.
35
+ * @param {*} publishedItemsRenderer - Published items renderer
36
+ * @param {Object} [bind={}] - Bind context
37
+ * @returns {*}
38
+ */
39
+ export function getInitPublishedItemsRenderer(publishedItemsRenderer: any, bind?: Object): any;
40
+ import DataFormatter = require("./dataformatter");
41
+ import options = require("./options");
42
+ import { GraphTableRenderer } from "./graph-table-renderer";
43
+ export type ColorsOptions = {
44
+ /**
45
+ * - Array of color hex codes
46
+ */
47
+ colors: string[];
48
+ /**
49
+ * - Color for variance display
50
+ */
51
+ variance_color: string | null;
52
+ };
53
+ export type EnvironmentOptions = {
54
+ /**
55
+ * - Enabled feature flags
56
+ */
57
+ features?: string[] | undefined;
58
+ /**
59
+ * - Disable chart animations
60
+ */
61
+ disable_animation?: boolean | undefined;
62
+ /**
63
+ * - Fiscal year start month
64
+ */
65
+ fiscal_year_starts_from?: number | undefined;
66
+ /**
67
+ * - Fiscal year direction
68
+ */
69
+ fiscal_year_back?: boolean | undefined;
70
+ /**
71
+ * - Enable stacked percent charts
72
+ */
73
+ enableStackedPercentCharts?: boolean | undefined;
74
+ /**
75
+ * - TODO: remove in DR-42736
76
+ */
77
+ enabledNewWidgetValueFormatting?: boolean | undefined;
78
+ /**
79
+ * - Allow custom gauge goal title
80
+ */
81
+ enableGaugeDynamicGoal?: boolean | undefined;
82
+ };
83
+ export { DataFormatter, options, RendererErrorCodes, BaseRendererError, TooMuchDataError, NoDataError, DataConflictError, GaugeConfigurationError, GenericRenderingError, GenericComputationalError, GraphTableRenderer, FREEZE_PANES_MODES };
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  const getPublishedItemsRenderer = require('./published_items_renderer');
2
3
  const getHighchartsRenderer = require('./highcharts_renderer');
3
4
  const initDRPivotTable = require('./dr_pivottable');
@@ -6,9 +7,45 @@ const DataFormatter = require('./dataformatter');
6
7
  const errors = require('./errors');
7
8
  const options = require('./options');
8
9
  const { GraphTableRenderer } = require('./graph-table-renderer');
10
+ const freezePanes = require('./pivot-table/freeze-panes');
11
+
12
+ /**
13
+ * @typedef {Object} ColorsOptions
14
+ * @property {string[]} colors - Array of color hex codes
15
+ * @property {string|null} variance_color - Color for variance display
16
+ */
17
+
18
+ /**
19
+ * @typedef {Object} EnvironmentOptions
20
+ * @property {string[]} [features] - Enabled feature flags
21
+ * @property {boolean} [disable_animation] - Disable chart animations
22
+ * @property {number} [fiscal_year_starts_from] - Fiscal year start month
23
+ * @property {boolean} [fiscal_year_back] - Fiscal year direction
24
+ * @property {boolean} [enableStackedPercentCharts] - Enable stacked percent charts
25
+ * @property {boolean} [enabledNewWidgetValueFormatting] - TODO: remove in DR-42736
26
+ * @property {boolean} [enableGaugeDynamicGoal] - Allow custom gauge goal title
27
+ */
9
28
 
10
29
  let dr_render_factory = {};
11
30
 
31
+ /**
32
+ * Sets the freeze panes mode globally.
33
+ * Call this before rendering tables to change the freeze panes behavior.
34
+ * @param {import('./pivot-table/freeze-panes/constants').FreezePanesMode} mode - 'transform' (legacy) or 'sticky' (native CSS)
35
+ * @returns {void}
36
+ */
37
+ dr_render_factory.setFreezePanesMode = function(mode) {
38
+ freezePanes.setMode(mode);
39
+ };
40
+
41
+ /**
42
+ * Initializes the DR renderer with required dependencies.
43
+ * @param {*} $ - jQuery instance
44
+ * @param {Window & { DataFormatter?: any }} window - Window object
45
+ * @param {Document} document - Document object
46
+ * @param {*} [Handsontable] - Optional Handsontable instance
47
+ * @returns {void}
48
+ */
12
49
  dr_render_factory.init = function($, window, document, Handsontable){
13
50
  window.DataFormatter = DataFormatter;
14
51
  initDRPivotTable($, window, document);
@@ -17,31 +54,68 @@ dr_render_factory.init = function($, window, document, Handsontable){
17
54
  }
18
55
  }
19
56
 
57
+ /**
58
+ * Creates and initializes a Highcharts renderer.
59
+ * @param {*} $ - jQuery instance
60
+ * @param {Document} document - Document object
61
+ * @param {*} Highcharts - Highcharts library
62
+ * @param {ColorsOptions} default_colors - Default color configuration
63
+ * @param {*} highchartsRenderer - Highcharts renderer instance
64
+ * @param {*} lodash - Lodash library
65
+ * @param {*} moment_lib - Moment.js library
66
+ * @param {boolean} isNewAngular - Whether using new Angular
67
+ * @param {EnvironmentOptions} [envOptions] - Environment configuration
68
+ * @returns {*}
69
+ */
20
70
  dr_render_factory.getInitHighchartsRenderer = function($, document, Highcharts, default_colors, highchartsRenderer, lodash, moment_lib, isNewAngular, envOptions){
21
71
  return getHighchartsRenderer($, document, Highcharts, default_colors, highchartsRenderer, DataFormatter, lodash, moment_lib, isNewAngular, envOptions);
22
72
  }
23
73
 
74
+ /**
75
+ * Creates and initializes a published items renderer.
76
+ * @param {*} publishedItemsRenderer - Published items renderer
77
+ * @param {Object} [bind={}] - Bind context
78
+ * @returns {*}
79
+ */
24
80
  dr_render_factory.getInitPublishedItemsRenderer = function (publishedItemsRenderer, bind = {}) {
25
81
  return getPublishedItemsRenderer.bind(bind)(publishedItemsRenderer);
26
82
  }
27
83
 
84
+ /** @type {typeof import('./dataformatter')} */
28
85
  dr_render_factory.DataFormatter = DataFormatter;
29
86
 
30
- // Export options builder module
87
+ /** @type {typeof import('./options')} */
31
88
  dr_render_factory.options = options;
32
89
 
33
- // Export error types and classes
90
+ /** @type {typeof import('./errors').RendererErrorCodes} */
34
91
  dr_render_factory.RendererErrorCodes = errors.RendererErrorCodes;
92
+
93
+ /** @type {typeof import('./errors').BaseRendererError} */
35
94
  dr_render_factory.BaseRendererError = errors.BaseRendererError;
95
+
96
+ /** @type {typeof import('./errors').TooMuchDataError} */
36
97
  dr_render_factory.TooMuchDataError = errors.TooMuchDataError;
98
+
99
+ /** @type {typeof import('./errors').NoDataError} */
37
100
  dr_render_factory.NoDataError = errors.NoDataError;
101
+
102
+ /** @type {typeof import('./errors').DataConflictError} */
38
103
  dr_render_factory.DataConflictError = errors.DataConflictError;
104
+
105
+ /** @type {typeof import('./errors').GaugeConfigurationError} */
39
106
  dr_render_factory.GaugeConfigurationError = errors.GaugeConfigurationError;
107
+
108
+ /** @type {typeof import('./errors').GenericRenderingError} */
40
109
  dr_render_factory.GenericRenderingError = errors.GenericRenderingError;
110
+
111
+ /** @type {typeof import('./errors').GenericComputationalError} */
41
112
  dr_render_factory.GenericComputationalError = errors.GenericComputationalError;
42
113
 
43
- // Export GraphTableRenderer class
114
+ /** @type {typeof import('./graph-table-renderer').GraphTableRenderer} */
44
115
  dr_render_factory.GraphTableRenderer = GraphTableRenderer;
45
116
 
117
+ /** @type {typeof import('./pivot-table/freeze-panes').FREEZE_PANES_MODES} */
118
+ dr_render_factory.FREEZE_PANES_MODES = freezePanes.FREEZE_PANES_MODES;
119
+
46
120
  //const $ = require( "jquery" )( window );
47
121
  module.exports = dr_render_factory;
@@ -0,0 +1,2 @@
1
+ export = initNovixRenderer;
2
+ declare function initNovixRenderer($: any, window: any, document: any, Handsontable: any): void;
@@ -858,6 +858,13 @@ let initNovixRenderer = function($, window, document, Handsontable){
858
858
  }
859
859
  });
860
860
 
861
+ $tableArea.get(0).destroy = function() {
862
+ if (table && typeof table.destroy === 'function') {
863
+ table.destroy();
864
+ table = null;
865
+ }
866
+ };
867
+
861
868
  setTimeout(function () {
862
869
 
863
870
  var currentState = opts.$el.data("currentState");
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @fileoverview Option builder functions for chart suboptions.
3
4
  * Each builder creates a complete suboption definition that can be used
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @fileoverview Shared constants for chart options builders.
3
4
  * These constants define default values for fonts, colors, and styling
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @fileoverview UI element factory functions for chart suboptions.
3
4
  * Provides reusable factories to create consistent element definitions
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @fileoverview Helper functions for chart options.
3
4
  * Contains utility functions used by option builders.
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @fileoverview Chart Options Builder API
3
4
  *
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * @fileoverview Chart-specific option presets.
3
4
  * Defines which suboptions are available for each chart type.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Freeze panes mode type.
3
+ */
4
+ export type FreezePanesMode = "transform" | "sticky";
5
+ export namespace FREEZE_PANES_MODES {
6
+ let TRANSFORM: "transform";
7
+ let STICKY: "sticky";
8
+ }
9
+ export namespace TRANSFORM_CSS_CLASSES {
10
+ let AXIS: string;
11
+ let VERTICAL: string;
12
+ let HORIZONTAL: string;
13
+ }
14
+ export namespace STICKY_CSS_CLASSES {
15
+ export let CONTAINER: string;
16
+ let AXIS_1: string;
17
+ export { AXIS_1 as AXIS };
18
+ let VERTICAL_1: string;
19
+ export { VERTICAL_1 as VERTICAL };
20
+ let HORIZONTAL_1: string;
21
+ export { HORIZONTAL_1 as HORIZONTAL };
22
+ export let ROWS_DISABLED: string;
23
+ export let COLUMNS_DISABLED: string;
24
+ }
25
+ export const FREEZE_PANES_THRESHOLD: 0.7;
26
+ export const FREEZE_PANES_THRESHOLD_CHECK_DEBOUNCE_MS: 150;
@@ -0,0 +1,42 @@
1
+ // @ts-check
2
+ /**
3
+ * @fileoverview Constants for freeze panes functionality.
4
+ * @module @datarailsshared/dr_renderer/pivot-table/freeze-panes/constants
5
+ */
6
+
7
+ /**
8
+ * Freeze panes mode type.
9
+ * @typedef {'transform' | 'sticky'} FreezePanesMode
10
+ */
11
+
12
+ const FREEZE_PANES_MODES = {
13
+ TRANSFORM: /** @type {'transform'} */ ('transform'),
14
+ STICKY: /** @type {'sticky'} */ ('sticky'),
15
+ };
16
+
17
+ const TRANSFORM_CSS_CLASSES = {
18
+ AXIS: 'axis-freeze-pane',
19
+ VERTICAL: 'vertical-freeze-pane',
20
+ HORIZONTAL: 'horizontal-freeze-pane',
21
+ };
22
+
23
+ const STICKY_CSS_CLASSES = {
24
+ CONTAINER: 'sticky-freeze-panes-container',
25
+ AXIS: 'sticky-axis-freeze-pane',
26
+ VERTICAL: 'sticky-vertical-freeze-pane',
27
+ HORIZONTAL: 'sticky-horizontal-freeze-pane',
28
+ ROWS_DISABLED: 'freeze-panes-rows-disabled',
29
+ COLUMNS_DISABLED: 'freeze-panes-columns-disabled',
30
+ };
31
+
32
+ const FREEZE_PANES_THRESHOLD = 0.7;
33
+
34
+ const FREEZE_PANES_THRESHOLD_CHECK_DEBOUNCE_MS = 150;
35
+
36
+ module.exports = {
37
+ FREEZE_PANES_MODES,
38
+ TRANSFORM_CSS_CLASSES,
39
+ STICKY_CSS_CLASSES,
40
+ FREEZE_PANES_THRESHOLD,
41
+ FREEZE_PANES_THRESHOLD_CHECK_DEBOUNCE_MS,
42
+ };