@adaptabletools/adaptable 22.0.0-canary.12 → 22.0.0-canary.14

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 (53) hide show
  1. package/index.css +9 -6
  2. package/index.css.map +1 -1
  3. package/index.d.ts +8 -8
  4. package/index.js +8 -8
  5. package/package.json +1 -1
  6. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
  7. package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -3
  8. package/src/AdaptableState/Common/AggregationColumns.d.ts +1 -0
  9. package/src/AdaptableState/Common/AggregationColumns.js +1 -0
  10. package/src/AdaptableState/Common/TransposeConfig.d.ts +0 -5
  11. package/src/AdaptableState/InitialState.d.ts +1 -1
  12. package/src/Api/ColumnApi.d.ts +1 -1
  13. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  14. package/src/Api/Implementation/ColumnApiImpl.js +4 -4
  15. package/src/Api/Implementation/GridApiImpl.js +0 -2
  16. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -1
  17. package/src/Api/Internal/ColumnInternalApi.js +4 -2
  18. package/src/Strategy/FormatColumnModule.js +2 -2
  19. package/src/Strategy/StyledColumnModule.js +14 -6
  20. package/src/Strategy/Utilities/FormatColumn/{getFormatColumnSettingsTargetItems.d.ts → getFormatColumnRowTargetItems.d.ts} +1 -1
  21. package/src/Strategy/Utilities/FormatColumn/getFormatColumnRowTargetItems.js +22 -0
  22. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +5 -13
  23. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
  24. package/src/Utilities/getScopeViewItems.js +1 -1
  25. package/src/Utilities/only.d.ts +15 -0
  26. package/src/Utilities/only.js +54 -0
  27. package/src/View/Components/ValueSelector/index.js +7 -2
  28. package/src/View/Export/Wizard/NewReportWizard.js +8 -8
  29. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +19 -10
  30. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -1
  31. package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.d.ts +8 -0
  32. package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.js +80 -0
  33. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +22 -61
  34. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +22 -8
  35. package/src/View/Layout/TransposedPopup.js +0 -1
  36. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  37. package/src/View/StyledColumn/Wizard/StyledColumnBadgeRowsSection.d.ts +8 -0
  38. package/src/View/StyledColumn/Wizard/{StyledColumnWizardSettingsSection.js → StyledColumnBadgeRowsSection.js} +19 -19
  39. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +10 -11
  40. package/src/agGrid/AdaptableAgGrid.js +17 -1
  41. package/src/agGrid/AgGridAdapter.js +4 -4
  42. package/src/agGrid/AgGridExportAdapter.d.ts +2 -2
  43. package/src/agGrid/AgGridExportAdapter.js +7 -6
  44. package/src/env.js +2 -2
  45. package/src/metamodel/adaptable.metamodel.js +1 -1
  46. package/src/migration/VersionUpgrade22.js +8 -0
  47. package/tsconfig.esm.tsbuildinfo +1 -1
  48. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +0 -12
  49. package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.d.ts +0 -8
  50. package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.js +0 -31
  51. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.d.ts +0 -8
  52. /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.d.ts → FormatColumnColumnScopeWizardSection.d.ts} +0 -0
  53. /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.js → FormatColumnColumnScopeWizardSection.js} +0 -0
@@ -365,7 +365,7 @@ export const ColumnsSection = (props) => {
365
365
  const visibleIds = layout.TableColumns.filter((colId) => {
366
366
  return (layout.ColumnVisibility?.[colId] !== false &&
367
367
  adaptable.api.columnApi.isSelectionColumn(colId) === false &&
368
- !adaptable.api.columnApi.internalApi.isAlwaysHiddenColumn(colId));
368
+ !adaptable.api.columnApi.internalApi.isColumnUIHidden(colId));
369
369
  });
370
370
  const currentlyDisplayedColumnIds = searchInputValue
371
371
  ? currentOrder
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { StyledColumn } from '../../../types';
3
+ type StyledColumnBadgeRowsSectionProps = {
4
+ onChange: (data: StyledColumn) => void;
5
+ };
6
+ export declare const renderStyledColumnBadgeRowsSummary: (data: StyledColumn) => React.JSX.Element;
7
+ export declare const StyledColumnBadgeRowsSection: (props: StyledColumnBadgeRowsSectionProps) => React.JSX.Element;
8
+ export {};
@@ -5,7 +5,7 @@ import { Tabs } from '../../../components/Tabs';
5
5
  import { Tag } from '../../../components/Tag';
