@adaptabletools/adaptable 23.0.22 → 23.1.0-canary.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 (33) hide show
  1. package/package.json +3 -2
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  3. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +1 -1
  4. package/src/AdaptableOptions/ContextMenuOptions.d.ts +1 -1
  5. package/src/AdaptableOptions/FilterOptions.d.ts +22 -6
  6. package/src/Redux/Store/AdaptableStore.js +6 -1
  7. package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.d.ts +2 -0
  8. package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +13 -10
  9. package/src/Utilities/Hooks/useAdaptableOptions.d.ts +1 -1
  10. package/src/Utilities/Services/AnnotationsService.js +8 -8
  11. package/src/View/Components/ColumnFilter/components/FloatingFilterValues.d.ts +3 -9
  12. package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +10 -6
  13. package/src/View/Components/PredicateEditor/PredicateEditor.js +8 -4
  14. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +18 -8
  15. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +2 -2
  16. package/src/View/Wizard/OnePageWizards.d.ts +1 -1
  17. package/src/agGrid/AdaptableAgGrid.d.ts +30 -6
  18. package/src/agGrid/AdaptableAgGrid.js +60 -78
  19. package/src/agGrid/AgGridAdapter.d.ts +32 -1
  20. package/src/agGrid/AgGridAdapter.js +88 -0
  21. package/src/agGrid/AgGridColumnAdapter.d.ts +44 -0
  22. package/src/agGrid/AgGridColumnAdapter.js +153 -37
  23. package/src/agGrid/AgGridMenuAdapter.d.ts +8 -2
  24. package/src/agGrid/AgGridMenuAdapter.js +17 -4
  25. package/src/agGrid/AgGridModulesAdapter.js +6 -1
  26. package/src/agGrid/AgGridThemeAdapter.d.ts +17 -0
  27. package/src/agGrid/AgGridThemeAdapter.js +37 -6
  28. package/src/components/Radio/index.d.ts +2 -2
  29. package/src/env.js +2 -2
  30. package/src/layout-manager/src/index.d.ts +9 -0
  31. package/src/layout-manager/src/index.js +38 -17
  32. package/src/types.d.ts +1 -1
  33. package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "23.0.22",
3
+ "version": "23.1.0-canary.0",
4
4
  "description": "Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -68,7 +68,8 @@
68
68
  "uuid": "9.0.1"
69
69
  },
70
70
  "peerDependencies": {
71
- "ag-grid-enterprise": ">=35.3.0"
71
+ "ag-grid-enterprise": ">=36.1.0",
72
+ "ag-stack": ">=36.1.0"
72
73
  },
73
74
  "publishTimestamp": 0,
74
75
  "type": "module",
