@adaptabletools/adaptable 22.0.0-canary.2 → 22.0.0-canary.3

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 (61) hide show
  1. package/index.css +52 -23
  2. package/index.css.map +1 -1
  3. package/package.json +1 -1
  4. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -2
  5. package/src/AdaptableState/Common/AdaptableStyle.d.ts +8 -0
  6. package/src/AdaptableState/FormatColumnState.d.ts +0 -8
  7. package/src/Api/DataSetApi.d.ts +1 -1
  8. package/src/Api/GridApi.d.ts +3 -3
  9. package/src/Api/Implementation/GridApiImpl.d.ts +9 -9
  10. package/src/Api/Implementation/GridApiImpl.js +16 -16
  11. package/src/Api/Internal/ColumnInternalApi.js +1 -1
  12. package/src/Api/Internal/FormatColumnInternalApi.d.ts +0 -10
  13. package/src/Api/Internal/FormatColumnInternalApi.js +1 -19
  14. package/src/Redux/ActionsReducers/NoteRedux.js +1 -1
  15. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +0 -3
  16. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +2 -2
  17. package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -2
  18. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -3
  19. package/src/Utilities/Helpers/StyleHelper.js +14 -0
  20. package/src/Utilities/ObjectFactory.js +1 -1
  21. package/src/Utilities/Services/AnnotationsService.js +1 -1
  22. package/src/Utilities/Services/ModuleService.js +3 -3
  23. package/src/View/AdaptablePopover/index.d.ts +1 -0
  24. package/src/View/AdaptablePopover/index.js +1 -1
  25. package/src/View/Alert/ActiveAlertsPanel.js +8 -0
  26. package/src/View/Alert/AlertViewPanel.js +13 -9
  27. package/src/View/Alert/Utilities/getAlertButtonStyle.d.ts +1 -0
  28. package/src/View/Alert/Utilities/getAlertButtonStyle.js +8 -0
  29. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +23 -11
  30. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +2 -2
  31. package/src/View/CellSummary/CellSummaryViewPanel.js +15 -17
  32. package/src/View/Components/AdaptableDateInput/index.js +1 -1
  33. package/src/View/Components/Buttons/ButtonApply.js +1 -1
  34. package/src/View/Components/Buttons/ButtonClear.d.ts +1 -0
  35. package/src/View/Components/Selectors/BulkUpdateValueSelector.js +19 -18
  36. package/src/View/Components/StyleComponent.js +20 -1
  37. package/src/View/Dashboard/DashboardPopup.js +4 -5
  38. package/src/View/Export/ExportDestinationPicker.js +1 -1
  39. package/src/View/Export/ExportStatusBar.js +4 -2
  40. package/src/View/Export/ExportViewPanel.js +25 -18
  41. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -23
  42. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -2
  43. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +57 -65
  44. package/src/View/QuickSearch/QuickSearchPopup.js +4 -1
  45. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +2 -2
  46. package/src/View/UIHelper.d.ts +2 -0
  47. package/src/View/UIHelper.js +15 -0
  48. package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
  49. package/src/agGrid/AdaptableAgGrid.js +5 -5
  50. package/src/agGrid/AgGridColumnAdapter.js +3 -18
  51. package/src/components/Dashboard/DashboardToolbar.js +1 -1
  52. package/src/components/ExpressionEditor/EditorInput.js +19 -3
  53. package/src/components/Tree/TreeDropdown/index.js +1 -1
  54. package/src/env.js +2 -2
  55. package/src/metamodel/adaptable.metamodel.d.ts +9 -7
  56. package/src/metamodel/adaptable.metamodel.js +1 -1
  57. package/src/migration/AdaptableUpgradeHelper.js +2 -0
  58. package/src/migration/VersionUpgrade22.d.ts +6 -0
  59. package/src/migration/VersionUpgrade22.js +27 -0
  60. package/src/types.d.ts +1 -1
  61. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -95,6 +95,22 @@ export class GridApiImpl extends ApiBase {
95
95
  }
96
96
  return [];
97
97
  }
98
+ async manageGridData(dataRows, config) {
99
+ const transactionResult = await this._adaptable.manageGridRows(dataRows, config);
100
+ if (Array.isArray(transactionResult.removedRows) && transactionResult.removedRows.length) {
101
+ const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.delete, transactionResult.removedRows, 'Delete');
102
+ this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
103
+ }
104
+ if (Array.isArray(transactionResult.updatedRows) && transactionResult.updatedRows.length) {
105
+ const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.update, transactionResult.updatedRows, 'Update');
106
+ this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
107
+ }
108
+ if (Array.isArray(transactionResult.addedRows) && transactionResult.addedRows.length) {
109
+ const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.add, transactionResult.addedRows, 'Add');
110
+ this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
111
+ }
112
+ return transactionResult;
113
+ }
98
114
  setCellValue(cellUpdateRequest) {
99
115
  const abColumn = this.getColumnApi().getColumnWithColumnId(cellUpdateRequest.columnId);
100
116
  if (!abColumn) {
@@ -684,20 +700,4 @@ export class GridApiImpl extends ApiBase {
684
700
  .filter(Boolean);
685
701
  this.setAgGridColumnDefinitions([...sanitizedColDefs, newColumnDefinition]);
686
702
  }
687
- async applyGridDataTransaction(dataTransaction, config) {
688
- const transactionResult = await this._adaptable.applyGridDataTransaction(dataTransaction, config);
689
- if (Array.isArray(transactionResult.removedRows) && transactionResult.removedRows.length) {
690
- const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataTransaction.remove, transactionResult.removedRows, 'Delete');
691
- this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
692
- }
693
- if (Array.isArray(transactionResult.updatedRows) && transactionResult.updatedRows.length) {
694
- const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataTransaction.update, transactionResult.updatedRows, 'Update');
695
- this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
696
- }
697
- if (Array.isArray(transactionResult.addedRows) && transactionResult.addedRows.length) {
698
- const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataTransaction.add, transactionResult.addedRows, 'Add');
699
- this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
700
- }
701
- return transactionResult;
702
- }
703
703
  }