6
6
  import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
7
7
  import { Flex, Box } from '../../../components/Flex';
8
- export const renderStyledColumnWizardSettingsSummary = (data) => {
8
+ export const renderStyledColumnBadgeRowsSummary = (data) => {
9
9
  const badgeStyle = data;
10
10
  return (React.createElement(Box, { className: "twa:p-2" },
11
11
  React.createElement(Box, { className: "twa:mt-3" },
@@ -22,80 +22,80 @@ export const renderStyledColumnWizardSettingsSummary = (data) => {
22
22
  "Total Rows ",
23
23
  React.createElement(Tag, null, badgeStyle.RowScope?.ExcludeTotalRows ? 'no' : 'yes'))));
24
24
  };
25
- export const StyledColumnWizardSettingsSection = (props) => {
25
+ export const StyledColumnBadgeRowsSection = (props) => {
26
26
  const { data } = useOnePageAdaptableWizardContext();
27
- const onExcludeDataRowsChanged = (ExcludeDataRows) => {
27
+ const onExcludeDataRowsChanged = (includeDataRows) => {
28
28
  props.onChange({
29
29
  ...data,
30
30
  BadgeStyle: {
31
31
  ...data.BadgeStyle,
32
32
  RowScope: {
33
33
  ...data.BadgeStyle.RowScope,
34
- ExcludeDataRows,
34
+ ExcludeDataRows: !includeDataRows,
35
35
  },
36
36
  },
37
37
  });
38
38
  };
39
- const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
39
+ const onExcludeGroupedRowsChanged = (includeGroupedRows) => {
40
40
  props.onChange({
41
41
  ...data,
42
42
  BadgeStyle: {
43
43
  ...data.BadgeStyle,
44
44
  RowScope: {
45
45
  ...data.BadgeStyle.RowScope,
46
- ExcludeGroupRows: ExcludeGroupedRows,
46
+ ExcludeGroupRows: !includeGroupedRows,
47
47
  },
48
48
  },
49
49
  });
50
50
  };
51
- const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
51
+ const onExcludeSummaryRowsChanged = (includeSummaryRows) => {
52
52
  props.onChange({
53
53
  ...data,
54
54
  BadgeStyle: {
55
55
  ...data.BadgeStyle,
56
56
  RowScope: {
57
57
  ...data.BadgeStyle.RowScope,
58
- ExcludeSummaryRows,
58
+ ExcludeSummaryRows: !includeSummaryRows,
59
59
  },
60
60
  },
61
61
  });
62
62
  };
63
- const onExcludeTotalRowsChanged = (ExcludeTotalRows) => {
63
+ const onExcludeTotalRowsChanged = (includeTotalRows) => {
64
64
  props.onChange({
65
65
  ...data,
66
66
  BadgeStyle: {
67
67
  ...data.BadgeStyle,
68
68
  RowScope: {
69
69
  ...data.BadgeStyle.RowScope,
70
- ExcludeTotalRows,
70
+ ExcludeTotalRows: !includeTotalRows,
71
71
  },
72
72
  },
73
73
  });
74
74
  };
75
75
  return (React.createElement(Tabs, null,
76
- React.createElement(Tabs.Tab, null, "Settings"),
76
+ React.createElement(Tabs.Tab, null, "Row Types"),
77
77
  React.createElement(Tabs.Content, null,
78
78
  React.createElement(Flex, { flexDirection: "row" },
79
79
  React.createElement(FormLayout, null,
80
- React.createElement(FormRow, { label: "Exclude Data Rows:" },
80
+ React.createElement(FormRow, { label: "Data (leaf) Rows:" },
81
81
  React.createElement(Flex, { alignItems: "center", className: "twa:ml-2" },
82
82
  React.createElement(CheckBox, { "data-name": "exclude-data-rows-checkbox", className: "twa:mr-2", checked:
83
83
  // @ts-ignore
84
- data.BadgeStyle.RowScope?.ExcludeDataRows, onChange: onExcludeDataRowsChanged }))),
85
- React.createElement(FormRow, { label: "Exclude Group Rows:" },
84
+ !data.BadgeStyle.RowScope?.ExcludeDataRows, onChange: onExcludeDataRowsChanged }))),
85
+ React.createElement(FormRow, { label: "Group Rows:" },
86
86
  React.createElement(Flex, { alignItems: "center", className: "twa:ml-2" },
87
87
  React.createElement(CheckBox, { className: "twa:mr-2", "data-name": "exclude-grouped-rows-checkbox", checked:
88
88
  // @ts-ignore
89
- data.BadgeStyle.RowScope?.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged }))),
90
- React.createElement(FormRow, { label: "Exclude Row Summaries:" },
89
+ !data.BadgeStyle.RowScope?.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged }))),
90
+ React.createElement(FormRow, { label: "Summary Rows:" },
91
91
  React.createElement(Flex, { alignItems: "center", className: "twa:ml-2" },
92
92
  React.createElement(CheckBox, { "data-name": "exclude-summary-rows-checkbox", className: "twa:mr-2", checked:
93
93
  // @ts-ignore
94
- data.BadgeStyle.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged }))),
94
+ !data.BadgeStyle.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged }))),
95
95
  ' ',
96
- React.createElement(FormRow, { label: "Exclude Total Rows:" },
96
+ React.createElement(FormRow, { label: "Total Rows:" },
97
97
  React.createElement(Flex, { alignItems: "center", className: "twa:ml-2" },
98
98
  React.createElement(CheckBox, { "data-name": "exclude-total-rows-checkbox", className: "twa:mr-2", checked:
99
99
  // @ts-ignore
100
- data.BadgeStyle.RowScope?.ExcludeTotalRows, onChange: onExcludeTotalRowsChanged }))))))));
100
+ !data.BadgeStyle.RowScope?.ExcludeTotalRows, onChange: onExcludeTotalRowsChanged }))))))));
101
101
  };