@@ -281,6 +281,7 @@ export interface IAdaptable {
281
281
  getAdaptableContainerElement(): HTMLElement | null;
282
282
  getAgGridContainerElement(): HTMLElement | null;
283
283
  updateColumnModelAndRefreshGrid(): void;
284
+ refreshSortIfColumnsSorted(): void;
284
285
  getAgGridColumnForColumnId(columnId: string): Column;
285
286
  getMinMaxCachedValueForColumn(column: AdaptableColumn, aggregation: 'min' | 'max' | 'avg' | 'median'): number | undefined;
286
287
  destroy(config?: DestroyConfig): void;
@@ -125,4 +125,4 @@ export interface UserColumnMenuItem {
125
125
  /**
126
126
  * Defines AG Grid Column Menu Items
127
127
  */
128
- export type AgGridColumnMenuItemType = 'sortAscending' | 'sortDescending' | 'sortUnSort' | 'columnFilter' | 'columnChooser' | 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
128
+ export type AgGridColumnMenuItemType = 'sortAscending' | 'sortDescending' | 'sortUnSort' | 'columnFilter' | 'columnChooser' | 'pinSubMenu' | 'valueAggSubMenu' | 'showValuesAsSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'calculatedColumn' | 'editCalculatedColumn' | 'removeCalculatedColumn' | 'editColumnName' | 'separator';
@@ -120,7 +120,7 @@ export interface UserContextMenuItem {
120
120
  /**
121
121
  * Defines AG Grid Context Menu Items
122
122
  */
123
- export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart' | 'separator';
123
+ export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart' | 'calculatedColumn' | 'editCalculatedColumn' | 'removeCalculatedColumn' | 'editColumnName' | 'showValuesAsSubMenu' | 'separator';
124
124
  /**
125
125
  * The Context Menu provided by AadapTable by default
126
126
  */
@@ -209,8 +209,7 @@ export interface InFilterValueResult {
209
209
  /**
210
210
  * Custom text for the collapsed IN Filter input.
211
211
  *
212
- * Receives the currently selected items (and their count) and must return a
213
- * string.
212
+ * Receives an {@link InFilterLabelContext} and must return a string.
214
213
  *
215
214
  * When omitted, the input shows the selected count (e.g. `(3)`) followed by the
216
215
  * selected labels joined with a comma. When provided, it fully replaces that
@@ -220,10 +219,27 @@ export interface InFilterValueResult {
220
219
  * is one entry in `selectedValues`: its `value` is the full leaf path and its
221
220
  * `label` the joined path label. `selectedCount` is the number of selected leaves.
222
221
  */
223
- renderInputValues?: (params: {
224
- selectedValues: InFilterValue[];
225
- selectedCount: number;
226
- }) => string;
222
+ inFilterLabel?: (context: InFilterLabelContext) => string;
223
+ }
224
+ /**
225
+ * Context passed to {@link InFilterValueResult.inFilterLabel} when customising
226
+ * the collapsed IN Filter label.
227
+ */
228
+ export interface InFilterLabelContext extends BaseContext {
229
+ /**
230
+ * Currently selected items, in selection order.
231
+ *
232
+ * For tree-shaped filters (group columns and date columns), each selected leaf
233
+ * is one entry: its `value` is the full leaf path and its `label` the joined
234
+ * path label.
235
+ */
236
+ selectedValues: InFilterValue[];
237
+ /**
238
+ * Number of selected items.
239
+ *
240
+ * For tree-shaped filters, this is the number of selected leaves (not parent nodes).
241
+ */
242
+ selectedCount: number;
227
243
  }
228
244
  /**
229
245
  * Information about items in the IN Column Filter
@@ -562,7 +562,11 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
562
562
  case StyledColumnRedux.STYLED_COLUMN_SUSPEND:
563
563
  case StyledColumnRedux.STYLED_COLUMN_UNSUSPEND:
564
564
  case StyledColumnRedux.STYLED_COLUMN_SUSPEND_ALL:
565
- case StyledColumnRedux.STYLED_COLUMN_UNSUSPEND_ALL:
565
+ case StyledColumnRedux.STYLED_COLUMN_UNSUSPEND_ALL: {
566
+ const returnAction = next(action);
567
+ adaptable.updateColumnModelAndRefreshGrid();
568
+ return returnAction;
569
+ }
566
570
  case CustomSortRedux.CUSTOM_SORT_ADD:
567
571
  case CustomSortRedux.CUSTOM_SORT_EDIT:
568
572
  case CustomSortRedux.CUSTOM_SORT_DELETE:
@@ -572,6 +576,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
572
576
  case CustomSortRedux.CUSTOM_SORT_UNSUSPEND_ALL: {
573
577
  const returnAction = next(action);
574
578
  adaptable.updateColumnModelAndRefreshGrid();
579
+ adaptable.refreshSortIfColumnsSorted();
575
580
  return returnAction;
576
581
  }
577
582
  case QuickSearchRedux.QUICK_SEARCH_RUN: {
@@ -1,4 +1,6 @@
1
1
  import type { AgSparklineOptions } from 'ag-charts-types';
2
+ /** AG Charts 14 colours may be a CSS string or a theme colour-ref object. */
3
+ export declare const cssColorToString: (color: unknown) => string | undefined;
2
4
  /**
3
5
  * AG Charts sparklines do not resolve Adaptable `var(--ab-color-*)` tokens.
4
6
  * Resolve palette / theme CSS variables to concrete colours at render time so
@@ -1,7 +1,10 @@
1
1
  import { getVariableColor } from '../StyleHelper';
2
+ export const cssColorToString = (color) => {
3
+ return typeof color === 'string' ? color : undefined;
4
+ };
2
5
  const resolveCssColor = (color) => {
3
- if (color == null || color === '') {
4
- return color;
6
+ if (typeof color !== 'string' || color === '') {
7
+ return typeof color === 'string' ? color : undefined;
5
8
  }
6
9
  const resolved = getVariableColor(color);
7
10
  return resolved || color;
@@ -11,23 +14,23 @@ const resolveHighlightStyle = (style) => {
11
14
  return style;
12
15
  }
13
16
  const resolved = { ...style };
14
- if (style.fill != null) {
17
+ if (typeof style.fill === 'string') {
15
18
  resolved.fill = resolveCssColor(style.fill);
16
19
  }
17
- if (style.stroke != null) {
20
+ if (typeof style.stroke === 'string') {
18
21
  resolved.stroke = resolveCssColor(style.stroke);
19
22
  }
20
23
  return resolved;
21
24
  };
22
25
  export function resolveSparklineOptionsForRender(options) {
23
26
  const resolved = { ...options };
24
- if ('fill' in options && options.fill != null) {
27
+ if ('fill' in options && typeof options.fill === 'string') {
25
28
  resolved.fill = resolveCssColor(options.fill);
26
29
  }
27
- if (options.stroke != null) {
30
+ if (typeof options.stroke === 'string') {
28
31
  resolved.stroke = resolveCssColor(options.stroke);
29
32
  }
30
- if (options.background?.fill != null) {
33
+ if (typeof options.background?.fill === 'string') {
31
34
  resolved.background = {
32
35
  ...options.background,
33
36
  fill: resolveCssColor(options.background.fill),
@@ -35,10 +38,10 @@ export function resolveSparklineOptionsForRender(options) {
35
38
  }
36
39
  if ('marker' in options && options.marker) {
37
40
  const marker = { ...options.marker };
38
- if (marker.fill != null) {
41
+ if (typeof marker.fill === 'string') {
39
42
  marker.fill = resolveCssColor(marker.fill);
40
43
  }
41
- if (marker.stroke != null) {
44
+ if (typeof marker.stroke === 'string') {
42
45
  marker.stroke = resolveCssColor(marker.stroke);
43
46
  }
44
47
  resolved.marker = marker;
@@ -50,7 +53,7 @@ export function resolveSparklineOptionsForRender(options) {
50
53
  highlightedSeries: resolveHighlightStyle(options.highlight.highlightedSeries),
51
54
  };
52
55
  }
53
- if (options.axis && typeof options.axis === 'object' && options.axis.stroke != null) {
56
+ if (options.axis && typeof options.axis === 'object' && typeof options.axis.stroke === 'string') {
54
57
  resolved.axis = {
55
58
  ...options.axis,
56
59
  stroke: resolveCssColor(options.axis.stroke),
@@ -1,2 +1,2 @@
1
1
  import { AdaptableOptions } from '../../types';
2
- export declare const useAdaptableOptions: <T = AdaptableOptions<any, Record<string, any>>>(fn?: (adaptableOptions: AdaptableOptions) => T) => T;
2
+ export declare const useAdaptableOptions: <T = AdaptableOptions>(fn?: (adaptableOptions: AdaptableOptions) => T) => T;
@@ -61,16 +61,16 @@ export class AnnotationsService {
61
61
  if (!target?.classList?.contains?.('ag-cell')) {
62
62
  return null;
63
63
  }
64
- try {
65
- const PrimaryKeyValue = target.parentElement.getAttribute('row-id');
66
- return {
67
- PrimaryKeyValue,
68
- ColumnId: target.getAttribute('col-id'),
69
- };
70
- }
71
- catch (e) {
64
+ const rowElement = target.closest('[row-id]');
65
+ const PrimaryKeyValue = rowElement?.getAttribute('row-id');
66
+ const ColumnId = target.getAttribute('col-id');
67
+ if (PrimaryKeyValue == null || ColumnId == null) {
72
68
  return null;
73
69
  }
70
+ return {
71
+ PrimaryKeyValue,
72
+ ColumnId,
73
+ };
74
74
  }
75
75
  handleMouseEnter(event) {
76
76
  const editMode = this.getEditMode();
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ColumnValuesSelectProps } from '../../FilterForm/ListBoxFilterForm';
3
- import { InFilterValue } from '../../../../types';
3
+ import { InFilterLabelContext } from '../../../../types';
4
4
  /** Suggested page size passed to `customInFilterValues` as `context.limit`. */
5
5
  export declare const IN_FILTER_VALUES_PAGE_SIZE = 1000;
6
6
  export interface FloatingFilterValuesProps {
@@ -32,10 +32,7 @@ export declare function useDistinctFilterColumnValues(options: {
32
32
  skipDefaultSearch: boolean;
33
33
  searchValueUsedInFilterValue: boolean;
34
34
  hasMore: boolean;
35
- renderInputValues?: (params: {
36
- selectedValues: InFilterValue[];
37
- selectedCount: number;
38
- }) => string;
35
+ inFilterLabel?: (context: InFilterLabelContext) => string;
39
36
  };
40
37
  setQuickFilterValues: React.Dispatch<React.SetStateAction<{
41
38
  values: {
@@ -46,10 +43,7 @@ export declare function useDistinctFilterColumnValues(options: {
46
43
  skipDefaultSearch: boolean;
47
44
  searchValueUsedInFilterValue: boolean;
48
45
  hasMore: boolean;
49
- renderInputValues?: (params: {
50
- selectedValues: InFilterValue[];
51
- selectedCount: number;
52
- }) => string;
46
+ inFilterLabel?: (context: InFilterLabelContext) => string;
53
47
  }>>;
54
48
  triggerValuesLoad: (options?: {
55
49
  usePrevious: boolean;
@@ -118,7 +118,7 @@ export function useDistinctFilterColumnValues(options) {
118
118
  skipDefaultSearch: !!result.skipDefaultSearch,
119
119
  searchValueUsedInFilterValue: prev.searchValueUsedInFilterValue || searchValueUsedInFilterValue,
120
120
  hasMore: !!result.hasMore,
121
- renderInputValues: result.renderInputValues,
121
+ inFilterLabel: result.inFilterLabel,
122
122
  dataLoadIsComplete: true,
123
123
  }));
124
124
  })
@@ -172,7 +172,7 @@ export function useDistinctFilterColumnValues(options) {
172
172
  skipDefaultSearch: !!distinctFilterDisplayValues.skipDefaultSearch,
173
173
  searchValueUsedInFilterValue,
174
174
  hasMore: !!distinctFilterDisplayValues.hasMore,
175
- renderInputValues: distinctFilterDisplayValues.renderInputValues,
175
+ inFilterLabel: distinctFilterDisplayValues.inFilterLabel,
176
176
  });
177
177
  lastRequestedOffsetRef.current = 0;
178
178
  setIsDistinctColumnValuesLoading(false);
@@ -337,10 +337,14 @@ export const FloatingFilterValues = (props) => {
337
337
  triggerValuesLoad();
338
338
  }
339
339
  }, []);
340
- const { skipDefaultSearch, renderInputValues } = quickFilterValues;
341
- const renderComboboxInputValues = React.useMemo(() => renderInputValues
342
- ? (items) => renderInputValues({ selectedValues: items, selectedCount: items.length })
343
- : undefined, [renderInputValues]);
340
+ const { skipDefaultSearch, inFilterLabel } = quickFilterValues;
341
+ const renderComboboxInputValues = React.useMemo(() => inFilterLabel
342
+ ? (items) => inFilterLabel({
343
+ ...api.internalApi.buildBaseContext(),
344
+ selectedValues: items,
345
+ selectedCount: items.length,
346
+ })
347
+ : undefined, [api, inFilterLabel]);
344
348
  if (props.columnId === AG_GRID_GROUPED_COLUMN) {
345
349
  if (Array.isArray(props.value) && !props.value.every((value) => Array.isArray(value))) {
346
350
  logOnce(`All the inputs for the IN predicate for the column "${props.columnId}" need to be arrays. Example:
@@ -64,10 +64,14 @@ export const PredicateEditor = (props) => {
64
64
  triggerValuesLoad();
65
65
  }
66
66
  }, []);
67
- const { skipDefaultSearch, renderInputValues } = quickFilterValues;
68
- const renderComboboxInputValues = React.useMemo(() => renderInputValues
69
- ? (items) => renderInputValues({ selectedValues: items, selectedCount: items.length })
70
- : undefined, [renderInputValues]);
67
+ const { skipDefaultSearch, inFilterLabel } = quickFilterValues;
68
+ const renderComboboxInputValues = React.useMemo(() => inFilterLabel
69
+ ? (items) => inFilterLabel({
70
+ ...adaptable.api.internalApi.buildBaseContext(),
71
+ selectedValues: items,
72
+ selectedCount: items.length,
73
+ })
74
+ : undefined, [adaptable.api, inFilterLabel]);
71
75
  return (_jsxs(Box, { className: baseClassName, children: [_jsxs(Flex, { alignItems: "center", className: "twa:justify-stretch", children: [icon && _jsx(Tag, { className: "twa:mr-2", children: icon }), _jsx(SingleSelect, { items: predicateDefsOptions, "data-name": "select-predicate", placeholder: "Select Rule", value: props.predicate?.PredicateId ?? null, onValueChange: (value) => {
72
76
  const option = predicateDefsOptions.find((x) => x.value === value);
73
77
  props.onChange({
@@ -10,6 +10,7 @@ import { ColorPicker } from '../../../components/ColorPicker';
10
10
  import { CheckBox } from '../../../components/CheckBox';
11
11
  import { Box, Flex } from '../../../components/Flex';
12
12
  import { getCellBoxStyleSummaryItems, StyledColumnCellStyleEditor, } from './StyledColumnSliceStyleEditors';
13
+ import { cssColorToString } from '../../../Utilities/Helpers/StyledColumns/SparklineStyleHelper';
13
14
  import { Card } from '../../../components/Card';
14
15
  import ErrorBox from '../../../components/ErrorBox';
15
16
  const STYLE_FORM_SIZES = ['200px', '1fr'];
@@ -193,9 +194,18 @@ const SparklineThemingOptions = ({ options, onChange, }) => {
193
194
  delete next.theme;
194
195
  onChange(next);
195
196
  };
197
+ const getPaddingOptions = () => {
198
+ const padding = sparklineOptions.padding;
199
+ if (padding == null) {
200
+ return {};
201
+ }
202
+ if (typeof padding === 'number') {
203
+ return { top: padding, right: padding, bottom: padding, left: padding };
204
+ }
205
+ return padding;
206
+ };
196
207
  const handlePaddingChange = (key, value) => {
197
- const currentPadding = sparklineOptions.padding || {};
198
- handleChange('padding', { ...currentPadding, [key]: value });
208
+ handleChange('padding', { ...getPaddingOptions(), [key]: value });
199
209
  };
200
210
  const themes = [
201
211
  { value: SPARKLINE_CUSTOM_COLOURS_THEME, label: 'Custom colours' },
@@ -212,9 +222,9 @@ const SparklineThemingOptions = ({ options, onChange, }) => {
212
222
  { value: 'ag-financial', label: 'Financial' },
213
223
  { value: 'ag-financial-dark', label: 'Financial Dark' },
214
224
  ];
215
- return (_jsxs(FormLayout, { children: [sparklineOptions.type !== 'line' && (_jsx(FormRow, { label: "Fill", children: _jsxs(Box, { children: [_jsx(ColorPicker, { title: "The colour for filling shapes", api: api, value: sparklineOptions.fill, onChange: (color) => applySeriesColour({ fill: color }) }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: "Bar, column, and area body colour." })] }) })), _jsx(FormRow, { label: "Stroke", children: _jsxs(Box, { children: [_jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the stroke", api: api, value: sparklineOptions.stroke, onChange: (color) => applySeriesColour({ stroke: color }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { title: "The width of the stroke in pixels", type: "number", className: "twa:w-[70px]", min: 0, value: sparklineOptions.strokeWidth ?? '', onChange: (e) => handleChange('strokeWidth', Number(e.target.value)) })] }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: sparklineOptions.type === 'line'
225
+ return (_jsxs(FormLayout, { children: [sparklineOptions.type !== 'line' && (_jsx(FormRow, { label: "Fill", children: _jsxs(Box, { children: [_jsx(ColorPicker, { title: "The colour for filling shapes", api: api, value: cssColorToString(sparklineOptions.fill) ?? '', onChange: (color) => applySeriesColour({ fill: color }) }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: "Bar, column, and area body colour." })] }) })), _jsx(FormRow, { label: "Stroke", children: _jsxs(Box, { children: [_jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the stroke", api: api, value: cssColorToString(sparklineOptions.stroke) ?? '', onChange: (color) => applySeriesColour({ stroke: color }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { title: "The width of the stroke in pixels", type: "number", className: "twa:w-[70px]", min: 0, value: sparklineOptions.strokeWidth ?? '', onChange: (e) => handleChange('strokeWidth', Number(e.target.value)) })] }), _jsx(Box, { className: "twa:mt-1 twa:text-1 twa:opacity-70", children: sparklineOptions.type === 'line'
216
226
  ? 'Line colour. Marker colours are in the Markers card.'
217
- : 'Outline colour — increase width to see it on bars and columns.' })] }) }), _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Top" }), _jsx(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.top ?? '', onChange: (e) => handlePaddingChange('top', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the top of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Right" }), _jsx(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.right ?? '', onChange: (e) => handlePaddingChange('right', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the right of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Bottom" }), _jsx(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.bottom ?? '', onChange: (e) => handlePaddingChange('bottom', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the bottom of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Left" }), _jsx(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.left ?? '', onChange: (e) => handlePaddingChange('left', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the left of the chart area" })] }) }), _jsx(FormRow, { label: "Line Dash", children: _jsx(AdaptableInput, { title: "Length of dashes and gaps in pixels (comma-separated values, e.g. '3,6,9')", value: sparklineOptions.lineDash?.join(',') ?? '', onChange: (e) => {
227
+ : 'Outline colour — increase width to see it on bars and columns.' })] }) }), _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Top" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().top ?? '', onChange: (e) => handlePaddingChange('top', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the top of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Right" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().right ?? '', onChange: (e) => handlePaddingChange('right', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the right of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Bottom" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().bottom ?? '', onChange: (e) => handlePaddingChange('bottom', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the bottom of the chart area" }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Left" }), _jsx(AdaptableInput, { type: "number", min: 0, value: getPaddingOptions().left ?? '', onChange: (e) => handlePaddingChange('left', Number(e.target.value)), className: "twa:w-[70px]", title: "The number of pixels of padding at the left of the chart area" })] }) }), _jsx(FormRow, { label: "Line Dash", children: _jsx(AdaptableInput, { title: "Length of dashes and gaps in pixels (comma-separated values, e.g. '3,6,9')", value: sparklineOptions.lineDash?.join(',') ?? '', onChange: (e) => {
218
228
  const value = e.target.value;
219
229
  const dashArray = value
220
230
  ? value
@@ -226,7 +236,7 @@ const SparklineThemingOptions = ({ options, onChange, }) => {
226
236
  } }) }), _jsx(FormRow, { label: "Line Dash Offset", children: _jsx(AdaptableInput, { title: "The offset of the line dash pattern in pixels", type: "number", min: 0, value: sparklineOptions.lineDashOffset ?? '', onChange: (e) => handleChange('lineDashOffset', Number(e.target.value)) }) }), _jsx(FormRow, { label: "Background", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(CheckBox, { checked: sparklineOptions.background?.visible ?? false, onChange: (visible) => handleChange('background', {
227
237
  ...sparklineOptions.background,
228
238
  visible,
229
- }) }), _jsx(Box, { className: "twa:ml-2", children: _jsx(ColorPicker, { disabled: !sparklineOptions.background?.visible, title: "The colour of the chart background", api: api, value: sparklineOptions.background?.fill, onChange: (fill) => handleChange('background', {
239
+ }) }), _jsx(Box, { className: "twa:ml-2", children: _jsx(ColorPicker, { disabled: !sparklineOptions.background?.visible, title: "The colour of the chart background", api: api, value: cssColorToString(sparklineOptions.background?.fill) ?? '', onChange: (fill) => handleChange('background', {
230
240
  ...sparklineOptions.background,
231
241
  fill,
232
242
  }) }) })] }) }), typeof sparklineOptions.theme !== 'object' && (_jsx(FormRow, { label: "Theme", children: _jsxs(Box, { children: [_jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: sparklineOptions.theme ?? SPARKLINE_CUSTOM_COLOURS_THEME, onValueChange: (themeName) => {
@@ -263,7 +273,7 @@ const SparklineAxisOptions = ({ options, onChange, }) => {
263
273
  { value: 'time', label: 'Time' },
264
274
  ];
265
275
  const isAxisEnabled = sparklineOptions.axis?.visible ?? false;
266
- return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Axis", children: _jsx(CheckBox, { checked: isAxisEnabled, onChange: (visible) => handleChange({ visible }) }) }), _jsx(FormRow, { label: "Axis Type", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isAxisEnabled, value: sparklineOptions.axis.type, onValueChange: (type) => handleChange({ type }), items: axisTypes }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isAxisEnabled, title: "The colour of the axis line", api: api, value: sparklineOptions.axis?.stroke, onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, className: "twa:w-[70px]", title: "The width in pixels of the axis line", type: "number", min: 0, value: sparklineOptions.axis?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }) })] }) }), _jsx(FormRow, { label: "Reverse Scale", children: _jsx(CheckBox, { disabled: !isAxisEnabled, checked: sparklineOptions.axis?.reverse, onChange: (reverse) => handleChange({ reverse }) }) }), sparklineOptions.axis.type === 'category' && (_jsx(_Fragment, { children: _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Inner" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The size of the gap between categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingInner ?? '', onChange: (e) => handleChange({ paddingInner: Number(e.target.value) }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Outer" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The padding on the outside of first and last categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingOuter ?? '', onChange: (e) => handleChange({ paddingOuter: Number(e.target.value) }) })] }) }) }))] }));
276
+ return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Axis", children: _jsx(CheckBox, { checked: isAxisEnabled, onChange: (visible) => handleChange({ visible }) }) }), _jsx(FormRow, { label: "Axis Type", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isAxisEnabled, value: sparklineOptions.axis.type, onValueChange: (type) => handleChange({ type }), items: axisTypes }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isAxisEnabled, title: "The colour of the axis line", api: api, value: cssColorToString(sparklineOptions.axis?.stroke) ?? '', onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, className: "twa:w-[70px]", title: "The width in pixels of the axis line", type: "number", min: 0, value: sparklineOptions.axis?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }) })] }) }), _jsx(FormRow, { label: "Reverse Scale", children: _jsx(CheckBox, { disabled: !isAxisEnabled, checked: sparklineOptions.axis?.reverse, onChange: (reverse) => handleChange({ reverse }) }) }), sparklineOptions.axis.type === 'category' && (_jsx(_Fragment, { children: _jsx(FormRow, { label: "Padding", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(Box, { className: "twa:mr-1", children: "Inner" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The size of the gap between categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingInner ?? '', onChange: (e) => handleChange({ paddingInner: Number(e.target.value) }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Outer" }), _jsx(AdaptableInput, { disabled: !isAxisEnabled, title: "The padding on the outside of first and last categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingOuter ?? '', onChange: (e) => handleChange({ paddingOuter: Number(e.target.value) }) })] }) }) }))] }));
267
277
  };
268
278
  const SparklineTooltipOptions = ({ options, onChange, }) => {
269
279
  const sparklineOptions = options;
@@ -331,7 +341,7 @@ const SparklineMarkerOptions = ({ options, onChange }) => {
331
341
  { value: 'triangle', label: 'Triangle' },
332
342
  ];
333
343
  const isMarkerEnabled = sparklineOptions.marker?.enabled ?? false;
334
- return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Markers", children: _jsx(CheckBox, { checked: isMarkerEnabled, onChange: (enabled) => handleChange({ enabled }) }) }), _jsx(FormRow, { label: "Marker Size", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(AdaptableInput, { disabled: !isMarkerEnabled, type: "number", className: "twa:w-full", min: 1, value: sparklineOptions.marker?.size ?? '', onChange: (e) => handleChange({ size: Number(e.target.value) }), title: "The size in pixels of the markers" }) }) }), _jsx(FormRow, { label: "Marker Shape", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isMarkerEnabled, value: sparklineOptions.marker?.shape, onValueChange: (shape) => handleChange({ shape: shape }), items: markerShapes }) }) }), _jsx(FormRow, { label: "Fill", children: _jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for filling markers", api: api, value: sparklineOptions.marker?.fill, onChange: (fill) => handleChange({ fill }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for the marker stroke", api: api, value: sparklineOptions.marker?.stroke, onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isMarkerEnabled, className: "twa:w-[70px]", type: "number", min: 0, value: sparklineOptions.marker?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }), title: "The width of the marker stroke in pixels" })] }) })] }));
344
+ return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Show Markers", children: _jsx(CheckBox, { checked: isMarkerEnabled, onChange: (enabled) => handleChange({ enabled }) }) }), _jsx(FormRow, { label: "Marker Size", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(AdaptableInput, { disabled: !isMarkerEnabled, type: "number", className: "twa:w-full", min: 1, value: sparklineOptions.marker?.size ?? '', onChange: (e) => handleChange({ size: Number(e.target.value) }), title: "The size in pixels of the markers" }) }) }), _jsx(FormRow, { label: "Marker Shape", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: !isMarkerEnabled, value: sparklineOptions.marker?.shape, onValueChange: (shape) => handleChange({ shape: shape }), items: markerShapes }) }) }), _jsx(FormRow, { label: "Fill", children: _jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for filling markers", api: api, value: sparklineOptions.marker?.fill, onChange: (fill) => handleChange({ fill }) }) }), _jsx(FormRow, { label: "Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for the marker stroke", api: api, value: cssColorToString(sparklineOptions.marker?.stroke) ?? '', onChange: (stroke) => handleChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { disabled: !isMarkerEnabled, className: "twa:w-[70px]", type: "number", min: 0, value: sparklineOptions.marker?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }), title: "The width of the marker stroke in pixels" })] }) })] }));
335
345
  };
336
346
  const SparklineHighlightOptions = ({ options, onChange, }) => {
337
347
  const { api } = useOnePageAdaptableWizardContext();
@@ -369,5 +379,5 @@ const SparklineHighlightOptions = ({ options, onChange, }) => {
369
379
  },
370
380
  });
371
381
  };
372
- return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Item Fill", children: _jsx(ColorPicker, { title: "The colour for filling highlighted items", api: api, value: highlightOptions?.highlightedItem?.fill, onChange: (fill) => handleItemChange({ fill }) }) }), _jsx(FormRow, { label: "Item Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the highlighted item stroke", api: api, value: highlightOptions?.highlightedItem?.stroke, onChange: (stroke) => handleItemChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedItem?.strokeWidth ?? '', onChange: (e) => handleItemChange({ strokeWidth: Number(e.target.value) }), title: "The width of the highlighted item stroke in pixels" })] }) }), _jsx(FormRow, { label: "Series", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(CheckBox, { checked: highlightOptions?.enabled ?? false, onChange: (enabled) => handleBaseChange({ enabled }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Stroke Width" }), _jsx(AdaptableInput, { disabled: !highlightOptions?.enabled, className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedSeries?.strokeWidth ?? '', onChange: (e) => handleSeriesChange({ strokeWidth: Number(e.target.value) }), title: "The stroke width when markers are hovered or tooltip is shown" })] }) })] }));
382
+ return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Item Fill", children: _jsx(ColorPicker, { title: "The colour for filling highlighted items", api: api, value: highlightOptions?.highlightedItem?.fill, onChange: (fill) => handleItemChange({ fill }) }) }), _jsx(FormRow, { label: "Item Stroke", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(ColorPicker, { title: "The colour for the highlighted item stroke", api: api, value: cssColorToString(highlightOptions?.highlightedItem?.stroke) ?? '', onChange: (stroke) => handleItemChange({ stroke }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Width" }), _jsx(AdaptableInput, { className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedItem?.strokeWidth ?? '', onChange: (e) => handleItemChange({ strokeWidth: Number(e.target.value) }), title: "The width of the highlighted item stroke in pixels" })] }) }), _jsx(FormRow, { label: "Series", children: _jsxs(Flex, { alignItems: "center", children: [_jsx(CheckBox, { checked: highlightOptions?.enabled ?? false, onChange: (enabled) => handleBaseChange({ enabled }) }), _jsx(Box, { className: "twa:ml-2 twa:mr-1", children: "Stroke Width" }), _jsx(AdaptableInput, { disabled: !highlightOptions?.enabled, className: "twa:w-[70px]", type: "number", min: 0, value: highlightOptions?.highlightedSeries?.strokeWidth ?? '', onChange: (e) => handleSeriesChange({ strokeWidth: Number(e.target.value) }), title: "The stroke width when markers are hovered or tooltip is shown" })] }) })] }));
373
383
  };
@@ -65,6 +65,6 @@ export interface OnePageAdaptableWizardProps<ENTITY> {
65
65
  */
66
66
  headerPreview?: React.ReactNode;
67
67
  }
68
- export declare const OnePageAdaptableWizard: <ENTITY extends unknown>(props: OnePageAdaptableWizardProps<ENTITY>) => React.JSX.Element;
69
- export declare const OnePageWizardSummary: <ENTITY extends unknown>() => React.JSX.Element;
68
+ export declare const OnePageAdaptableWizard: <ENTITY extends any>(props: OnePageAdaptableWizardProps<ENTITY>) => React.JSX.Element;
69
+ export declare const OnePageWizardSummary: <ENTITY extends any>() => React.JSX.Element;
70
70
  export {};
@@ -50,5 +50,5 @@ export interface OnePageWizardProps<ENTITY> {
50
50
  */
51
51
  headerPreview?: React.ReactNode;
52
52
  }
53
- export declare const OnePageWizard: <ENTITY extends unknown>(props: OnePageWizardProps<ENTITY>) => React.JSX.Element;
53
+ export declare const OnePageWizard: <ENTITY extends any>(props: OnePageWizardProps<ENTITY>) => React.JSX.Element;
54
54
  export {};
@@ -5,7 +5,7 @@ import { AdaptableApi, DestroyConfig } from '../Api/AdaptableApi';
5
5
  import { AdaptableVariant, IAdaptable, NormalizeAdaptableStateOptions } from '../AdaptableInterfaces/IAdaptable';
6
6
  import { EmitterCallback } from '../Utilities/Emitter';
7
7
  import { AdaptablePlugin } from '../AdaptableOptions/AdaptablePlugin';
8
- import { AgGridAdapter } from './AgGridAdapter';
8
+ import { AgGridAdapter, RowNodeEvent } from './AgGridAdapter';
9
9
  import { IDataService } from '../Utilities/Services/Interface/IDataService';
10
10
  import { AdaptableState } from '../AdaptableState/AdaptableState';
11
11
  import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
@@ -54,7 +54,6 @@ interface AdaptableInitInternalConfig<TData = any> {
54
54
  }
55
55
  export declare class AdaptableAgGrid implements IAdaptable {
56
56
  logger: AdaptableLogger;
57
- private _id;
58
57
  lifecycleState: AdaptableLifecycleState;
59
58
  variant: AdaptableVariant;
60
59
  private emitter;
@@ -94,7 +93,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
94
93
  ThemeService: IThemeService;
95
94
  private LicenseService;
96
95
  private ChartingService;
97
- private rowListeners;
96
+ private isListeningToAgGridRowNodeEvents;
98
97
  private debouncedSetSelectedRows;
99
98
  private debouncedSetSelectedCells;
100
99
  private agGridListenerKeydown;
@@ -131,9 +130,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
131
130
  constructor(config?: {
132
131
  getAgGridColumnApiModuleReference?: () => Module;
133
132
  });
134
- static forEachAdaptable(fn: (adaptable: AdaptableAgGrid) => void): void;
135
- private static collectInstance;
136
- private static dismissInstance;
137
133
  get isAgGridInitialising(): boolean;
138
134
  get isReady(): boolean;
139
135
  get isAvailable(): boolean;
@@ -187,6 +183,22 @@ export declare class AdaptableAgGrid implements IAdaptable {
187
183
  * Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
188
184
  */
189
185
  private initializeAgGrid;
186
+ /**
187
+ * Derives the host element of the grid (the element the framework wrapper / `createGrid()` renders
188
+ * the grid into) when `ContainerOptions.agGridContainer` is not provided.
189
+ *
190
+ * AG Grid 36+ wraps the grid in three grid-owned `div.ag-styled-root` elements which mirror the
191
+ * theme classes (`ag-theme-params-N ...`, or the host's `ag-theme-<name>` in legacy mode);
192
+ * `AgGridAdapter.getAgGridRootElement()` is the innermost one. These wrappers must be skipped:
193
+ * they are re-classed by AG Grid on every theme change, so anything AdapTable adds/removes on them
194
+ * (legacy theme switching) would be lost.
195
+ *
196
+ * Resolution order:
197
+ * 1. the closest non-`.ag-styled-root` ancestor of the grid root (the host element)
198
+ * 2. legacy theme mode only: if the host element has no `ag-theme-*` class, the closest ancestor
199
+ * which has one (AG Grid itself accepts the theme class anywhere up the tree)
200
+ */
201
+ private deriveAgGridContainerElement;
190
202
  useRowNodeLookUp(): boolean;
191
203
  private buildInitContainerContext;
192
204
  getAgGridContainerElement(): HTMLElement | null;
@@ -198,6 +210,13 @@ export declare class AdaptableAgGrid implements IAdaptable {
198
210
  private initAdaptableStore;
199
211
  private mapAdaptableStateToAgGridState;
200
212
  private addGridEventListeners;
213
+ /**
214
+ * see #local_event_service_monkey_patch (AgGridAdapter.ts)
215
+ *
216
+ * Entry point for the AG Grid RowNode `dataChanged` / `cellChanged` events, which AG Grid does not expose publicly.
217
+ * These drive Adaptable's data change detection (CellChanged events, Alerts, Flashing Cells, etc.)
218
+ */
219
+ onAgGridRowNodeEvent(event: RowNodeEvent): void;
201
220
  private shouldAutoSizeLayout;
202
221
  private autoSizeLayoutIfNeeded;
203
222
  forPlugins(callback: (plugin: AdaptablePlugin) => any): void;
@@ -232,6 +251,11 @@ export declare class AdaptableAgGrid implements IAdaptable {
232
251
  private __forceUpdateColumnModel;
233
252
  updateColumnModelAndRefreshGrid(): void;
234
253
  _updateColumnModelAndRefreshGridNow(): void;
254
+ /**
255
+ * Re-applies the current sort, eg. after a Custom Sort was added/edited/removed at runtime.
256
+ * The column comparators are already up to date (see #stable_col_def_callbacks), AG Grid just has to sort again.
257
+ */
258
+ refreshSortIfColumnsSorted(): void;
235
259
  redrawBody(): void;
236
260
  refreshHeader(): void;
237
261
  redrawRows(rowNodes?: IRowNode[]): void;