@adaptabletools/adaptable 20.0.0-canary.2 → 20.0.0-canary.20

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 (117) hide show
  1. package/base.css +1288 -898
  2. package/base.css.map +1 -1
  3. package/index.css +428 -898
  4. package/index.css.map +1 -1
  5. package/package.json +4 -4
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
  7. package/src/AdaptableOptions/CellSummaryOptions.d.ts +1 -1
  8. package/src/AdaptableOptions/ContainerOptions.d.ts +0 -7
  9. package/src/AdaptableOptions/DashboardOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/DefaultAdaptableOptions.js +2 -2
  11. package/src/AdaptableOptions/EditOptions.d.ts +14 -3
  12. package/src/AdaptableOptions/ExportOptions.d.ts +11 -20
  13. package/src/AdaptableOptions/PredicateOptions.d.ts +4 -4
  14. package/src/AdaptableOptions/QuickSearchOptions.d.ts +2 -2
  15. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +7 -0
  16. package/src/Api/ExportApi.d.ts +1 -6
  17. package/src/Api/Fdc3Api.d.ts +5 -3
  18. package/src/Api/Implementation/AdaptableApiImpl.js +1 -0
  19. package/src/Api/Implementation/ColumnFilterApiImpl.js +3 -3
  20. package/src/Api/Implementation/ExportApiImpl.d.ts +1 -2
  21. package/src/Api/Implementation/ExportApiImpl.js +17 -10
  22. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +3 -3
  23. package/src/Api/Implementation/Fdc3ApiImpl.js +4 -4
  24. package/src/Api/Implementation/LayoutHelpers.js +8 -27
  25. package/src/Api/Implementation/PredicateApiImpl.js +1 -1
  26. package/src/Api/Implementation/ScheduleApiImpl.js +1 -1
  27. package/src/Api/Implementation/StyledColumnApiImpl.js +1 -1
  28. package/src/Api/Implementation/ThemeApiImpl.js +3 -1
  29. package/src/Api/Internal/ActionColumnInternalApi.js +16 -19
  30. package/src/Api/Internal/AdaptableInternalApi.js +1 -1
  31. package/src/Api/Internal/ColumnFilterInternalApi.js +2 -2
  32. package/src/Api/Internal/ColumnInternalApi.js +1 -2
  33. package/src/Api/Internal/EventInternalApi.js +6 -1
  34. package/src/Api/Internal/ExportInternalApi.d.ts +10 -6
  35. package/src/Api/Internal/ExportInternalApi.js +105 -136
  36. package/src/Api/Internal/RowFormInternalApi.js +1 -1
  37. package/src/Api/ThemeApi.d.ts +2 -0
  38. package/src/PredefinedConfig/AlertState.d.ts +1 -1
  39. package/src/PredefinedConfig/Common/AdaptableColumnContext.d.ts +1 -1
  40. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  41. package/src/PredefinedConfig/Common/AdaptablePredicate.js +13 -29
  42. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +6 -2
  43. package/src/PredefinedConfig/ExportState.d.ts +10 -17
  44. package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
  45. package/src/PredefinedConfig/LayoutState.d.ts +17 -17
  46. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  47. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +4 -3
  48. package/src/Redux/ActionsReducers/LayoutRedux.js +3 -3
  49. package/src/Redux/Store/AdaptableStore.js +3 -3
  50. package/src/Strategy/ColumnFilterModule.js +4 -4
  51. package/src/Strategy/StyledColumnModule.js +6 -6
  52. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
  53. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -3
  54. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +13 -13
  55. package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -0
  56. package/src/Utilities/Helpers/AdaptableHelper.js +10 -0
  57. package/src/Utilities/Helpers/DateHelper.js +1 -2
  58. package/src/Utilities/Helpers/FormatHelper.js +18 -5
  59. package/src/Utilities/ObjectFactory.js +1 -0
  60. package/src/Utilities/Services/Fdc3Service.d.ts +2 -2
  61. package/src/Utilities/Services/Fdc3Service.js +7 -2
  62. package/src/Utilities/Services/ThemeService.d.ts +1 -1
  63. package/src/Utilities/Services/ThemeService.js +5 -5
  64. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +41 -0
  65. package/src/View/ColumnInfo/ColumnInfo.js +0 -1
  66. package/src/View/Comments/CommentsEditor.js +5 -2
  67. package/src/View/Comments/CommentsPopup.js +5 -2
  68. package/src/View/Components/ColumnFilter/ColumnFilter.d.ts +1 -1
  69. package/src/View/Components/ColumnFilter/ColumnFilter.js +4 -2
  70. package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -1
  71. package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
  72. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.d.ts +1 -1
  73. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +6 -2
  74. package/src/View/Components/ColumnFilter/utils.js +2 -2
  75. package/src/View/Components/FilterForm/ListBoxFilterForm.js +3 -3
  76. package/src/View/Dashboard/CustomToolbar.js +2 -2
  77. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
  78. package/src/View/Filter/FilterSummary.js +1 -1
  79. package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +6 -2
  80. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +7 -2
  81. package/src/View/Note/NotePopup.js +5 -2
  82. package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
  83. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.d.ts +2 -0
  84. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +18 -2
  85. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
  86. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +2 -1
  87. package/src/View/StatusBar/AdaptableStatusBar.js +7 -5
  88. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +3 -4
  89. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +348 -191
  90. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +2 -2
  91. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
  92. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +4 -4
  93. package/src/agGrid/AdaptableAgGrid.d.ts +4 -8
  94. package/src/agGrid/AdaptableAgGrid.js +72 -118
  95. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  96. package/src/agGrid/AgGridAdapter.js +7 -8
  97. package/src/agGrid/AgGridColumnAdapter.js +5 -10
  98. package/src/agGrid/AgGridExportAdapter.d.ts +24 -1
  99. package/src/agGrid/AgGridExportAdapter.js +24 -25
  100. package/src/agGrid/AgGridThemeAdapter.d.ts +19 -0
  101. package/src/agGrid/AgGridThemeAdapter.js +122 -0
  102. package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -1
  103. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +1 -1
  104. package/src/components/ColorPicker/ColorPicker.js +2 -2
  105. package/src/components/Datepicker/DatepickerContext.d.ts +1 -0
  106. package/src/components/Datepicker/index.d.ts +1 -0
  107. package/src/components/Datepicker/index.js +1 -1
  108. package/src/components/OverlayTrigger/useAgGridClassName.js +1 -1
  109. package/src/components/Select/Select.d.ts +1 -0
  110. package/src/components/Select/Select.js +30 -7
  111. package/src/env.js +2 -2
  112. package/src/metamodel/adaptable.metamodel.d.ts +23 -15
  113. package/src/metamodel/adaptable.metamodel.js +1 -1
  114. package/src/migration/VersionUpgrade20.d.ts +3 -0
  115. package/src/migration/VersionUpgrade20.js +140 -12
  116. package/src/types.d.ts +3 -3
  117. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -29,6 +29,9 @@ export class AgGridExportAdapter {
29
29
  get exportOptions() {
30
30
  return this._adaptableInstance.api.optionsApi.getExportOptions();
31
31
  }
32
+ get logger() {
33
+ return this._adaptableInstance.logger;
34
+ }
32
35
  static getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass) {
33
36
  let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
34
37
  if (excelClassName.indexOf(' ') > 0) {
@@ -57,14 +60,12 @@ export class AgGridExportAdapter {
57
60
  await waitForTimeout(16);
58
61
  }
59
62
  this.adaptableApi.exportApi.internalApi.setExportInProgress(config.report.Name, config.format, config.destination);
60
- const exportContext = this.buildExportProcessContext(config);
63
+ const { exportContext, exportParams } = this.buildExportProcessData(config);
61
64
  if (exportContext.isVisualExcelReport) {
62
65
  // FIXME AFL patch styles only for exported columns!
63
66
  // or even better, only cells
64
67
  this.patchExcelStyles();
65
68
  }
66
- const exportParams = this.buildExportParams(exportContext);
67
- exportContext.exportedColumnIds = exportParams.columnKeys;
68
69
  // 1. easiest case, we download the file using AG Grid
69
70
  // these methods will automatically handle the file download
70
71
  if (exportContext.destination === 'Download' && exportContext.isExcelReport) {
@@ -98,8 +99,7 @@ export class AgGridExportAdapter {
98
99
  };
99
100
  }
100
101
  catch (error) {
101
- // FIXME AFL improve logging
102
- console.error(error);
102
+ this.logger.consoleError(`Error exporting ${report.Name} in ${format} format to ${config.destination}`, error);
103
103
  }
104
104
  finally {
105
105
  /**
@@ -114,6 +114,21 @@ export class AgGridExportAdapter {
114
114
  }
115
115
  }
116
116
  }
117
+ /**
118
+ * Creates export context and parameters for a given export configuration
119
+ */
120
+ buildExportProcessData(config) {
121
+ const exportContext = this.buildExportProcessContext(config);
122
+ if (exportContext.isVisualExcelReport) {
123
+ this.patchExcelStyles();
124
+ }
125
+ const exportParams = this.buildExportParams(exportContext);
126
+ exportContext.exportedColumnIds = exportParams.columnKeys;
127
+ return {
128
+ exportContext,
129
+ exportParams,
130
+ };
131
+ }
117
132
  buildExportParams(exportContext) {
118
133
  const baseExportParams = this.buildBaseExportParams(exportContext);
119
134
  if (exportContext.format === 'Excel' || exportContext.format === 'VisualExcel') {
@@ -652,9 +667,9 @@ export class AgGridExportAdapter {
652
667
  .map((columnId) => this.adaptableApi.columnApi.getColumnWithColumnId(columnId))
653
668
  .map((column) => ({
654
669
  columnId: column.columnId,
670
+ field: column.field ?? column.columnId,
655
671
  friendlyName: column.friendlyName,
656
672
  dataType: column.dataType,
657
- field: column.field ?? column.columnId,
658
673
  }));
659
674
  const reportData = {
660
675
  columns,
@@ -726,27 +741,11 @@ export class AgGridExportAdapter {
726
741
  masterRowNode: node,
727
742
  masterRowData: node?.data,
728
743
  isExpanded: node.expanded,
729
- createCellCsv: (cellContent) => {
730
- return {
731
- data: {
732
- value: cellContent != undefined ? String(cellContent) : null,
733
- },
734
- };
735
- },
736
- createCellExcel: (cellContent, cellType) => {
737
- return {
738
- data: {
739
- value: cellContent != undefined ? String(cellContent) : null,
740
- type: cellType,
741
- },
742
- };
743
- },
744
+ createCellCsv: (cellContent) => this.adaptableApi.exportApi.internalApi.createCellCsv(cellContent),
745
+ createCellExcel: (cellContent, cellType) => this.adaptableApi.exportApi.internalApi.createCellExcel(cellContent, cellType),
744
746
  createCellHeader: (cellContent) => {
745
747
  return {
746
- data: {
747
- value: cellContent != undefined ? String(cellContent) : null,
748
- type: 'String',
749
- },
748
+ ...this.adaptableApi.exportApi.internalApi.createCellHeader(cellContent),
750
749
  // see #masterDetailHeader
751
750
  styleId: '_masterDetailHeader',
752
751
  };
@@ -0,0 +1,19 @@
1
+ import { AdaptableAgGrid } from './AdaptableAgGrid';
2
+ import { AgGridThemeMode } from './AgGridAdapter';
3
+ import { AdaptableTheme } from '../PredefinedConfig/ThemeState';
4
+ export declare class AgGridThemeAdapter {
5
+ private _adaptableInstance;
6
+ private agGridThemeMode;
7
+ constructor(_adaptableInstance: AdaptableAgGrid);
8
+ destroy(): void;
9
+ get logger(): import("./AdaptableLogger").AdaptableLogger;
10
+ get api(): import("../types").AdaptableApi;
11
+ setAgGridThemeMode(themeMode: AgGridThemeMode): void;
12
+ getAgGridThemeMode(): AgGridThemeMode;
13
+ applyAgGridThemeOnAdaptableThemeChange(adaptableTheme: AdaptableTheme, variantTheme: string, agGridContainer: HTMLElement, themesToRemove: AdaptableTheme[]): void;
14
+ private getAgGridContainerElement;
15
+ private legacy_applyAgGridThemeOnAdaptableThemeChange;
16
+ getAgGridCurrentThemeClassNames(): string;
17
+ private getAgGridLightThemeName;
18
+ private legacy_getAgGridCurrentThemeClassNames;
19
+ }
@@ -0,0 +1,122 @@
1
+ import { DARK_THEME, LIGHT_THEME } from '../Utilities/Constants/GeneralConstants';
2
+ export class AgGridThemeAdapter {
3
+ constructor(_adaptableInstance) {
4
+ this._adaptableInstance = _adaptableInstance;
5
+ }
6
+ destroy() { }
7
+ get logger() {
8
+ return this._adaptableInstance.logger;
9
+ }
10
+ get api() {
11
+ return this._adaptableInstance.api;
12
+ }
13
+ setAgGridThemeMode(themeMode) {
14
+ this.agGridThemeMode = themeMode;
15
+ }
16
+ getAgGridThemeMode() {
17
+ return this.agGridThemeMode;
18
+ }
19
+ applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
20
+ if (this.agGridThemeMode === 'legacy') {
21
+ this.legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove);
22
+ }
23
+ const themeName = adaptableTheme.Name;
24
+ const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
25
+ if (adaptableTheme && (isSystemTheme || variantTheme)) {
26
+ if ((variantTheme || themeName) === LIGHT_THEME) {
27
+ document.body.dataset.agThemeMode = 'light';
28
+ }
29
+ if ((variantTheme || themeName) === DARK_THEME) {
30
+ document.body.dataset.agThemeMode = 'dark';
31
+ }
32
+ }
33
+ }
34
+ getAgGridContainerElement() {
35
+ return this._adaptableInstance.getAgGridContainerElement();
36
+ }
37
+ legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
38
+ const themeName = adaptableTheme.Name;
39
+ const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
40
+ const getAgGridLightThemeName = () => this.getAgGridLightThemeName();
41
+ const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
42
+ if (adaptableTheme && (isSystemTheme || variantTheme)) {
43
+ if ((variantTheme || themeName) === LIGHT_THEME) {
44
+ adaptableTheme.AgGridClassName =
45
+ adaptableTheme.AgGridClassName || getAgGridLightThemeName();
46
+ }
47
+ if ((variantTheme || themeName) === DARK_THEME) {
48
+ adaptableTheme.AgGridClassName = adaptableTheme.AgGridClassName || getAgGridDarkThemeName();
49
+ }
50
+ }
51
+ if (!adaptableTheme.AgGridClassName) {
52
+ // default AG Grid to its light theme
53
+ adaptableTheme.AgGridClassName = getAgGridLightThemeName();
54
+ }
55
+ if (agGridContainer != null) {
56
+ if (themesToRemove.length) {
57
+ themesToRemove.forEach((theme) => {
58
+ if (theme.AgGridClassName) {
59
+ agGridContainer.classList.remove(theme.AgGridClassName);
60
+ }
61
+ });
62
+ }
63
+ // also remove all AG Grid theme class names
64
+ const agGridClassNamesToRemove = [];
65
+ agGridContainer.classList.forEach((x) => {
66
+ if (x && x.indexOf('ag-theme-') === 0) {
67
+ agGridClassNamesToRemove.push(x);
68
+ }
69
+ });
70
+ agGridClassNamesToRemove.forEach((x) => agGridContainer.classList.remove(x));
71
+ if (adaptableTheme && adaptableTheme.AgGridClassName) {
72
+ agGridContainer.classList.add(adaptableTheme.AgGridClassName);
73
+ }
74
+ }
75
+ }
76
+ getAgGridCurrentThemeClassNames() {
77
+ if (this.agGridThemeMode === 'legacy') {
78
+ this.legacy_getAgGridCurrentThemeClassNames();
79
+ }
80
+ const currentAgGridTheme = this._adaptableInstance.agGridAdapter.getGridOption('theme');
81
+ if (currentAgGridTheme === 'legacy') {
82
+ return this.legacy_getAgGridCurrentThemeClassNames();
83
+ }
84
+ // @ts-ignore no other way than to use internals
85
+ const currentAgGridTheme__cssClassCache = currentAgGridTheme?._cssClassCache;
86
+ return currentAgGridTheme__cssClassCache ?? '';
87
+ }
88
+ getAgGridLightThemeName() {
89
+ const container = this.getAgGridContainerElement();
90
+ if (container && container.classList) {
91
+ // we detect the ag theme class
92
+ const classList = container.classList;
93
+ for (let i = 0, len = classList.length; i < len; i++) {
94
+ const cls = classList[i];
95
+ if (cls.indexOf('ag-theme-') === 0) {
96
+ // even if dark theme is included, we compute the light theme name out of it
97
+ return cls.replace('-dark', '');
98
+ }
99
+ }
100
+ }
101
+ else {
102
+ this.logger.warn('No AgGrid container found, defaulting to ag-theme-balham for the light theme');
103
+ }
104
+ this.logger.warn('No ag-theme- class found on the grid container, defaulting to ag-theme-balham');
105
+ // fallback to the default light theme
106
+ return 'ag-theme-balham';
107
+ }
108
+ legacy_getAgGridCurrentThemeClassNames() {
109
+ const container = this.getAgGridContainerElement();
110
+ if (container && container.classList) {
111
+ // we detect the ag theme class
112
+ const classList = container.classList;
113
+ for (let i = 0, len = classList.length; i < len; i++) {
114
+ const cls = classList[i];
115
+ if (cls.indexOf('ag-theme-') === 0) {
116
+ return cls;
117
+ }
118
+ }
119
+ }
120
+ return this.getAgGridLightThemeName();
121
+ }
122
+ }
@@ -35,7 +35,8 @@ export const getBadgeRendererForColumn = (badgeStyle, abColumn, api) => {
35
35
  this.eGui.innerHTML = formattedValue;
36
36
  return;
37
37
  }
38
- if (['NumberArray', 'StringArray'].includes(abColumn.dataType)) {
38
+ const arrayTypes = ['numberArray', 'textArray'];
39
+ if (arrayTypes.includes(abColumn.dataType)) {
39
40
  this.renderArrayValues(params, adaptableApi);
40
41
  }
41
42
  else {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import parseISO from 'date-fns/parseISO';
2
+ import { parseISO } from 'date-fns';
3
3
  import useProperty from '../../../components/utils/useProperty';
4
4
  import AdaptableInput from '../../../View/Components/AdaptableInput';
5
5
  import { DatepickerContext } from '../../../components/Datepicker/DatepickerContext';
@@ -31,11 +31,11 @@ export const ColorPicker = React.forwardRef((props, ref) => {
31
31
  }, value: preparedValue, ref: ref, type: "color", style: {
32
32
  width: 70,
33
33
  padding: 0 /* we need this to be 0, since otherwise on Windows browsers, the chosen color cannot be seen */,
34
- }, list: "ABcolorChoices" }),
34
+ }, list: "ABcolorChoices", title: props.title }),
35
35
  ABcolorChoices,
36
36
  includeAlpha && (React.createElement(Flex, { alignItems: "center" },
37
37
  React.createElement(Box, { mr: 1 }, "Opacity"),
38
- React.createElement(Input, { className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
38
+ React.createElement(Input, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
39
39
  const color = tinycolor(value).setAlpha(event.target.value).toRgbString();
40
40
  props.onChange(color);
41
41
  }, min: 0, max: 1, step: 0.01, type: "range" })))));
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { Locale } from 'date-fns';
2
3
  export declare const DatepickerContext: React.Context<{
3
4
  onHide?: (keyboardEventKey?: string) => void;
4
5
  onShow?: VoidFunction;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { BoxProps } from 'rebass';
3
3
  import { DatepickerButton } from '../../AdaptableOptions/DateInputOptions';
4
+ import { Locale } from 'date-fns';
4
5
  export type DatepickerProps = Omit<BoxProps, 'value' | 'onChange' | 'defaultValue'> & {
5
6
  value: Date | undefined;
6
7
  defaultValue?: Date | undefined;
@@ -9,7 +9,7 @@ import { DateFormatter } from '../../Utilities/Helpers/FormatHelper';
9
9
  import { useDatepickerContext } from './DatepickerContext';
10
10
  import { DayPicker } from 'react-day-picker';
11
11
  import { AdaptableDateInlineInput } from '../../View/Components/AdaptableInput/AdaptableDateInlineInput';
12
- import { isValid, addYears, endOfYear, startOfYear, addDays, addBusinessDays } from 'date-fns';
12
+ import { isValid, addYears, endOfYear, startOfYear, addDays, addBusinessDays, } from 'date-fns';
13
13
  const DatepickerOverlay = ({ onHide, children, onKeyDown, onMouseDown, }) => {
14
14
  const domRef = React.useRef(null);
15
15
  return (React.createElement("div", { className: "ab-Datepicker-Overlay", ref: domRef, onKeyDown: onKeyDown, onMouseDown: onMouseDown, onBlur: (e) => {
@@ -4,7 +4,7 @@ const useAgGridClassName = (deps = []) => {
4
4
  const adaptable = useAdaptable();
5
5
  return useMemo(() => {
6
6
  if (adaptable) {
7
- return adaptable.getAgGridCurrentThemeName();
7
+ return adaptable.agGridThemeAdapter.getAgGridCurrentThemeClassNames();
8
8
  }
9
9
  return '';
10
10
  }, deps);
@@ -17,6 +17,7 @@ export type SelectProps<SelectValue extends unknown, IsMulti extends boolean = f
17
17
  isClearable?: boolean;
18
18
  closeMenuOnSelect?: boolean;
19
19
  hideSelectedOptions?: boolean;
20
+ showHeaderSelectionCheckbox?: boolean;
20
21
  isMulti?: IsMulti;
21
22
  onChange: (value: IsMulti extends true ? SelectValue[] : SelectValue) => void;
22
23
  value: IsMulti extends true ? SelectValue[] : SelectValue;
@@ -27,9 +27,17 @@ const INFINITE_COLUMNS_WITH_CHECKBOX = {
27
27
  style: {
28
28
  lineHeight: '30px',
29
29
  },
30
+ resizable: false,
31
+ defaultSortable: false,
30
32
  renderSelectionCheckBox: ({ renderBag }) => {
31
33
  return (React.createElement(Box, { display: 'inline-block', style: checkboxStyle }, renderBag.selectionCheckBox));
32
34
  },
35
+ renderHeader: (headerParams) => {
36
+ return (React.createElement(React.Fragment, null,
37
+ headerParams.renderBag.selectionCheckBox,
38
+ headerParams.allRowsSelected ? '(Deselect All)' : '(Select All)'));
39
+ },
40
+ renderMenuIcon: false,
33
41
  },
34
42
  };
35
43
  const INFINITE_COLUMNS_WITH_RADIO = {
@@ -87,6 +95,7 @@ export const Select = function (props) {
87
95
  };
88
96
  const renderMultipleValues = props.renderMultipleValues;
89
97
  const isMulti = props.isMulti ?? Array.isArray(props.value);
98
+ const showHeaderSelectionCheckbox = isMulti && (props.showHeaderSelectionCheckbox ?? false);
90
99
  let selectedOption = null;
91
100
  if (isMulti) {
92
101
  selectedOption =
@@ -212,10 +221,24 @@ export const Select = function (props) {
212
221
  }
213
222
  : selectedRows[0];
214
223
  }, [selectedRows, isMulti]);
215
- const onRowSelectionChange = React.useCallback(({ selectedRows }) => {
216
- const selection = selectedRows.map((row) => {
217
- return { value: row };
218
- });
224
+ const onRowSelectionChange = React.useCallback((selectionParams) => {
225
+ let selection = [];
226
+ const { selectedRows, defaultSelection, deselectedRows } = selectionParams;
227
+ if (defaultSelection === true && deselectedRows.length === 0) {
228
+ // all selected
229
+ selection = options.map((option) => {
230
+ return { value: option.value };
231
+ });
232
+ }
233
+ else if (defaultSelection === false && selectedRows.length === 0) {
234
+ // none selected
235
+ selection = [];
236
+ }
237
+ else {
238
+ selection = selectedRows.map((row) => {
239
+ return { value: row };
240
+ });
241
+ }
219
242
  //@ts-ignore
220
243
  setValue(selection, 'select-option');
221
244
  }, [setValue]);
@@ -239,9 +262,9 @@ export const Select = function (props) {
239
262
  data: props.options, primaryKey: "value", selectionMode: isMulti ? 'multi-row' : 'single-row',
240
263
  // @ts-ignore
241
264
  onRowSelectionChange: isLoading ? null : isMulti ? onRowSelectionChange : onSingleRowSelectionChange, rowSelection: rowSelection, filterFunction: filterFunction, isRowDisabled: isRowDisabled },
242
- React.createElement(InfiniteTable, { header: false, rowClassName: rowClassName, showZebraRows: false, onCellClick: isLoading ? null : onCellClick, keyboardNavigation: isLoading ? false : 'row', activeRowIndex: focusedOptionIndex, keyboardSelection: true, rowHeight: ROW_HEIGHT, columns: isMulti ? INFINITE_COLUMNS_WITH_CHECKBOX : INFINITE_COLUMNS_WITH_RADIO, domProps: INFINITE_DOM_PROPS })));
265
+ React.createElement(InfiniteTable, { header: isMulti && showHeaderSelectionCheckbox ? true : false, rowClassName: rowClassName, showZebraRows: false, onCellClick: isLoading ? null : onCellClick, keyboardNavigation: isLoading ? false : 'row', activeRowIndex: focusedOptionIndex, keyboardSelection: true, rowHeight: ROW_HEIGHT, columns: isMulti ? INFINITE_COLUMNS_WITH_CHECKBOX : INFINITE_COLUMNS_WITH_RADIO, domProps: INFINITE_DOM_PROPS })));
243
266
  };
244
- }, [isMulti]);
267
+ }, [isMulti, showHeaderSelectionCheckbox]);
245
268
  const DropdownIndicator = React.useMemo(() => {
246
269
  return (props) => {
247
270
  return (React.createElement(components.DropdownIndicator, { ...props },
@@ -312,7 +335,7 @@ export const Select = function (props) {
312
335
  zIndex: 999999,
313
336
  boxShadow: 'var(--ab-cmp-select-menu__box-shadow)',
314
337
  minWidth: `var(--ab-cmp-select-menu__min-width)`,
315
- '--ab-cmp-select-menu__min-height': `min(${(props.options || []).length * ROW_HEIGHT}px, 20rem)`,
338
+ '--ab-cmp-select-menu__min-height': `min(${((props.options || []).length + (showHeaderSelectionCheckbox ? 1 : 0)) * ROW_HEIGHT}px, 20rem)`,
316
339
  ...commonStyles(state),
317
340
  ...props.menuStyle,
318
341
  };
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
3
- PUBLISH_TIMESTAMP: 1740401859424 || Date.now(),
4
- VERSION: "20.0.0-canary.2" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1742294870281 || Date.now(),
4
+ VERSION: "20.0.0-canary.20" || '--current-version--',
5
5
  };
@@ -1856,12 +1856,14 @@ export declare const ADAPTABLE_METAMODEL: {
1856
1856
  desc: string;
1857
1857
  isOpt?: undefined;
1858
1858
  defVal?: undefined;
1859
+ ref?: undefined;
1859
1860
  } | {
1860
1861
  name: string;
1861
1862
  kind: string;
1862
1863
  desc: string;
1863
1864
  isOpt: boolean;
1864
1865
  defVal: string;
1866
+ ref: string;
1865
1867
  })[];
1866
1868
  };
1867
1869
  ColumnFilterDef: {
@@ -2289,6 +2291,22 @@ export declare const ADAPTABLE_METAMODEL: {
2289
2291
  ref?: undefined;
2290
2292
  })[];
2291
2293
  };
2294
+ CustomEditColumnValueInfo: {
2295
+ name: string;
2296
+ kind: string;
2297
+ desc: string;
2298
+ props: ({
2299
+ name: string;
2300
+ kind: string;
2301
+ desc: string;
2302
+ isOpt: boolean;
2303
+ } | {
2304
+ name: string;
2305
+ kind: string;
2306
+ desc: string;
2307
+ isOpt?: undefined;
2308
+ })[];
2309
+ };
2292
2310
  CustomEditColumnValuesContext: {
2293
2311
  name: string;
2294
2312
  kind: string;
@@ -2721,16 +2739,6 @@ export declare const ADAPTABLE_METAMODEL: {
2721
2739
  kind: string;
2722
2740
  desc: string;
2723
2741
  };
2724
- DataFormatTypeContext: {
2725
- name: string;
2726
- kind: string;
2727
- desc: string;
2728
- props: {
2729
- name: string;
2730
- kind: string;
2731
- desc: string;
2732
- }[];
2733
- };
2734
2742
  DataImportFileHandler: {
2735
2743
  name: string;
2736
2744
  kind: string;
@@ -2967,11 +2975,6 @@ export declare const ADAPTABLE_METAMODEL: {
2967
2975
  ref: string;
2968
2976
  })[];
2969
2977
  };
2970
- ExportableColumnContext: {
2971
- name: string;
2972
- kind: string;
2973
- desc: string;
2974
- };
2975
2978
  ExportFormContext: {
2976
2979
  name: string;
2977
2980
  kind: string;
@@ -4465,6 +4468,11 @@ export declare const ADAPTABLE_METAMODEL: {
4465
4468
  gridInfo?: undefined;
4466
4469
  })[];
4467
4470
  };
4471
+ PredicatesOperator: {
4472
+ name: string;
4473
+ kind: string;
4474
+ desc: string;
4475
+ };
4468
4476
  PreProcessExportContext: {
4469
4477
  name: string;
4470
4478
  kind: string;