@@ -8,7 +8,7 @@ import { renderStyledColumnTypeSummary, StyledColumnWizardTypeSection, } from '.
8
8
  import { isValidStyledColumnColumn, renderStyledColumnColumnSummary, StyledColumnWizardColumnSection, } from './StyledColumnWizardColumnSection';
9
9
  import { renderStyledColumnStyleSummary, StyledColumnWizardStyleSection, } from './StyledColumnWizardStyleSection';
10
10
  import { cloneObject } from '../../../Utilities/Helpers/Helper';
11
- import { renderStyledColumnWizardSettingsSummary, StyledColumnWizardSettingsSection, } from './StyledColumnWizardSettingsSection';
11
+ import { renderStyledColumnBadgeRowsSummary, StyledColumnBadgeRowsSection, } from './StyledColumnBadgeRowsSection';
12
12
  import { StyledColumnSparklineSettingsSection } from './StyledColumnSparklineSettingsSection';
13
13
  import { ObjectTagsWizardSection, renderObjectTagsSummary, } from '../../Wizard/ObjectTagsWizardSection';
14
14
  import { renderBadgeSummary, StyledColumnBadgeSection } from './StyledColumnBadgeSection';
@@ -48,15 +48,6 @@ export const StyledColumnWizard = (props) => {
48
48
  }
49
49
  props.onFinishWizard(styledColumn);
50
50
  };
51
- const AdditionalSettingSection = {
52
- details: 'Apply Additional Settings',
53
- renderSummary: renderStyledColumnWizardSettingsSummary,
54
- render: () => {
55
- return (React.createElement(Box, { className: "twa:p-2" },
56
- React.createElement(StyledColumnWizardSettingsSection, { onChange: setStyledColumn })));
57
- },
58
- title: 'Settings',
59
- };
60
51
  const specificSteps = [];
