@adaptabletools/adaptable-cjs 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 (116) 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 +32 -48
  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 +2 -2
  50. package/src/Strategy/ColumnFilterModule.js +4 -4
  51. package/src/Strategy/StyledColumnModule.js +6 -6
  52. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +5 -6
  53. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +9 -10
  54. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +27 -27
  55. package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -0
  56. package/src/Utilities/Helpers/AdaptableHelper.js +12 -1
  57. package/src/Utilities/Helpers/DateHelper.js +3 -5
  58. package/src/Utilities/Helpers/FormatHelper.js +19 -6
  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 +71 -117
  95. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  96. package/src/agGrid/AgGridAdapter.js +5 -6
  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 +126 -0
  102. package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -1
  103. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +2 -2
  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/OverlayTrigger/useAgGridClassName.js +1 -1
  108. package/src/components/Select/Select.d.ts +1 -0
  109. package/src/components/Select/Select.js +30 -7
  110. package/src/env.js +2 -2
  111. package/src/metamodel/adaptable.metamodel.d.ts +23 -15
  112. package/src/metamodel/adaptable.metamodel.js +1 -1
  113. package/src/migration/VersionUpgrade20.d.ts +3 -0
  114. package/src/migration/VersionUpgrade20.js +141 -12
  115. package/src/types.d.ts +3 -3
  116. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -33,6 +33,9 @@ class AgGridExportAdapter {
33
33
  get exportOptions() {
34
34
  return this._adaptableInstance.api.optionsApi.getExportOptions();
35
35
  }
36
+ get logger() {
37
+ return this._adaptableInstance.logger;
38
+ }
36
39
  static getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass) {
37
40
  let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
38
41
  if (excelClassName.indexOf(' ') > 0) {
@@ -61,14 +64,12 @@ class AgGridExportAdapter {
61
64
  await (0, waitForTimeout_1.waitForTimeout)(16);
62
65
  }
63
66
  this.adaptableApi.exportApi.internalApi.setExportInProgress(config.report.Name, config.format, config.destination);
64
- const exportContext = this.buildExportProcessContext(config);
67
+ const { exportContext, exportParams } = this.buildExportProcessData(config);
65
68
  if (exportContext.isVisualExcelReport) {
66
69
  // FIXME AFL patch styles only for exported columns!
67
70
  // or even better, only cells
68
71
  this.patchExcelStyles();
69
72
  }
70
- const exportParams = this.buildExportParams(exportContext);
71
- exportContext.exportedColumnIds = exportParams.columnKeys;
72
73
  // 1. easiest case, we download the file using AG Grid
73
74
  // these methods will automatically handle the file download
74
75
  if (exportContext.destination === 'Download' && exportContext.isExcelReport) {
@@ -102,8 +103,7 @@ class AgGridExportAdapter {
102
103
  };
103
104
  }
104
105
  catch (error) {
105
- // FIXME AFL improve logging
106
- console.error(error);
106
+ this.logger.consoleError(`Error exporting ${report.Name} in ${format} format to ${config.destination}`, error);
107
107
  }
108
108
  finally {
109
109
  /**
@@ -118,6 +118,21 @@ class AgGridExportAdapter {
118
118
  }
119
119
  }
120
120
  }
121
+ /**
122
+ * Creates export context and parameters for a given export configuration
123
+ */
124
+ buildExportProcessData(config) {
125
+ const exportContext = this.buildExportProcessContext(config);
126
+ if (exportContext.isVisualExcelReport) {
127
+ this.patchExcelStyles();
128
+ }
129
+ const exportParams = this.buildExportParams(exportContext);
130
+ exportContext.exportedColumnIds = exportParams.columnKeys;
131
+ return {
132
+ exportContext,
133
+ exportParams,
134
+ };
135
+ }
121
136
  buildExportParams(exportContext) {
122
137
  const baseExportParams = this.buildBaseExportParams(exportContext);
123
138
  if (exportContext.format === 'Excel' || exportContext.format === 'VisualExcel') {
@@ -656,9 +671,9 @@ class AgGridExportAdapter {
656
671
  .map((columnId) => this.adaptableApi.columnApi.getColumnWithColumnId(columnId))
657
672
  .map((column) => ({
658
673
  columnId: column.columnId,
674
+ field: column.field ?? column.columnId,
659
675
  friendlyName: column.friendlyName,
660
676
  dataType: column.dataType,
661
- field: column.field ?? column.columnId,
662
677
  }));
663
678
  const reportData = {
664
679
  columns,
@@ -730,27 +745,11 @@ class AgGridExportAdapter {
730
745
  masterRowNode: node,
731
746
  masterRowData: node?.data,
732
747
  isExpanded: node.expanded,
733
- createCellCsv: (cellContent) => {
734
- return {
735
- data: {
736
- value: cellContent != undefined ? String(cellContent) : null,
737
- },
738
- };
739
- },
740
- createCellExcel: (cellContent, cellType) => {
741
- return {
742
- data: {
743
- value: cellContent != undefined ? String(cellContent) : null,
744
- type: cellType,
745
- },
746
- };
747
- },
748
+ createCellCsv: (cellContent) => this.adaptableApi.exportApi.internalApi.createCellCsv(cellContent),
749
+ createCellExcel: (cellContent, cellType) => this.adaptableApi.exportApi.internalApi.createCellExcel(cellContent, cellType),
748
750
  createCellHeader: (cellContent) => {
749
751
  return {
750
- data: {
751
- value: cellContent != undefined ? String(cellContent) : null,
752
- type: 'String',
753
- },
752
+ ...this.adaptableApi.exportApi.internalApi.createCellHeader(cellContent),
754
753
  // see #masterDetailHeader
755
754
  styleId: '_masterDetailHeader',
756
755
  };
@@ -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,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgGridThemeAdapter = void 0;
4
+ const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
5
+ class AgGridThemeAdapter {
6
+ constructor(_adaptableInstance) {
7
+ this._adaptableInstance = _adaptableInstance;
8
+ }
9
+ destroy() { }
10
+ get logger() {
11
+ return this._adaptableInstance.logger;
12
+ }
13
+ get api() {
14
+ return this._adaptableInstance.api;
15
+ }
16
+ setAgGridThemeMode(themeMode) {
17
+ this.agGridThemeMode = themeMode;
18
+ }
19
+ getAgGridThemeMode() {
20
+ return this.agGridThemeMode;
21
+ }
22
+ applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
23
+ if (this.agGridThemeMode === 'legacy') {
24
+ this.legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove);
25
+ }
26
+ const themeName = adaptableTheme.Name;
27
+ const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
28
+ if (adaptableTheme && (isSystemTheme || variantTheme)) {
29
+ if ((variantTheme || themeName) === GeneralConstants_1.LIGHT_THEME) {
30
+ document.body.dataset.agThemeMode = 'light';
31
+ }
32
+ if ((variantTheme || themeName) === GeneralConstants_1.DARK_THEME) {
33
+ document.body.dataset.agThemeMode = 'dark';
34
+ }
35
+ }
36
+ }
37
+ getAgGridContainerElement() {
38
+ return this._adaptableInstance.getAgGridContainerElement();
39
+ }
40
+ legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
41
+ const themeName = adaptableTheme.Name;
42
+ const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
43
+ const getAgGridLightThemeName = () => this.getAgGridLightThemeName();
44
+ const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
45
+ if (adaptableTheme && (isSystemTheme || variantTheme)) {
46
+ if ((variantTheme || themeName) === GeneralConstants_1.LIGHT_THEME) {
47
+ adaptableTheme.AgGridClassName =
48
+ adaptableTheme.AgGridClassName || getAgGridLightThemeName();
49
+ }
50
+ if ((variantTheme || themeName) === GeneralConstants_1.DARK_THEME) {
51
+ adaptableTheme.AgGridClassName = adaptableTheme.AgGridClassName || getAgGridDarkThemeName();
52
+ }
53
+ }
54
+ if (!adaptableTheme.AgGridClassName) {
55
+ // default AG Grid to its light theme
56
+ adaptableTheme.AgGridClassName = getAgGridLightThemeName();
57
+ }
58
+ if (agGridContainer != null) {
59
+ if (themesToRemove.length) {
60
+ themesToRemove.forEach((theme) => {
61
+ if (theme.AgGridClassName) {
62
+ agGridContainer.classList.remove(theme.AgGridClassName);
63
+ }
64
+ });
65
+ }
66
+ // also remove all AG Grid theme class names
67
+ const agGridClassNamesToRemove = [];
68
+ agGridContainer.classList.forEach((x) => {
69
+ if (x && x.indexOf('ag-theme-') === 0) {
70
+ agGridClassNamesToRemove.push(x);
71
+ }
72
+ });
73
+ agGridClassNamesToRemove.forEach((x) => agGridContainer.classList.remove(x));
74
+ if (adaptableTheme && adaptableTheme.AgGridClassName) {
75
+ agGridContainer.classList.add(adaptableTheme.AgGridClassName);
76
+ }
77
+ }
78
+ }
79
+ getAgGridCurrentThemeClassNames() {
80
+ if (this.agGridThemeMode === 'legacy') {
81
+ this.legacy_getAgGridCurrentThemeClassNames();
82
+ }
83
+ const currentAgGridTheme = this._adaptableInstance.agGridAdapter.getGridOption('theme');
84
+ if (currentAgGridTheme === 'legacy') {
85
+ return this.legacy_getAgGridCurrentThemeClassNames();
86
+ }
87
+ // @ts-ignore no other way than to use internals
88
+ const currentAgGridTheme__cssClassCache = currentAgGridTheme?._cssClassCache;
89
+ return currentAgGridTheme__cssClassCache ?? '';
90
+ }
91
+ getAgGridLightThemeName() {
92
+ const container = this.getAgGridContainerElement();
93
+ if (container && container.classList) {
94
+ // we detect the ag theme class
95
+ const classList = container.classList;
96
+ for (let i = 0, len = classList.length; i < len; i++) {
97
+ const cls = classList[i];
98
+ if (cls.indexOf('ag-theme-') === 0) {
99
+ // even if dark theme is included, we compute the light theme name out of it
100
+ return cls.replace('-dark', '');
101
+ }
102
+ }
103
+ }
104
+ else {
105
+ this.logger.warn('No AgGrid container found, defaulting to ag-theme-balham for the light theme');
106
+ }
107
+ this.logger.warn('No ag-theme- class found on the grid container, defaulting to ag-theme-balham');
108
+ // fallback to the default light theme
109
+ return 'ag-theme-balham';
110
+ }
111
+ legacy_getAgGridCurrentThemeClassNames() {
112
+ const container = this.getAgGridContainerElement();
113
+ if (container && container.classList) {
114
+ // we detect the ag theme class
115
+ const classList = container.classList;
116
+ for (let i = 0, len = classList.length; i < len; i++) {
117
+ const cls = classList[i];
118
+ if (cls.indexOf('ag-theme-') === 0) {
119
+ return cls;
120
+ }
121
+ }
122
+ }
123
+ return this.getAgGridLightThemeName();
124
+ }
125
+ }
126
+ exports.AgGridThemeAdapter = AgGridThemeAdapter;
@@ -39,7 +39,8 @@ const getBadgeRendererForColumn = (badgeStyle, abColumn, api) => {
39
39
  this.eGui.innerHTML = formattedValue;
40
40
  return;
41
41
  }
42
- if (['NumberArray', 'StringArray'].includes(abColumn.dataType)) {
42
+ const arrayTypes = ['numberArray', 'textArray'];
43
+ if (arrayTypes.includes(abColumn.dataType)) {
43
44
  this.renderArrayValues(params, adaptableApi);
44
45
  }
45
46
  else {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InternalAdaptableDateEditor = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
6
+ const date_fns_1 = require("date-fns");
7
7
  const useProperty_1 = tslib_1.__importDefault(require("../../../components/utils/useProperty"));
8
8
  const AdaptableInput_1 = tslib_1.__importDefault(require("../../../View/Components/AdaptableInput"));
9
9
  const DatepickerContext_1 = require("../../../components/Datepicker/DatepickerContext");
@@ -42,7 +42,7 @@ exports.InternalAdaptableDateEditor = React.forwardRef((props, ref) => {
42
42
  props.onValueChange?.(null);
43
43
  }
44
44
  else {
45
- const date = typeof value === 'string' ? (0, parseISO_1.default)(value) : new Date(value);
45
+ const date = typeof value === 'string' ? (0, date_fns_1.parseISO)(value) : new Date(value);
46
46
  props.onValueChange?.(date);
47
47
  }
48
48
  },
@@ -35,11 +35,11 @@ exports.ColorPicker = React.forwardRef((props, ref) => {
35
35
  }, value: preparedValue, ref: ref, type: "color", style: {
36
36
  width: 70,
37
37
  padding: 0 /* we need this to be 0, since otherwise on Windows browsers, the chosen color cannot be seen */,
38
- }, list: "ABcolorChoices" }),
38
+ }, list: "ABcolorChoices", title: props.title }),
39
39
  ABcolorChoices,
40
40
  includeAlpha && (React.createElement(rebass_1.Flex, { alignItems: "center" },
41
41
  React.createElement(rebass_1.Box, { mr: 1 }, "Opacity"),
42
- React.createElement(Input_1.default, { className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
42
+ React.createElement(Input_1.default, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
43
43
  const color = (0, tinycolor2_1.default)(value).setAlpha(event.target.value).toRgbString();
44
44
  props.onChange(color);
45
45
  }, 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;
@@ -6,7 +6,7 @@ const useAgGridClassName = (deps = []) => {
6
6
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
7
7
  return (0, react_1.useMemo)(() => {
8
8
  if (adaptable) {
9
- return adaptable.getAgGridCurrentThemeName();
9
+ return adaptable.agGridThemeAdapter.getAgGridCurrentThemeClassNames();
10
10
  }
11
11
  return '';
12
12
  }, 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;
@@ -31,9 +31,17 @@ const INFINITE_COLUMNS_WITH_CHECKBOX = {
31
31
  style: {
32
32
  lineHeight: '30px',
33
33
  },
34
+ resizable: false,
35
+ defaultSortable: false,
34
36
  renderSelectionCheckBox: ({ renderBag }) => {
35
37
  return (React.createElement(rebass_1.Box, { display: 'inline-block', style: checkboxStyle }, renderBag.selectionCheckBox));
36
38
  },
39
+ renderHeader: (headerParams) => {
40
+ return (React.createElement(React.Fragment, null,
41
+ headerParams.renderBag.selectionCheckBox,
42
+ headerParams.allRowsSelected ? '(Deselect All)' : '(Select All)'));
43
+ },
44
+ renderMenuIcon: false,
37
45
  },
38
46
  };
39
47
  const INFINITE_COLUMNS_WITH_RADIO = {
@@ -91,6 +99,7 @@ const Select = function (props) {
91
99
  };
92
100
  const renderMultipleValues = props.renderMultipleValues;
93
101
  const isMulti = props.isMulti ?? Array.isArray(props.value);
102
+ const showHeaderSelectionCheckbox = isMulti && (props.showHeaderSelectionCheckbox ?? false);
94
103
  let selectedOption = null;
95
104
  if (isMulti) {
96
105
  selectedOption =
@@ -216,10 +225,24 @@ const Select = function (props) {
216
225
  }
217
226
  : selectedRows[0];
218
227
  }, [selectedRows, isMulti]);
219
- const onRowSelectionChange = React.useCallback(({ selectedRows }) => {
220
- const selection = selectedRows.map((row) => {
221
- return { value: row };
222
- });
228
+ const onRowSelectionChange = React.useCallback((selectionParams) => {
229
+ let selection = [];
230
+ const { selectedRows, defaultSelection, deselectedRows } = selectionParams;
231
+ if (defaultSelection === true && deselectedRows.length === 0) {
232
+ // all selected
233
+ selection = options.map((option) => {
234
+ return { value: option.value };
235
+ });
236
+ }
237
+ else if (defaultSelection === false && selectedRows.length === 0) {
238
+ // none selected
239
+ selection = [];
240
+ }
241
+ else {
242
+ selection = selectedRows.map((row) => {
243
+ return { value: row };
244
+ });
245
+ }
223
246
  //@ts-ignore
224
247
  setValue(selection, 'select-option');
225
248
  }, [setValue]);
@@ -243,9 +266,9 @@ const Select = function (props) {
243
266
  data: props.options, primaryKey: "value", selectionMode: isMulti ? 'multi-row' : 'single-row',
244
267
  // @ts-ignore
245
268
  onRowSelectionChange: isLoading ? null : isMulti ? onRowSelectionChange : onSingleRowSelectionChange, rowSelection: rowSelection, filterFunction: filterFunction, isRowDisabled: isRowDisabled },
246
- React.createElement(infinite_react_1.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 })));
269
+ React.createElement(infinite_react_1.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 })));
247
270
  };
248
- }, [isMulti]);
271
+ }, [isMulti, showHeaderSelectionCheckbox]);
249
272
  const DropdownIndicator = React.useMemo(() => {
250
273
  return (props) => {
251
274
  return (React.createElement(react_select_1.components.DropdownIndicator, { ...props },
@@ -316,7 +339,7 @@ const Select = function (props) {
316
339
  zIndex: 999999,
317
340
  boxShadow: 'var(--ab-cmp-select-menu__box-shadow)',
318
341
  minWidth: `var(--ab-cmp-select-menu__min-width)`,
319
- '--ab-cmp-select-menu__min-height': `min(${(props.options || []).length * ROW_HEIGHT}px, 20rem)`,
342
+ '--ab-cmp-select-menu__min-height': `min(${((props.options || []).length + (showHeaderSelectionCheckbox ? 1 : 0)) * ROW_HEIGHT}px, 20rem)`,
320
343
  ...commonStyles(state),
321
344
  ...props.menuStyle,
322
345
  };
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  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" || '',
5
- PUBLISH_TIMESTAMP: 1740401889478 || Date.now(),
6
- VERSION: "20.0.0-canary.2" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1742294898325 || Date.now(),
6
+ VERSION: "20.0.0-canary.20" || '--current-version--',
7
7
  };
@@ -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;