@@ -277,7 +277,7 @@ export class ColumnInternalApi extends ApiBase {
277
277
  getQueryableColumnsForUIEditor() {
278
278
  return this.getColumnApi()
279
279
  .getQueryableColumns()
280
- .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn);
280
+ .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn && !column.isGeneratedSelectionColumn);
281
281
  }
282
282
  isAlwaysHiddenColumn(columnIdentifier) {
283
283
  return this.getColumnApi().hasColumnType(columnIdentifier, HIDDEN_COLUMN_TYPE);
@@ -7,21 +7,11 @@ export declare class FormatColumnInternalApi extends ApiBase {
7
7
  * @returns format columns
8
8
  */
9
9
  getAllFormatColumnWithStyle(config?: FormatColumnConfig): FormatColumn[];
10
- /**
11
- * Retrieves all Format Columns in Adaptable State with the `Style` or the `CellAlignment` property set
12
- * @returns format columns
13
- */
14
- getAllFormatColumnWithStyleAndCellAlignment(config?: FormatColumnConfig): FormatColumn[];
15
10
  /**
16
11
  * Retrieves all Format Columns in Adaptable State with `DisplayFormat` property set
17
12
  * @returns format columns
18
13
  */
19
14
  getAllFormatColumnWithDisplayFormat(config?: FormatColumnConfig): FormatColumn[];
20
- /**
21
- * Retrieves all Format Columns in Adaptable State with `CellAlignment` property set
22
- * @returns format columns
23
- */
24
- getAllFormatColumnWithCellAlignment(config?: FormatColumnConfig): FormatColumn[];
25
15
  /**
26
16
  * Get all FormatColumns which are defined for this column and have a custom AdaptableStyle
27
17
  * @param column
@@ -41,15 +41,6 @@ export class FormatColumnInternalApi extends ApiBase {
41
41
  .getFormatColumns(config)
42
42
  .filter((fc) => fc.Style);
43
43
  }
44
- /**
45
- * Retrieves all Format Columns in Adaptable State with the `Style` or the `CellAlignment` property set
46
- * @returns format columns
47
- */
48
- getAllFormatColumnWithStyleAndCellAlignment(config) {
49
- return this.getFormatColumnApi()
50
- .getFormatColumns(config)
51
- .filter((fc) => fc.Style || fc.CellAlignment);
52
- }
53
44
  /**
54
45
  * Retrieves all Format Columns in Adaptable State with `DisplayFormat` property set
55
46
  * @returns format columns
@@ -59,15 +50,6 @@ export class FormatColumnInternalApi extends ApiBase {
59
50
  .getFormatColumns(config)
60
51
  .filter((fc) => fc.DisplayFormat);
61
52
  }
62
- /**
63
- * Retrieves all Format Columns in Adaptable State with `CellAlignment` property set
64
- * @returns format columns
65
- */
66
- getAllFormatColumnWithCellAlignment(config) {
67
- return this.getFormatColumnApi()
68
- .getFormatColumns(config)
69
- .filter((fc) => fc.CellAlignment);
70
- }
71
53
  /**
72
54
  * Get all FormatColumns which are defined for this column and have a custom AdaptableStyle
73
55
  * @param column
@@ -75,7 +57,7 @@ export class FormatColumnInternalApi extends ApiBase {
75
57
  * @returns list of FormatColumn
76
58
  */
77
59
  getFormatColumnsWithStyleForColumn(column, config) {
78
- const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment()
60
+ const formatColumns = this.getAllFormatColumnWithStyle()
79
61
  .filter((formatColumn) => {
80
62
  // FormatColumn default target is 'cell', so if no target is specified, we assume 'cell'
81
63
  const fcTarget = formatColumn.Target ?? 'cell';
@@ -42,7 +42,7 @@ export const GetNoteSelector = (state, address) => {
42
42
  // happy check
43
43
  return true;
44
44
  }
45
- // Primary keys retreived from the grid dom are always strings, so we must also consider them strings
45
+ // Primary keys retrieved from the grid dom are always strings, so we must also consider them strings
46
46
  if ((typeof address.PrimaryKeyValue === 'number' && typeof note.PrimaryKeyValue === 'string') ||
47
47
  (typeof address.PrimaryKeyValue === 'string' && typeof note.PrimaryKeyValue === 'number')) {
48
48
  return (note.PrimaryKeyValue.toString() === address.PrimaryKeyValue.toString() &&
@@ -1,8 +1,5 @@
1
1
  export const getFormatColumnSettingsViewItems = (formatColumn) => {
2
2
  let values = [];
3
- if (formatColumn.CellAlignment) {
4
- values.push(`Cell Alignment: ${formatColumn.CellAlignment}`);
5
- }
6
3
  if (formatColumn.RowScope) {
7
4
  if (formatColumn.RowScope.ExcludeDataRows) {
8
5
  values.push('Exclude Data Rows');
@@ -12,7 +12,7 @@ export declare const PredicateDocsLink = "https://www.adaptabletools.com/docs/ad
12
12
  export declare const PrimaryKeyDocsLink = "https://www.adaptabletools.com/docs/getting-started-primary-key";
13
13
  export declare const LicenseDocsLink = "https://www.adaptabletools.com/buy/buying-adaptable-licensing";
14
14
  export declare const AdaptableOptionsDocsLink = "https://www.adaptabletools.com/docs/technical-reference-adaptable-options";
15
- export declare const AgGridModulesDocsLink = "https://www.adaptabletools.com/docs/dev-guide-aggrid-modules-overview";
15
+ export declare const AgGridModulesDocsLink = "https://www.adaptabletools.com/docs/getting-started-aggrid-modules";
16
16
  export declare const AlertMessageDocsLink = "https://www.adaptabletools.com/docs/handbook-alerting-message";
17
17
  export declare const FormatColumnPlaceholderDocsLink = "https://www.adaptabletools.com/docs/handbook-column-formatting-display-format-placeholder";
18
- export declare const AgGridRequiredModulesDocsLink = "https://www.adaptabletools.com/docs/dev-guide-aggrid-modules-overview#mandatory-modules";
18
+ export declare const AgGridRequiredModulesDocsLink = "https://www.adaptabletools.com/docs/getting-started-aggrid-modules#mandatory-modules";
@@ -13,7 +13,7 @@ export const PredicateDocsLink = `${HOST_URL_DOCS}/adaptable-predicate`;
13
13
  export const PrimaryKeyDocsLink = `${HOST_URL_DOCS}/getting-started-primary-key`;
14
14
  export const LicenseDocsLink = `${HOST_URL_ROOT}/buy/buying-adaptable-licensing`;
15
15
  export const AdaptableOptionsDocsLink = `${HOST_URL_DOCS}/technical-reference-adaptable-options`;
16
- export const AgGridModulesDocsLink = `${HOST_URL_DOCS}/dev-guide-aggrid-modules-overview`;
16
+ export const AgGridModulesDocsLink = `${HOST_URL_DOCS}/getting-started-aggrid-modules`;
17
17
  export const AlertMessageDocsLink = `${HOST_URL_DOCS}/handbook-alerting-message`;
18
18
  export const FormatColumnPlaceholderDocsLink = `${HOST_URL_DOCS}/handbook-column-formatting-display-format-placeholder`;
19
- export const AgGridRequiredModulesDocsLink = `${HOST_URL_DOCS}/dev-guide-aggrid-modules-overview#mandatory-modules`;
19
+ export const AgGridRequiredModulesDocsLink = `${HOST_URL_DOCS}/getting-started-aggrid-modules#mandatory-modules`;
@@ -639,7 +639,7 @@ export const scalarExpressionFunctions = {
639
639
  }
640
640
  return result;
641
641
  },
642
- description: "Returns the percentage difference between a cell's current value and its previous value.",
642
+ description: "Returns percentage difference between a cell's current value and previous value",
643
643
  signatures: [
644
644
  'PERCENT_CHANGE( [colName], <INCREASE|DECREASE> )',
645
645
  'PERCENT_CHANGE( COL(name: string), <INCREASE|DECREASE> )',
@@ -684,7 +684,7 @@ export const scalarExpressionFunctions = {
684
684
  }
685
685
  return result;
686
686
  },
687
- description: "Returns the absolute difference between a cell's current value and its previous value.",
687
+ description: "Returns absolute difference between a cell's current value and previous value",
688
688
  signatures: [
689
689
  'ABSOLUTE_CHANGE( [colName] )',
690
690
  'ABSOLUTE_CHANGE( COL(name: string) )',
@@ -716,7 +716,7 @@ export const scalarExpressionFunctions = {
716
716
  const previousValue = context.dataChangedEvent.oldValue;
717
717
  return currentColumnValue !== previousValue;
718
718
  },
719
- description: "Returns true if a cell's current value is different from its previous value, otherwise false. If no column is provided, it checks if any value has changed.",
719
+ description: "Returns true if cell's current value is different from previous value, otherwise false; if no column is provided, it checks if any value has changed",
720
720
  signatures: ['ANY_CHANGE( [colName] )', 'ANY_CHANGE()'],
721
721
  examples: ['ANY_CHANGE([col1])', 'ANY_CHANGE()'],
722
722
  category: 'changes',
@@ -80,6 +80,20 @@ export const convertAdaptableStyleToCSS = (style) => {
80
80
  break;
81
81
  }
82
82
  }
83
+ if (style.Alignment) {
84
+ switch (style.Alignment) {
85
+ case 'Default':
86
+ case 'Left':
87
+ result.textAlign = 'left';
88
+ break;
89
+ case 'Right':
90
+ result.textAlign = 'right';
91
+ break;
92
+ case 'Center':
93
+ result.textAlign = 'center';
94
+ break;
95
+ }
96
+ }
83
97
  // assertion added to comply with the ag-Grid types
84
98
  return result;
85
99
  };
@@ -228,7 +228,6 @@ export function CreateEmptyFormatColumn() {
228
228
  Scope: undefined,
229
229
  Style: CreateEmptyStyle(),
230
230
  DisplayFormat: undefined,
231
- CellAlignment: undefined,
232
231
  RowScope: undefined,
233
232
  Target: 'cell',
234
233
  };
@@ -292,6 +291,7 @@ export function CreateEmptyStyle() {
292
291
  FontStyle: undefined,
293
292
  FontSize: undefined,
294
293
  ClassName: undefined,
294
+ Alignment: undefined,
295
295
  };
296
296
  }
297
297
  export function CreateSystemStatusMessageInfo(message, type, furtherInfo) {
@@ -28,7 +28,7 @@ export class AnnotationsService {
28
28
  if (a?.ColumnId === b?.ColumnId && a?.PrimaryKeyValue === b?.PrimaryKeyValue) {
29
29
  return true;
30
30
  }
31
- // Primary keys retreived from the grid dom are always strings, so we must also consider them strings
31
+ // Primary keys retrieved from the grid dom are always strings, so we must also consider them strings
32
32
  if ((typeof a.PrimaryKeyValue === 'number' && typeof b.PrimaryKeyValue === 'string') ||
33
33
  (typeof b.PrimaryKeyValue === 'string' && typeof a.PrimaryKeyValue === 'number')) {
34
34
  return (a.PrimaryKeyValue.toString() === b.PrimaryKeyValue.toString() && a.ColumnId === b.ColumnId);
@@ -114,13 +114,13 @@ export class ModuleService {
114
114
  case 'CalculatedColumn':
115
115
  return url + 'handbook-calculated-column';
116
116
  case 'CellSummary':
117
- return url + 'handbook-summarising';
117
+ return url + 'handbook-summarising-cells';
118
118
  case 'Charting':
119
119
  return url + 'handbook-charts';
120
120
  case 'ColumnFilter':
121
121
  return url + 'handbook-column-filter';
122
122
  case 'ColumnInfo':
123
- return url + 'dev-guide-column-grid-column-info';
123
+ return url + 'dev-guide-columns-column-info';
124
124
  case 'Comment':
125
125
  return url + 'handbook-comments';
126
126
  case 'CustomSort':
@@ -146,7 +146,7 @@ export class ModuleService {
146
146
  case 'GridFilter':
147
147
  return url + 'handbook-grid-filter';
148
148
  case 'GridInfo':
149
- return url + 'dev-guide-column-grid-column-info';
149
+ return url + 'dev-guide-support-monitoring';
150
150
  case 'Layout':
151
151
  return url + 'handbook-layouts';
152
152
  case 'NamedQuery':
@@ -17,6 +17,7 @@ export interface AdaptablePopoverProps extends React.ClassAttributes<React.Props
17
17
  popupPadding?: 0 | 2;
18
18
  alignPosition?: OverlayShowParams['alignPosition'];
19
19
  visible?: boolean;
20
+ disabled?: boolean;
20
21
  }
21
22
  export declare class AdaptablePopover extends React.Component<React.PropsWithChildren<AdaptablePopoverProps>, {}> {
22
23
  render(): React.JSX.Element;
@@ -35,7 +35,7 @@ export class AdaptablePopover extends React.Component {
35
35
  // showTriangle
36
36
  visible: this.props.visible, render: () => popoverClickRootClose, showEvent: (this.props.showEvent || 'mouseenter'), hideEvent: (this.props.hideEvent || 'mouseleave'), style: {
37
37
  overflow: 'visible',
38
- }, alignPosition: this.props.alignPosition }, useButton ? (React.createElement(ButtonInfo, { style: iconStyle, variant: "text", onClick: () => null, icon: showIcon && icon, tooltip: this.props.tooltipText }, this.props.children)) : (React.createElement("div", { title: this.props.tooltipText, tabIndex: 0, style: { cursor: 'pointer', display: 'inline-block' } },
38
+ }, alignPosition: this.props.alignPosition }, useButton ? (React.createElement(ButtonInfo, { style: iconStyle, variant: "text", onClick: () => null, icon: showIcon && icon, tooltip: this.props.tooltipText, disabled: this.props.disabled }, this.props.children)) : (React.createElement("div", { title: this.props.tooltipText, tabIndex: 0, style: { cursor: 'pointer', display: 'inline-block' } },
39
39
  this.props.children,
40
40
  showIcon && React.createElement(Icon, { name: icon, style: iconStyle }))))));
41
41
  }
@@ -7,5 +7,13 @@ export const ActiveAlertsPanel = () => {
7
7
  const adaptable = useAdaptable();
8
8
  const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.AlertModuleId);
9
9
  const alerts = useSelector((state) => state.Internal.AdaptableAlerts);
10
+ // map the suspended property from the underlying AlertDefinitions
11
+ alerts.forEach((alert) => {
12
+ const liveAlertDef = adaptable.api.alertApi.getAlertDefinitionById(alert.alertDefinition.Uuid);
13
+ if (liveAlertDef) {
14
+ // @ts-ignore theoretically AdaptableAlert is not Suspendable; practically <AdaptableObjectCompactList> expects it
15
+ alert.IsSuspended = liveAlertDef.IsSuspended;
16
+ }
17
+ });
10
18
  return React.createElement(AdaptableObjectCompactList, { abObjects: alerts, module: filterModule });
11
19
  };
@@ -2,10 +2,11 @@ import * as React from 'react';
2
2
  import { connect } from 'react-redux';
3
3
  import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
4
4
  import { AdaptablePopover } from '../AdaptablePopover';
5
- import UIHelper from '../UIHelper';
6
5
  import { getAlertButtonStyle } from './Utilities/getAlertButtonStyle';
7
6
  import { ActiveAlertsPanel } from './ActiveAlertsPanel';
8
7
  import { Flex } from '../../components/Flex';
8
+ import { ButtonClear } from '../Components/Buttons/ButtonClear';
9
+ import clsx from 'clsx';
9
10
  class AlertViewPanelComponent extends React.Component {
10
11
  constructor(props) {
11
12
  super(props);
@@ -20,7 +21,6 @@ class AlertViewPanelComponent extends React.Component {
20
21
  }
21
22
  }
22
23
  render() {
23
- const messageType = UIHelper.getMessageTypeFromAdaptableAlerts(this.props.AdaptableAlerts);
24
24
  const { color: buttonTextColor, background: buttonBackground } = getAlertButtonStyle(this.props.AdaptableAlerts);
25
25
  const collapsedText = this.props.AdaptableAlerts.length == 0
26
26
  ? '0 Alerts'
@@ -28,13 +28,17 @@ class AlertViewPanelComponent extends React.Component {
28
28
  ? '1 Alert'
29
29
  : this.props.AdaptableAlerts.length + ' Alerts';
30
30
  const alertsPanel = React.createElement(ActiveAlertsPanel, null);
31
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
32
- return (React.createElement(Flex, { alignItems: "stretch", className: `ab-${elementType}__Alert__wrap` },
33
- React.createElement(Flex, { className: `ab-${elementType}__Alert__text twa:rounded-standard twa:mr-2 twa:p-2 text-2`, style: { color: buttonTextColor, backgroundColor: buttonBackground }, alignItems: "center" }, collapsedText),
34
- this.props.AdaptableAlerts.length > 0 && (React.createElement(Flex, { alignItems: "center" },
35
- React.createElement(AdaptablePopover, { className: `ab-${elementType}__Alert__info`, headerText: "",
36
- // tooltipText="Alerts"
37
- bodyText: [alertsPanel], MessageType: messageType, useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })))));
31
+ const isToolbar = this.props.viewType === 'Toolbar';
32
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
33
+ return (React.createElement(Flex, { alignItems: "stretch", className: clsx(`ab-${elementType}__Alert__wrap twa:gap-1`, {
34
+ 'twa:min-w-[140px] twa:w-[140px]': isToolbar,
35
+ [`twa:flex-1`]: !isToolbar,
36
+ }) },
37
+ React.createElement(Flex, { key: `${buttonTextColor}_${buttonBackground}_${collapsedText}`, className: `ab-${elementType}__Alert__text twa:flex-1 twa:rounded-standard twa:p-2 text-2 twa:items-center twa:justify-center twa:min-h-input`, style: { color: buttonTextColor, backgroundColor: buttonBackground } }, collapsedText),
38
+ this.props.AdaptableAlerts.length > 0 && (React.createElement(Flex, { className: 'twa:gap-1' },
39
+ React.createElement(Flex, { className: "twa:flex twa:box-border" },
40
+ React.createElement(ButtonClear, { "aria-label": 'Clear All Alerts', variant: 'outlined', className: `ab-${elementType}__Alert__clear`, onClick: () => this.props.onDeleteAllAlert(this.state.Alerts), tooltip: "Clear All Alerts", showText: this.props.viewType === 'ToolPanel' }, 'Clear Alerts')),
41
+ React.createElement(AdaptablePopover, { className: `ab-${elementType}__Alert__info`, headerText: "Alerts Details", bodyText: [alertsPanel], MessageType: 'Info', useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })))));
38
42
  }
39
43
  }
40
44
  function mapStateToProps(state, ownProps) {
@@ -2,4 +2,5 @@ import { AdaptableAlert } from '../../../../types';
2
2
  export declare const getAlertButtonStyle: (alerts: AdaptableAlert[]) => {
3
3
  color: string;
4
4
  background: string;
5
+ cssClasses: string;
5
6
  };
@@ -4,8 +4,16 @@ export const getAlertButtonStyle = (alerts) => {
4
4
  const messageTypeColor = UIHelper.getColorByMessageType(messageType);
5
5
  const buttonBackground = UIHelper.getButtonColourForAdaptableAlerts(alerts, messageTypeColor);
6
6
  const buttonTextColor = UIHelper.getButtonTextColourForArrayandMessageType(alerts, messageType);
7
+ let cssClasses = '';
8
+ if (alerts?.length) {
9
+ const cssMessageType = UIHelper.getCSSColorByMessageType(messageType);
10
+ cssClasses = cssMessageType
11
+ ? `twa:bg-${cssMessageType} twa:text-text-on-${cssMessageType}`
12
+ : '';
13
+ }
7
14
  return {
8
15
  color: buttonTextColor,
9
16
  background: buttonBackground,
17
+ cssClasses,
10
18
  };
11
19
  };
@@ -38,24 +38,36 @@ class BulkUpdateViewPanelComponent extends React.Component {
38
38
  let statusColour = this.getStatusColour();
39
39
  let selectedColumn = this.props.BulkUpdateValidationResult.Column;
40
40
  let previewPanel = (React.createElement(PreviewResultsPanel, { previewInfo: this.props.PreviewInfo, api: this.props.api, selectedColumn: selectedColumn, showPanel: true, showHeader: false }));
41
- let shouldDisable = this.props.accessLevel == 'ReadOnly' ||
41
+ const valueSelectorDisabled = this.props.accessLevel == 'ReadOnly' ||
42
42
  !this.props.BulkUpdateValidationResult.IsValid ||
43
- this.props.api.layoutApi.isCurrentLayoutPivot() == true;
43
+ this.props.api.layoutApi.isCurrentLayoutPivot();
44
+ const valueOperationDisabled = valueSelectorDisabled ||
45
+ StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
46
+ (this.props.PreviewInfo != null &&
47
+ this.props.PreviewInfo.previewValidationSummary.validationResult == 'All');
44
48
  const applyStyle = {
45
49
  color: statusColour,
46
50
  fill: 'currentColor',
47
51
  };
48
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
49
- return (React.createElement(Flex, { flexDirection: "row", className: clsx(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap twa:min-w-[150px]`), flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
50
- React.createElement(Flex, null,
52
+ const isToolbar = this.props.viewType === 'Toolbar';
53
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
54
+ const messageStyle = UIHelper.getMessageTypeByStatusColour(statusColour);
55
+ const infoStyle = messageStyle === 'Success' ? 'Info' : messageStyle;
56
+ return (React.createElement(Flex, { className: clsx(valueSelectorDisabled ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap twa:gap-1 twa:flex-row`, {
57
+ 'twa:min-w-[300px] twa:max-w-[300px] twa:w-[300px] twa:flex-nowrap': isToolbar,
58
+ 'twa:flex-1 twa:flex-wrap': !isToolbar,
59
+ }), flexWrap: isToolbar ? 'nowrap' : 'wrap' },
60
+ React.createElement(Flex, { className: clsx('twa:flex-1', {
61
+ 'twa:min-w-[100px]': !isToolbar,
62
+ 'twa:min-w-0': isToolbar,
63
+ }) },
51
64
  React.createElement(BulkUpdateValueSelector, { selectedGridCells: this.props.SelectedGridCells, newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
52
65
  listMinWidth: 160,
53
- }, className: `ab-${elementType}__BulkUpdate__select`, disabled: shouldDisable, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: selectedColumn, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns) })),
54
- React.createElement(Flex, null,
55
- !shouldDisable && StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(ButtonApply, { className: `ab-${elementType}__BulkUpdate__apply twa:ml-2`, onClick: () => this.onApplyClick(), style: applyStyle, tooltip: "Apply Bulk Update", disabled: StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
56
- (this.props.PreviewInfo != null &&
57
- this.props.PreviewInfo.previewValidationSummary.validationResult == 'All'), accessLevel: this.props.accessLevel }, this.props.viewType === 'ToolPanel' && 'Update')),
58
- !shouldDisable && StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(AdaptablePopover, { popoverMinWidth: 360, className: `ab-${elementType}__BulkUpdate__info`, headerText: "Preview Results", bodyText: [previewPanel], MessageType: UIHelper.getMessageTypeByStatusColour(statusColour), useButton: true, showEvent: 'focus', hideEvent: "blur" })))));
66
+ }, className: `ab-${elementType}__BulkUpdate__select twa:w-full`, disabled: valueSelectorDisabled, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: selectedColumn, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns) })),
67
+ React.createElement(Flex, { className: "twa:flex-shrink-0 twa:gap-1" },
68
+ React.createElement(Flex, { className: "twa:flex twa:box-border twa:items-center" },
69
+ React.createElement(ButtonApply, { className: `ab-${elementType}__BulkUpdate__apply twa:h-full`, onClick: () => this.onApplyClick(), style: applyStyle, tooltip: "Apply Bulk Update", disabled: valueOperationDisabled, accessLevel: this.props.accessLevel }, 'Apply')),
70
+ React.createElement(AdaptablePopover, { popoverMinWidth: 360, className: `ab-${elementType}__BulkUpdate__info`, headerText: "Preview Results", bodyText: [previewPanel], MessageType: infoStyle, useButton: true, showEvent: 'focus', hideEvent: "blur", disabled: valueSelectorDisabled || StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) }))));
59
71
  }