61
52
  if (styledColumn.SparklineStyle) {
62
53
  specificSteps.push({
@@ -93,6 +84,15 @@ export const StyledColumnWizard = (props) => {
93
84
  );
94
85
  }
95
86
  else if (styledColumn.BadgeStyle) {
87
+ specificSteps.push({
88
+ details: 'Select the Rows where the Badge will be applied',
89
+ renderSummary: renderStyledColumnBadgeRowsSummary,
90
+ render: () => {
91
+ return (React.createElement(Box, { className: "twa:p-2" },
92
+ React.createElement(StyledColumnBadgeRowsSection, { onChange: setStyledColumn })));
93
+ },
94
+ title: 'Rows',
95
+ });
96
96
  specificSteps.push({
97
97
  title: 'Badges',
98
98
  details: 'Create Badge Styles',
@@ -110,7 +110,6 @@ export const StyledColumnWizard = (props) => {
110
110
  render: () => (React.createElement(Box, { className: "twa:p-2" },
111
111
  React.createElement(StyledColumnBadgeSection, { onChange: setStyledColumn }))),
112
112
  });
113
- specificSteps.push(AdditionalSettingSection);
114
113
  }
115
114
  return (React.createElement(OnePageAdaptableWizard, { defaultCurrentSectionName: defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: styledColumn, onFinish: handleFinish, onHide: props.onCloseWizard, sections: [
116
115
  {
@@ -78,7 +78,7 @@ import { AgGridOptionsService } from './AgGridOptionsService';
78
78
  import { parseDateValue } from '../Utilities/Helpers/DateHelper';
79
79
  import { AgGridColumnAdapter } from './AgGridColumnAdapter';
80
80
  import getScrollbarSize from '../Utilities/getScrollbarSize';
81
- import { WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
81
+ import { ONLY_AGG_FN_NAME, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
82
82
  import { RowFormService } from '../Utilities/Services/RowFormService';
83
83
  import { FilterOnDataChangeOptions } from '../AdaptableState/Common/Enums';
84
84
  import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
@@ -87,6 +87,7 @@ import { ensureLoadingScreenPortalElement } from '../components/Modal';
87
87
  import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadingScreen';
88
88
  import { createElement } from 'react';
89
89
  import { createAgStatusPanelComponent } from '../Utilities/createAgStatusPanelComponent';
90
+ import { only } from '../Utilities/only';
90
91
  import { weightedAverage } from '../Utilities/weightedAverage';
91
92
  import { ROW_SUMMARY_ROW_ID } from '../AdaptableState/Common/RowSummary';
92
93
  import { FlashingCellService } from '../Utilities/Services/FlashingCellService';
@@ -1080,6 +1081,9 @@ export class AdaptableAgGrid {
1080
1081
  */
1081
1082
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'aggFuncs', (original_aggFuncs) => {
1082
1083
  const aggregationFunctions = original_aggFuncs || {};
1084
+ aggregationFunctions[ONLY_AGG_FN_NAME] = (params) => {
1085
+ return only(params, params.column.getColId());
1086
+ };
1083
1087
  aggregationFunctions[WEIGHTED_AVERAGE_AGG_FN_NAME] = (params) => {
1084
1088
  const columnId = params.column.getColId();
1085
1089
  const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(columnId);
@@ -1462,6 +1466,18 @@ export class AdaptableAgGrid {
1462
1466
  caseSensitive: !!this.adaptableOptions.quickSearchOptions.isQuickSearchCaseSensitive,
1463
1467
  };
1464
1468
  });
1469
+ /**
1470
+ * suppressOverlays
1471
+ */
1472
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'suppressOverlays', (original_suppressOverlays) => {
1473
+ // we want to suppress the exporting overlay because having it enabled will turn api.exportDataAsExcel() and api.exportDataAsCsv() into async operations,
1474
+ // see #export_data_synchronously
1475
+ let suppressOverlays = original_suppressOverlays || [];
1476
+ if (!suppressOverlays.includes('exporting')) {
1477
+ suppressOverlays.push('exporting');
1478
+ }
1479
+ return suppressOverlays;
1480
+ });
1465
1481
  }
1466
1482
  /**
1467
1483
  * Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
@@ -471,8 +471,8 @@ export class AgGridAdapter {
471
471
  ? 'number'
472
472
  : this.deriveAdaptableColumnDataType(agGridColumn, false);
473
473
  const isTreeColumn = this.isTreeColumn(isGeneratedRowGroupColumn);
474
- const alwaysHidden = this.adaptableApi.columnApi.internalApi.isAlwaysHiddenColumn(colDef);
475
- const visible = !alwaysHidden || agGridColumn.isVisible();
474
+ const isUIHiddenColumn = this.adaptableApi.columnApi.internalApi.isColumnUIHidden(colDef);
475
+ const visible = !isUIHiddenColumn || agGridColumn.isVisible();
476
476
  const isGenerated = isGeneratedRowGroupColumn || isGeneratedPivotResultColumn || isGeneratedSelectionColumn;
477
477
  const abColumn = {
478
478
  Uuid: createUuid(),
@@ -482,9 +482,9 @@ export class AgGridAdapter {
482
482
  resizable: colDef.resizable !== false,
483
483
  friendlyName: friendlyName,
484
484
  isPrimaryKey: ColumnId === pkColumn,
485
- dataType: dataType,
485
+ dataType,
486
486
  visible,
487
- alwaysHidden,
487
+ isUIHiddenColumn,
488
488
  readOnly: this.isColumnReadonly(colDef),
489
489
  columnGroup: ColumnGroup,
490
490
  fieldOnly: isGenerated ? false : this.isColumnFieldonly(colDef),
@@ -1,8 +1,8 @@
1
- import { AdaptableAgGrid } from './AdaptableAgGrid';
2
- import { Report, ReportFormatType } from '../AdaptableState/ExportState';
3
1
  import { CsvExportParams, ExcelExportParams, ExcelStyle } from 'ag-grid-enterprise';
4
2
  import { CustomExportParams, ExportDestinationType, ExportResultData } from '../AdaptableOptions/ExportOptions';
3
+ import { Report, ReportFormatType } from '../AdaptableState/ExportState';
5
4
  import { Layout } from '../AdaptableState/LayoutState';
5
+ import { AdaptableAgGrid } from './AdaptableAgGrid';
6
6
  export interface ExportConfig {
7
7
  report: Report;
8
8
  format: ReportFormatType;
@@ -1,12 +1,12 @@
1
- import { ExportModuleId } from '../Utilities/Constants/ModuleConstants';
2
- import { waitForTimeout } from '../Utilities/waitForTimeout';
3
- import { convertCSSAbsoluteFontSizeToPt, getVariableColor, sanitizeStyle, } from '../Utilities/Helpers/StyleHelper';
4
- import FormatHelper, { DateFormatter } from '../Utilities/Helpers/FormatHelper';
5
1
  import tinycolor from 'tinycolor2';
6
- import StringExtensions from '../Utilities/Extensions/StringExtensions';
7
- import { createUuid } from '../AdaptableState/Uuid';
8
2
  import { inferSchema, initParser } from 'udsv';
3
+ import { createUuid } from '../AdaptableState/Uuid';
9
4
  import { AG_GRID_GROUPED_COLUMN, AG_GRID_SELECTION_COLUMN, } from '../Utilities/Constants/GeneralConstants';
5
+ import { ExportModuleId } from '../Utilities/Constants/ModuleConstants';
6
+ import StringExtensions from '../Utilities/Extensions/StringExtensions';
7
+ import FormatHelper, { DateFormatter } from '../Utilities/Helpers/FormatHelper';
8
+ import { convertCSSAbsoluteFontSizeToPt, getVariableColor, sanitizeStyle, } from '../Utilities/Helpers/StyleHelper';
9
+ import { waitForTimeout } from '../Utilities/waitForTimeout';
10
10
  export class AgGridExportAdapter {
11
11
  _adaptableInstance;
12
12
  /**
@@ -87,6 +87,7 @@ export class AgGridExportAdapter {
87
87
  this.patchExcelStyles(exportContext);
88
88
  excelStylesWerePatched = true;
89
89
  }
90
+ // see #export_data_synchronously
90
91
  // 1. easiest case, we download the file using AG Grid
91
92
  // these methods will automatically handle the file download
92
93
  if (exportContext.destination === 'Download' && exportContext.isExcelReport) {
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: 1771235578694 || Date.now(),
4
- VERSION: "22.0.0-canary.12" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1771515618410 || Date.now(),
4
+ VERSION: "22.0.0-canary.14" || '--current-version--',
5
5
  };