60
72
  onColumnValueSelectedChanged(selectedColumnValue) {
61
73
  this.props.onBulkUpdateValueChange(selectedColumnValue);
@@ -17,11 +17,11 @@ export const isValidCalculatedColumnExpression = (data, api) => {
17
17
  const calculatedColumnExpressionService = api.internalApi.getCalculatedColumnExpressionService();
18
18
  const expression = api.expressionApi.getAdaptableQueryExpression(data.Query)?.trim();
19
19
  if (!expression) {
20
- return 'Calculated column expression cannot be empty';
20
+ return 'Calculated Column Expression cannot be empty';
21
21
  }
22
22
  const isValid = calculatedColumnExpressionService.isCalculatedColumnQueryValid(data.Query);
23
23
  if (!isValid) {
24
- return 'Calculated column expression is not valid';
24
+ return 'Calculated Column Expression is not valid';
25
25
  }
26
26
  return true;
27
27
  };
@@ -9,6 +9,7 @@ import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
9
9
  import { connect } from 'react-redux';
10
10
  import { Select } from '../../components/Select';
11
11
  import { Flex } from '../../components/Flex';
12
+ import clsx from 'clsx';
12
13
  class CellSummaryViewPanelComponent extends React.Component {
13
14
  cleanupEvent;
14
15
  constructor(props) {
@@ -44,30 +45,27 @@ class CellSummaryViewPanelComponent extends React.Component {
44
45
  });
45
46
  let cellSummaryPopover = React.createElement(CellSummaryPopover, { CellSummary: this.props.CellSummary });
46
47
  let shouldDisable = this.props.accessLevel == 'ReadOnly' || this.props.CellSummary == null;
47
- const renderOperationValue = () => {
48
- if (shouldDisable) {
49
- return;
50
- }
51
- const operationValue = this.getOperationValue();
52
- if (operationValue == undefined) {
53
- return;
54
- }
55
- return this.props.viewType === 'ToolPanel' ? (React.createElement(Flex, { className: `ab-${elementType}__CellSummary__value twa:rounded-standard twa:mr-2 twa:p-2 twa:text-text-on-info twa:bg-info twa:text-2` }, operationValue)) : (React.createElement(Flex, { justifyContent: "center", className: `ab-${elementType}__CellSummary__value twa:flex-1 twa:mr-2 twa:ml-1 text-text-on-primary` }, operationValue));
56
- };
57
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
58
- return (React.createElement(Flex, { flexDirection: "row", className: shouldDisable ? GeneralConstants.READ_ONLY_STYLE : `ab-${elementType}__CellSummary__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
48
+ const isToolbar = this.props.viewType === 'Toolbar';
49
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
50
+ const operationValue = this.getOperationValue() ?? 'N/A';
51
+ return (React.createElement(Flex, { className: clsx(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__CellSummary__wrap twa:gap-2 twa:flex-row`, {
52
+ 'twa:min-w-[215px] twa:max-w-[215px] twa:w-[215px] twa:flex-nowrap': isToolbar,
53
+ 'twa:flex-1 twa:flex-wrap': !isToolbar,
54
+ }) },
59
55
  React.createElement(Flex, { className: "twa:flex-1" },
60
56
  React.createElement(Select, { "aria-label": "Cell Summary Operation Selector", className: `ab-${elementType}__CellSummary__select twa:w-full`, disabled: shouldDisable, options: [...operationMenuItems, ...operationDefinitions], onChange: (x) => this.props.onCellSummaryOperationChange(x), value: this.props.CellSummaryOperation })),
61
- React.createElement(Flex, { alignItems: "center", className: "twa:ml-2" }, React.createElement(React.Fragment, null,
62
- renderOperationValue(),
63
- this.props.CellSummary != null && this.props.CellSummary.Count > 0 && (React.createElement(AdaptablePopover, { popoverMaxWidth: 360, className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur", tooltipText: 'Show Cell Summaries' }))))));
57
+ React.createElement(Flex, { className: "twa:items-center twa:gap-1" }, React.createElement(React.Fragment, null,
58
+ React.createElement(Flex, { className: clsx(`ab-${elementType}__CellSummary__value twa:min-w-[50px]`, {
59
+ 'twa:rounded-standard twa:text-color-text-on-info twa:bg-color-info twa:text-2': !isToolbar,
60
+ 'twa:flex-1 twa:text-color-text-on-primary twa:justify-center': isToolbar,
61
+ }) }, operationValue),
62
+ React.createElement(AdaptablePopover, { popoverMaxWidth: 360, className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur", tooltipText: 'Show Cell Summaries', disabled: !this.props.CellSummary?.Count })))));
64
63
  }
65
64
  checkSelectedCells() {
66
65
  this.props.onCreateCellSummary();
67
66
  }
68
67
  getOperationValue() {
69
- const api = this.props.api;
70
- return api.cellSummaryApi.getCellSummaryOperationValue(this.props.CellSummaryOperation);
68
+ return this.props.api.cellSummaryApi.getCellSummaryOperationValue(this.props.CellSummaryOperation);
71
69
  }
72
70
  }
73
71
  function mapStateToProps(state, ownProps) {
@@ -8,7 +8,7 @@ const AdaptableDateInput = React.forwardRef(function AdaptableDateInputCmp(props
8
8
  const { value: _, defaultValue: __, onChange, required, disabled, showClearButton, ...inputProps } = props;
9
9
  const [value, setValue] = useProperty(props, 'value', undefined, {
10
10
  onChange: (dateString) =>
11
- // wrap date value in FormEvent in order to keep the external API unchanged
11
+ // wrap date value in ChangeEvent in order to keep the external API unchanged
12
12
  props.onChange?.({
13
13
  target: {
14
14
  // ALWAYS trigger onChange with the ISO format
@@ -2,6 +2,6 @@ import * as React from 'react';
2
2
  import SimpleButton from '../../../components/SimpleButton';
3
3
  export class ButtonApply extends React.Component {
4
4
  render() {
5
- return (React.createElement(SimpleButton, { "data-name": "apply", tooltip: "Apply", iconSize: 20, icon: "check", variant: "text", ...this.props }));
5
+ return (React.createElement(SimpleButton, { "data-name": "apply", tooltip: "Apply", iconSize: 20, icon: "check", variant: "outlined", ...this.props }));
6
6
  }
7
7
  }
@@ -3,6 +3,7 @@ import { SimpleButtonProps } from '../../../components/SimpleButton';
3
3
  export interface ClearButtonProps extends SimpleButtonProps {
4
4
  showText?: boolean;
5
5
  showIcon?: boolean;
6
+ variant?: SimpleButtonProps['variant'];
6
7
  }
7
8
  export declare class ButtonClear extends React.Component<ClearButtonProps, {}> {
8
9
  render(): React.JSX.Element;
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
- import FieldWrap from '../../../components/FieldWrap';
2
+ import { useCallback } from 'react';
3
+ import DropdownButton from '../../../components/DropdownButton';
3
4
  import UIHelper from '../../UIHelper';
4
5
  import AdaptableInput from '../AdaptableInput';
5
6
  import { PermittedValuesSelector } from './PermittedValuesSelector';
6
- import { Select } from '../../../components/Select';
7
7
  import { useAdaptable } from '../../AdaptableContext';
8
- import { useCallback } from 'react';
9
8
  import clsx from 'clsx';
10
- import { Box } from '../../../components/Flex';
9
+ import { Box, Flex } from '../../../components/Flex';
10
+ import { Icon } from '../../../components/icons';
11
+ import { InputGroup } from '../../../components/InputGroup';
11
12
  export const BulkUpdateValueSelector = (props) => {
12
13
  const [valueType, setValueType] = React.useState('existing');
13
14
  const adaptable = useAdaptable();
@@ -17,8 +18,8 @@ export const BulkUpdateValueSelector = (props) => {
17
18
  // TODO = this seems to be called whenever we edit a cell
18
19
  // which is then triggering a get all values
19
20
  // not sure that we need to
20
- const permittedValueSelector = (React.createElement(Box, null,
21
- React.createElement(PermittedValuesSelector, { allowNewValues: true, searchable: 'inline', disabled: props.disabled || !props.selectedColumn, value: props.selectedColumnValue === '' ? null : props.selectedColumnValue, columnId: columnId, placeholder: isDateType ? 'Select' : 'Select or type new value', loadValues: useCallback(({ currentSearchValue }) => {
21
+ const permittedValueSelector = (React.createElement(Box, { className: 'twa:flex-1' },
22
+ React.createElement(PermittedValuesSelector, { allowNewValues: true, searchable: 'inline', disabled: props.disabled || !props.selectedColumn, value: props.selectedColumnValue === '' ? null : props.selectedColumnValue, columnId: columnId, placeholder: 'Select value', loadValues: useCallback(({ currentSearchValue }) => {
22
23
  if (!columnId || !props.selectedGridCells.length) {
23
24
  return Promise.resolve([]);
24
25
  }
@@ -41,16 +42,16 @@ export const BulkUpdateValueSelector = (props) => {
41
42
  : 'Enter Value', autoFocus: true, disabled: props.disabled, className: "twa:w-full", value: props.selectedColumnValue, onChange: (e) => {
42
43
  props.onColumnValueChange(e.target.value);
43
44
  } }));
44
- let valueTypeSelector = null;
45
- if (isDateType) {
46
- valueTypeSelector = (React.createElement(Select, { "aria-label": "Bulk Update Value Selector", options: [
47
- { label: 'New', value: 'new' },
48
- { label: 'Existing', value: 'existing' },
49
- ], value: valueType, onChange: (value) => {
50
- setValueType(value);
51
- } }));
52
- }
53
- return (React.createElement(FieldWrap, { className: clsx('twa:overflow-visible twa:max-w-full', props.className), style: props.style }, isDateType ? (React.createElement(React.Fragment, null,
54
- valueType === 'new' ? input : permittedValueSelector,
55
- valueTypeSelector)) : (permittedValueSelector)));
45
+ return (React.createElement(Flex, { className: clsx('twa:overflow-visible twa:max-w-full', props.className), style: props.style }, isDateType ? (React.createElement(React.Fragment, null,
46
+ React.createElement(InputGroup, { Component: Flex, "data-id": "bulk-update-input-wrapper", className: "twa:w-full" },
47
+ React.createElement(DropdownButton, { "aria-label": "Bulk Update Value Selector", "data-id": "bulk-update-value-type-selector", "data-value": valueType, columns: ['label'], variant: "outlined", tone: "neutral", items: [
48
+ { label: 'New', icon: React.createElement(Icon, { name: "edit" }), onClick: () => setValueType('new') },
49
+ {
50
+ label: 'Existing',
51
+ icon: React.createElement(Icon, { name: "grid" }),
52
+ onClick: () => setValueType('existing'),
53
+ },
54
+ ] },
55
+ React.createElement(React.Fragment, null, valueType === 'existing' ? React.createElement(Icon, { name: "grid" }) : React.createElement(Icon, { name: "edit" }))),
56
+ valueType === 'new' ? input : permittedValueSelector))) : (permittedValueSelector)));
56
57
  };