@adaptabletools/adaptable-cjs 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 +18 -17
  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 +16 -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 +31 -0
  60. package/src/types.d.ts +1 -1
  61. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -99,6 +99,22 @@ class GridApiImpl extends ApiBase_1.ApiBase {
99
99
  }
100
100
  return [];
101
101
  }
102
+ async manageGridData(dataRows, config) {
103
+ const transactionResult = await this._adaptable.manageGridRows(dataRows, config);
104
+ if (Array.isArray(transactionResult.removedRows) && transactionResult.removedRows.length) {
105
+ const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.delete, transactionResult.removedRows, 'Delete');
106
+ this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
107
+ }
108
+ if (Array.isArray(transactionResult.updatedRows) && transactionResult.updatedRows.length) {
109
+ const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.update, transactionResult.updatedRows, 'Update');
110
+ this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
111
+ }
112
+ if (Array.isArray(transactionResult.addedRows) && transactionResult.addedRows.length) {
113
+ const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.add, transactionResult.addedRows, 'Add');
114
+ this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
115
+ }
116
+ return transactionResult;
117
+ }
102
118
  setCellValue(cellUpdateRequest) {
103
119
  const abColumn = this.getColumnApi().getColumnWithColumnId(cellUpdateRequest.columnId);
104
120
  if (!abColumn) {
@@ -688,21 +704,5 @@ class GridApiImpl extends ApiBase_1.ApiBase {
688
704
  .filter(Boolean);
689
705
  this.setAgGridColumnDefinitions([...sanitizedColDefs, newColumnDefinition]);
690
706
  }
691
- async applyGridDataTransaction(dataTransaction, config) {
692
- const transactionResult = await this._adaptable.applyGridDataTransaction(dataTransaction, config);
693
- if (Array.isArray(transactionResult.removedRows) && transactionResult.removedRows.length) {
694
- const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataTransaction.remove, transactionResult.removedRows, 'Delete');
695
- this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
696
- }
697
- if (Array.isArray(transactionResult.updatedRows) && transactionResult.updatedRows.length) {
698
- const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataTransaction.update, transactionResult.updatedRows, 'Update');
699
- this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
700
- }
701
- if (Array.isArray(transactionResult.addedRows) && transactionResult.addedRows.length) {
702
- const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataTransaction.add, transactionResult.addedRows, 'Add');
703
- this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
704
- }
705
- return transactionResult;
706
- }
707
707
  }
708
708
  exports.GridApiImpl = GridApiImpl;
@@ -282,7 +282,7 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
282
282
  getQueryableColumnsForUIEditor() {
283
283
  return this.getColumnApi()
284
284
  .getQueryableColumns()
285
- .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn);
285
+ .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn && !column.isGeneratedSelectionColumn);
286
286
  }
287
287
  isAlwaysHiddenColumn(columnIdentifier) {
288
288
  return this.getColumnApi().hasColumnType(columnIdentifier, AdaptableColumn_1.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
@@ -45,15 +45,6 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
45
45
  .getFormatColumns(config)
46
46
  .filter((fc) => fc.Style);
47
47
  }
48
- /**
49
- * Retrieves all Format Columns in Adaptable State with the `Style` or the `CellAlignment` property set
50
- * @returns format columns
51
- */
52
- getAllFormatColumnWithStyleAndCellAlignment(config) {
53
- return this.getFormatColumnApi()
54
- .getFormatColumns(config)
55
- .filter((fc) => fc.Style || fc.CellAlignment);
56
- }
57
48
  /**
58
49
  * Retrieves all Format Columns in Adaptable State with `DisplayFormat` property set
59
50
  * @returns format columns
@@ -63,15 +54,6 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
63
54
  .getFormatColumns(config)
64
55
  .filter((fc) => fc.DisplayFormat);
65
56
  }
66
- /**
67
- * Retrieves all Format Columns in Adaptable State with `CellAlignment` property set
68
- * @returns format columns
69
- */
70
- getAllFormatColumnWithCellAlignment(config) {
71
- return this.getFormatColumnApi()
72
- .getFormatColumns(config)
73
- .filter((fc) => fc.CellAlignment);
74
- }
75
57
  /**
76
58
  * Get all FormatColumns which are defined for this column and have a custom AdaptableStyle
77
59
  * @param column
@@ -79,7 +61,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
79
61
  * @returns list of FormatColumn
80
62
  */
81
63
  getFormatColumnsWithStyleForColumn(column, config) {
82
- const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment()
64
+ const formatColumns = this.getAllFormatColumnWithStyle()
83
65
  .filter((formatColumn) => {
84
66
  // FormatColumn default target is 'cell', so if no target is specified, we assume 'cell'
85
67
  const fcTarget = formatColumn.Target ?? 'cell';
@@ -51,7 +51,7 @@ const GetNoteSelector = (state, address) => {
51
51
  // happy check
52
52
  return true;
53
53
  }
54
- // Primary keys retreived from the grid dom are always strings, so we must also consider them strings
54
+ // Primary keys retrieved from the grid dom are always strings, so we must also consider them strings
55
55
  if ((typeof address.PrimaryKeyValue === 'number' && typeof note.PrimaryKeyValue === 'string') ||
56
56
  (typeof address.PrimaryKeyValue === 'string' && typeof note.PrimaryKeyValue === 'number')) {
57
57
  return (note.PrimaryKeyValue.toString() === address.PrimaryKeyValue.toString() &&
@@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFormatColumnSettingsViewItems = void 0;
4
4
  const getFormatColumnSettingsViewItems = (formatColumn) => {
5
5
  let values = [];
6
- if (formatColumn.CellAlignment) {
7
- values.push(`Cell Alignment: ${formatColumn.CellAlignment}`);
8
- }
9
6
  if (formatColumn.RowScope) {
10
7
  if (formatColumn.RowScope.ExcludeDataRows) {
11
8
  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";
@@ -16,7 +16,7 @@ exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/adaptable-predicate`;
16
16
  exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/getting-started-primary-key`;
17
17
  exports.LicenseDocsLink = `${exports.HOST_URL_ROOT}/buy/buying-adaptable-licensing`;
18
18
  exports.AdaptableOptionsDocsLink = `${exports.HOST_URL_DOCS}/technical-reference-adaptable-options`;
19
- exports.AgGridModulesDocsLink = `${exports.HOST_URL_DOCS}/dev-guide-aggrid-modules-overview`;
19
+ exports.AgGridModulesDocsLink = `${exports.HOST_URL_DOCS}/getting-started-aggrid-modules`;
20
20
  exports.AlertMessageDocsLink = `${exports.HOST_URL_DOCS}/handbook-alerting-message`;
21
21
  exports.FormatColumnPlaceholderDocsLink = `${exports.HOST_URL_DOCS}/handbook-column-formatting-display-format-placeholder`;
22
- exports.AgGridRequiredModulesDocsLink = `${exports.HOST_URL_DOCS}/dev-guide-aggrid-modules-overview#mandatory-modules`;
22
+ exports.AgGridRequiredModulesDocsLink = `${exports.HOST_URL_DOCS}/getting-started-aggrid-modules#mandatory-modules`;
@@ -643,7 +643,7 @@ exports.scalarExpressionFunctions = {
643
643
  }
644
644
  return result;
645
645
  },
646
- description: "Returns the percentage difference between a cell's current value and its previous value.",
646
+ description: "Returns percentage difference between a cell's current value and previous value",
647
647
  signatures: [
648
648
  'PERCENT_CHANGE( [colName], <INCREASE|DECREASE> )',
649
649
  'PERCENT_CHANGE( COL(name: string), <INCREASE|DECREASE> )',
@@ -688,7 +688,7 @@ exports.scalarExpressionFunctions = {
688
688
  }
689
689
  return result;
690
690
  },
691
- description: "Returns the absolute difference between a cell's current value and its previous value.",
691
+ description: "Returns absolute difference between a cell's current value and previous value",
692
692
  signatures: [
693
693
  'ABSOLUTE_CHANGE( [colName] )',
694
694
  'ABSOLUTE_CHANGE( COL(name: string) )',
@@ -720,7 +720,7 @@ exports.scalarExpressionFunctions = {
720
720
  const previousValue = context.dataChangedEvent.oldValue;
721
721
  return currentColumnValue !== previousValue;
722
722
  },
723
- 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.",
723
+ 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",
724
724
  signatures: ['ANY_CHANGE( [colName] )', 'ANY_CHANGE()'],
725
725
  examples: ['ANY_CHANGE([col1])', 'ANY_CHANGE()'],
726
726
  category: 'changes',
@@ -85,6 +85,20 @@ const convertAdaptableStyleToCSS = (style) => {
85
85
  break;
86
86
  }
87
87
  }
88
+ if (style.Alignment) {
89
+ switch (style.Alignment) {
90
+ case 'Default':
91
+ case 'Left':
92
+ result.textAlign = 'left';
93
+ break;
94
+ case 'Right':
95
+ result.textAlign = 'right';
96
+ break;
97
+ case 'Center':
98
+ result.textAlign = 'center';
99
+ break;
100
+ }
101
+ }
88
102
  // assertion added to comply with the ag-Grid types
89
103
  return result;
90
104
  };
@@ -270,7 +270,6 @@ function CreateEmptyFormatColumn() {
270
270
  Scope: undefined,
271
271
  Style: CreateEmptyStyle(),
272
272
  DisplayFormat: undefined,
273
- CellAlignment: undefined,
274
273
  RowScope: undefined,
275
274
  Target: 'cell',
276
275
  };
@@ -334,6 +333,7 @@ function CreateEmptyStyle() {
334
333
  FontStyle: undefined,
335
334
  FontSize: undefined,
336
335
  ClassName: undefined,
336
+ Alignment: undefined,
337
337
  };
338
338
  }
339
339
  function CreateSystemStatusMessageInfo(message, type, furtherInfo) {
@@ -32,7 +32,7 @@ class AnnotationsService {
32
32
  if (a?.ColumnId === b?.ColumnId && a?.PrimaryKeyValue === b?.PrimaryKeyValue) {
33
33
  return true;
34
34
  }
35
- // Primary keys retreived from the grid dom are always strings, so we must also consider them strings
35
+ // Primary keys retrieved from the grid dom are always strings, so we must also consider them strings
36
36
  if ((typeof a.PrimaryKeyValue === 'number' && typeof b.PrimaryKeyValue === 'string') ||
37
37
  (typeof b.PrimaryKeyValue === 'string' && typeof a.PrimaryKeyValue === 'number')) {
38
38
  return (a.PrimaryKeyValue.toString() === b.PrimaryKeyValue.toString() && a.ColumnId === b.ColumnId);
@@ -118,13 +118,13 @@ class ModuleService {
118
118
  case 'CalculatedColumn':
119
119
  return url + 'handbook-calculated-column';
120
120
  case 'CellSummary':
121
- return url + 'handbook-summarising';
121
+ return url + 'handbook-summarising-cells';
122
122
  case 'Charting':
123
123
  return url + 'handbook-charts';
124
124
  case 'ColumnFilter':
125
125
  return url + 'handbook-column-filter';
126
126
  case 'ColumnInfo':
127
- return url + 'dev-guide-column-grid-column-info';
127
+ return url + 'dev-guide-columns-column-info';
128
128
  case 'Comment':
129
129
  return url + 'handbook-comments';
130
130
  case 'CustomSort':
@@ -150,7 +150,7 @@ class ModuleService {
150
150
  case 'GridFilter':
151
151
  return url + 'handbook-grid-filter';
152
152
  case 'GridInfo':
153
- return url + 'dev-guide-column-grid-column-info';
153
+ return url + 'dev-guide-support-monitoring';
154
154
  case 'Layout':
155
155
  return url + 'handbook-layouts';
156
156
  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;
@@ -39,7 +39,7 @@ class AdaptablePopover extends React.Component {
39
39
  // showTriangle
40
40
  visible: this.props.visible, render: () => popoverClickRootClose, showEvent: (this.props.showEvent || 'mouseenter'), hideEvent: (this.props.hideEvent || 'mouseleave'), style: {
41
41
  overflow: 'visible',
42
- }, alignPosition: this.props.alignPosition }, useButton ? (React.createElement(ButtonInfo_1.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' } },
42
+ }, alignPosition: this.props.alignPosition }, useButton ? (React.createElement(ButtonInfo_1.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' } },
43
43
  this.props.children,
44
44
  showIcon && React.createElement(icons_1.Icon, { name: icon, style: iconStyle }))))));
45
45
  }
@@ -11,6 +11,14 @@ const ActiveAlertsPanel = () => {
11
11
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
12
12
  const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.AlertModuleId);
13
13
  const alerts = (0, react_redux_1.useSelector)((state) => state.Internal.AdaptableAlerts);
14
+ // map the suspended property from the underlying AlertDefinitions
15
+ alerts.forEach((alert) => {
16
+ const liveAlertDef = adaptable.api.alertApi.getAlertDefinitionById(alert.alertDefinition.Uuid);
17
+ if (liveAlertDef) {
18
+ // @ts-ignore theoretically AdaptableAlert is not Suspendable; practically <AdaptableObjectCompactList> expects it
19
+ alert.IsSuspended = liveAlertDef.IsSuspended;
20
+ }
21
+ });
14
22
  return React.createElement(AdaptableObjectCompactList_1.AdaptableObjectCompactList, { abObjects: alerts, module: filterModule });
15
23
  };
16
24
  exports.ActiveAlertsPanel = ActiveAlertsPanel;
@@ -6,10 +6,11 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
7
  const InternalRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/InternalRedux"));
8
8
  const AdaptablePopover_1 = require("../AdaptablePopover");
9
- const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
10
9
  const getAlertButtonStyle_1 = require("./Utilities/getAlertButtonStyle");
11
10
  const ActiveAlertsPanel_1 = require("./ActiveAlertsPanel");
12
11
  const Flex_1 = require("../../components/Flex");
12
+ const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
13
+ const clsx_1 = tslib_1.__importDefault(require("clsx"));
13
14
  class AlertViewPanelComponent extends React.Component {
14
15
  constructor(props) {
15
16
  super(props);
@@ -24,7 +25,6 @@ class AlertViewPanelComponent extends React.Component {
24
25
  }
25
26
  }
26
27
  render() {
27
- const messageType = UIHelper_1.default.getMessageTypeFromAdaptableAlerts(this.props.AdaptableAlerts);
28
28
  const { color: buttonTextColor, background: buttonBackground } = (0, getAlertButtonStyle_1.getAlertButtonStyle)(this.props.AdaptableAlerts);
29
29
  const collapsedText = this.props.AdaptableAlerts.length == 0
30
30
  ? '0 Alerts'
@@ -32,13 +32,17 @@ class AlertViewPanelComponent extends React.Component {
32
32
  ? '1 Alert'
33
33
  : this.props.AdaptableAlerts.length + ' Alerts';
34
34
  const alertsPanel = React.createElement(ActiveAlertsPanel_1.ActiveAlertsPanel, null);
35
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
36
- return (React.createElement(Flex_1.Flex, { alignItems: "stretch", className: `ab-${elementType}__Alert__wrap` },
37
- React.createElement(Flex_1.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),
38
- this.props.AdaptableAlerts.length > 0 && (React.createElement(Flex_1.Flex, { alignItems: "center" },
39
- React.createElement(AdaptablePopover_1.AdaptablePopover, { className: `ab-${elementType}__Alert__info`, headerText: "",
40
- // tooltipText="Alerts"
41
- bodyText: [alertsPanel], MessageType: messageType, useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })))));
35
+ const isToolbar = this.props.viewType === 'Toolbar';
36
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
37
+ return (React.createElement(Flex_1.Flex, { alignItems: "stretch", className: (0, clsx_1.default)(`ab-${elementType}__Alert__wrap twa:gap-1`, {
38
+ 'twa:min-w-[140px] twa:w-[140px]': isToolbar,
39
+ [`twa:flex-1`]: !isToolbar,
40
+ }) },
41
+ React.createElement(Flex_1.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),
42
+ this.props.AdaptableAlerts.length > 0 && (React.createElement(Flex_1.Flex, { className: 'twa:gap-1' },
43
+ React.createElement(Flex_1.Flex, { className: "twa:flex twa:box-border" },
44
+ React.createElement(ButtonClear_1.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')),
45
+ React.createElement(AdaptablePopover_1.AdaptablePopover, { className: `ab-${elementType}__Alert__info`, headerText: "Alerts Details", bodyText: [alertsPanel], MessageType: 'Info', useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })))));
42
46
  }
43
47
  }
44
48
  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
  };
@@ -8,9 +8,17 @@ const getAlertButtonStyle = (alerts) => {
8
8
  const messageTypeColor = UIHelper_1.default.getColorByMessageType(messageType);
9
9
  const buttonBackground = UIHelper_1.default.getButtonColourForAdaptableAlerts(alerts, messageTypeColor);
10
10
  const buttonTextColor = UIHelper_1.default.getButtonTextColourForArrayandMessageType(alerts, messageType);
11
+ let cssClasses = '';
12
+ if (alerts?.length) {
13
+ const cssMessageType = UIHelper_1.default.getCSSColorByMessageType(messageType);
14
+ cssClasses = cssMessageType
15
+ ? `twa:bg-${cssMessageType} twa:text-text-on-${cssMessageType}`
16
+ : '';
17
+ }
11
18
  return {
12
19
  color: buttonTextColor,
13
20
  background: buttonBackground,
21
+ cssClasses,
14
22
  };
15
23
  };
16
24
  exports.getAlertButtonStyle = getAlertButtonStyle;
@@ -42,24 +42,36 @@ class BulkUpdateViewPanelComponent extends React.Component {
42
42
  let statusColour = this.getStatusColour();
43
43
  let selectedColumn = this.props.BulkUpdateValidationResult.Column;
44
44
  let previewPanel = (React.createElement(PreviewResultsPanel_1.PreviewResultsPanel, { previewInfo: this.props.PreviewInfo, api: this.props.api, selectedColumn: selectedColumn, showPanel: true, showHeader: false }));
45
- let shouldDisable = this.props.accessLevel == 'ReadOnly' ||
45
+ const valueSelectorDisabled = this.props.accessLevel == 'ReadOnly' ||
46
46
  !this.props.BulkUpdateValidationResult.IsValid ||
47
- this.props.api.layoutApi.isCurrentLayoutPivot() == true;
47
+ this.props.api.layoutApi.isCurrentLayoutPivot();
48
+ const valueOperationDisabled = valueSelectorDisabled ||
49
+ StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
50
+ (this.props.PreviewInfo != null &&
51
+ this.props.PreviewInfo.previewValidationSummary.validationResult == 'All');
48
52
  const applyStyle = {
49
53
  color: statusColour,
50
54
  fill: 'currentColor',
51
55
  };
52
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
53
- return (React.createElement(Flex_1.Flex, { flexDirection: "row", className: (0, clsx_1.default)(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap twa:min-w-[150px]`), flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
54
- React.createElement(Flex_1.Flex, null,
56
+ const isToolbar = this.props.viewType === 'Toolbar';
57
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
58
+ const messageStyle = UIHelper_1.UIHelper.getMessageTypeByStatusColour(statusColour);
59
+ const infoStyle = messageStyle === 'Success' ? 'Info' : messageStyle;
60
+ return (React.createElement(Flex_1.Flex, { className: (0, clsx_1.default)(valueSelectorDisabled ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap twa:gap-1 twa:flex-row`, {
61
+ 'twa:min-w-[300px] twa:max-w-[300px] twa:w-[300px] twa:flex-nowrap': isToolbar,
62
+ 'twa:flex-1 twa:flex-wrap': !isToolbar,
63
+ }), flexWrap: isToolbar ? 'nowrap' : 'wrap' },
64
+ React.createElement(Flex_1.Flex, { className: (0, clsx_1.default)('twa:flex-1', {
65
+ 'twa:min-w-[100px]': !isToolbar,
66
+ 'twa:min-w-0': isToolbar,
67
+ }) },
55
68
  React.createElement(BulkUpdateValueSelector_1.BulkUpdateValueSelector, { selectedGridCells: this.props.SelectedGridCells, newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
56
69
  listMinWidth: 160,
57
- }, className: `ab-${elementType}__BulkUpdate__select`, disabled: shouldDisable, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: selectedColumn, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns) })),
58
- React.createElement(Flex_1.Flex, null,
59
- !shouldDisable && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(ButtonApply_1.ButtonApply, { className: `ab-${elementType}__BulkUpdate__apply twa:ml-2`, onClick: () => this.onApplyClick(), style: applyStyle, tooltip: "Apply Bulk Update", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
60
- (this.props.PreviewInfo != null &&
61
- this.props.PreviewInfo.previewValidationSummary.validationResult == 'All'), accessLevel: this.props.accessLevel }, this.props.viewType === 'ToolPanel' && 'Update')),
62
- !shouldDisable && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 360, className: `ab-${elementType}__BulkUpdate__info`, headerText: "Preview Results", bodyText: [previewPanel], MessageType: UIHelper_1.UIHelper.getMessageTypeByStatusColour(statusColour), useButton: true, showEvent: 'focus', hideEvent: "blur" })))));
70
+ }, 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) })),
71
+ React.createElement(Flex_1.Flex, { className: "twa:flex-shrink-0 twa:gap-1" },
72
+ React.createElement(Flex_1.Flex, { className: "twa:flex twa:box-border twa:items-center" },
73
+ React.createElement(ButtonApply_1.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')),
74
+ React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 360, className: `ab-${elementType}__BulkUpdate__info`, headerText: "Preview Results", bodyText: [previewPanel], MessageType: infoStyle, useButton: true, showEvent: 'focus', hideEvent: "blur", disabled: valueSelectorDisabled || StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) }))));
63
75
  }
64
76
  onColumnValueSelectedChanged(selectedColumnValue) {
65
77
  this.props.onBulkUpdateValueChange(selectedColumnValue);
@@ -22,11 +22,11 @@ const isValidCalculatedColumnExpression = (data, api) => {
22
22
  const calculatedColumnExpressionService = api.internalApi.getCalculatedColumnExpressionService();
23
23
  const expression = api.expressionApi.getAdaptableQueryExpression(data.Query)?.trim();
24
24
  if (!expression) {
25
- return 'Calculated column expression cannot be empty';
25
+ return 'Calculated Column Expression cannot be empty';
26
26
  }
27
27
  const isValid = calculatedColumnExpressionService.isCalculatedColumnQueryValid(data.Query);
28
28
  if (!isValid) {
29
- return 'Calculated column expression is not valid';
29
+ return 'Calculated Column Expression is not valid';
30
30
  }
31
31
  return true;
32
32
  };
@@ -13,6 +13,7 @@ const InternalRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/
13
13
  const react_redux_1 = require("react-redux");
14
14
  const Select_1 = require("../../components/Select");
15
15
  const Flex_1 = require("../../components/Flex");
16
+ const clsx_1 = tslib_1.__importDefault(require("clsx"));
16
17
  class CellSummaryViewPanelComponent extends React.Component {
17
18
  cleanupEvent;
18
19
  constructor(props) {
@@ -48,30 +49,27 @@ class CellSummaryViewPanelComponent extends React.Component {
48
49
  });
49
50
  let cellSummaryPopover = React.createElement(CellSummaryPopover_1.CellSummaryPopover, { CellSummary: this.props.CellSummary });
50
51
  let shouldDisable = this.props.accessLevel == 'ReadOnly' || this.props.CellSummary == null;
51
- const renderOperationValue = () => {
52
- if (shouldDisable) {
53
- return;
54
- }
55
- const operationValue = this.getOperationValue();
56
- if (operationValue == undefined) {
57
- return;
58
- }
59
- return this.props.viewType === 'ToolPanel' ? (React.createElement(Flex_1.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_1.Flex, { justifyContent: "center", className: `ab-${elementType}__CellSummary__value twa:flex-1 twa:mr-2 twa:ml-1 text-text-on-primary` }, operationValue));
60
- };
61
- const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
62
- return (React.createElement(Flex_1.Flex, { flexDirection: "row", className: shouldDisable ? GeneralConstants.READ_ONLY_STYLE : `ab-${elementType}__CellSummary__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
52
+ const isToolbar = this.props.viewType === 'Toolbar';
53
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
54
+ const operationValue = this.getOperationValue() ?? 'N/A';
55
+ return (React.createElement(Flex_1.Flex, { className: (0, clsx_1.default)(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__CellSummary__wrap twa:gap-2 twa:flex-row`, {
56
+ 'twa:min-w-[215px] twa:max-w-[215px] twa:w-[215px] twa:flex-nowrap': isToolbar,
57
+ 'twa:flex-1 twa:flex-wrap': !isToolbar,
58
+ }) },
63
59
  React.createElement(Flex_1.Flex, { className: "twa:flex-1" },
64
60
  React.createElement(Select_1.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 })),
65
- React.createElement(Flex_1.Flex, { alignItems: "center", className: "twa:ml-2" }, React.createElement(React.Fragment, null,
66
- renderOperationValue(),
67
- this.props.CellSummary != null && this.props.CellSummary.Count > 0 && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMaxWidth: 360, className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur", tooltipText: 'Show Cell Summaries' }))))));
61
+ React.createElement(Flex_1.Flex, { className: "twa:items-center twa:gap-1" }, React.createElement(React.Fragment, null,
62
+ React.createElement(Flex_1.Flex, { className: (0, clsx_1.default)(`ab-${elementType}__CellSummary__value twa:min-w-[50px]`, {
63
+ 'twa:rounded-standard twa:text-color-text-on-info twa:bg-color-info twa:text-2': !isToolbar,
64
+ 'twa:flex-1 twa:text-color-text-on-primary twa:justify-center': isToolbar,
65
+ }) }, operationValue),
66
+ React.createElement(AdaptablePopover_1.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 })))));
68
67
  }
69
68
  checkSelectedCells() {
70
69
  this.props.onCreateCellSummary();
71
70
  }
72
71
  getOperationValue() {
73
- const api = this.props.api;
74
- return api.cellSummaryApi.getCellSummaryOperationValue(this.props.CellSummaryOperation);
72
+ return this.props.api.cellSummaryApi.getCellSummaryOperationValue(this.props.CellSummaryOperation);
75
73
  }
76
74
  }
77
75
  function mapStateToProps(state, ownProps) {
@@ -11,7 +11,7 @@ const AdaptableDateInput = React.forwardRef(function AdaptableDateInputCmp(props
11
11
  const { value: _, defaultValue: __, onChange, required, disabled, showClearButton, ...inputProps } = props;
12
12
  const [value, setValue] = (0, useProperty_1.default)(props, 'value', undefined, {
13
13
  onChange: (dateString) =>
14
- // wrap date value in FormEvent in order to keep the external API unchanged
14
+ // wrap date value in ChangeEvent in order to keep the external API unchanged
15
15
  props.onChange?.({
16
16
  target: {
17
17
  // ALWAYS trigger onChange with the ISO format
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
7
7
  class ButtonApply extends React.Component {
8
8
  render() {
9
- return (React.createElement(SimpleButton_1.default, { "data-name": "apply", tooltip: "Apply", iconSize: 20, icon: "check", variant: "text", ...this.props }));
9
+ return (React.createElement(SimpleButton_1.default, { "data-name": "apply", tooltip: "Apply", iconSize: 20, icon: "check", variant: "outlined", ...this.props }));
10
10
  }
11
11
  }
12
12
  exports.ButtonApply = ButtonApply;
@@ -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;
@@ -3,15 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BulkUpdateValueSelector = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const FieldWrap_1 = tslib_1.__importDefault(require("../../../components/FieldWrap"));
6
+ const react_1 = require("react");
7
+ const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
7
8
  const UIHelper_1 = tslib_1.__importDefault(require("../../UIHelper"));
8
9
  const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
9
10
  const PermittedValuesSelector_1 = require("./PermittedValuesSelector");
10
- const Select_1 = require("../../../components/Select");
11
11
  const AdaptableContext_1 = require("../../AdaptableContext");
12
- const react_1 = require("react");
13
12
  const clsx_1 = tslib_1.__importDefault(require("clsx"));
14
13
  const Flex_1 = require("../../../components/Flex");
14
+ const icons_1 = require("../../../components/icons");
15
+ const InputGroup_1 = require("../../../components/InputGroup");
15
16
  const BulkUpdateValueSelector = (props) => {
16
17
  const [valueType, setValueType] = React.useState('existing');
17
18
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
@@ -21,8 +22,8 @@ const BulkUpdateValueSelector = (props) => {
21
22
  // TODO = this seems to be called whenever we edit a cell
22
23
  // which is then triggering a get all values
23
24
  // not sure that we need to
24
- const permittedValueSelector = (React.createElement(Flex_1.Box, null,
25
- React.createElement(PermittedValuesSelector_1.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: (0, react_1.useCallback)(({ currentSearchValue }) => {
25
+ const permittedValueSelector = (React.createElement(Flex_1.Box, { className: 'twa:flex-1' },
26
+ React.createElement(PermittedValuesSelector_1.PermittedValuesSelector, { allowNewValues: true, searchable: 'inline', disabled: props.disabled || !props.selectedColumn, value: props.selectedColumnValue === '' ? null : props.selectedColumnValue, columnId: columnId, placeholder: 'Select value', loadValues: (0, react_1.useCallback)(({ currentSearchValue }) => {
26
27
  if (!columnId || !props.selectedGridCells.length) {
27
28
  return Promise.resolve([]);
28
29
  }
@@ -45,17 +46,17 @@ const BulkUpdateValueSelector = (props) => {
45
46
  : 'Enter Value', autoFocus: true, disabled: props.disabled, className: "twa:w-full", value: props.selectedColumnValue, onChange: (e) => {
46
47
  props.onColumnValueChange(e.target.value);
47
48
  } }));
48
- let valueTypeSelector = null;
49
- if (isDateType) {
50
- valueTypeSelector = (React.createElement(Select_1.Select, { "aria-label": "Bulk Update Value Selector", options: [
51
- { label: 'New', value: 'new' },
52
- { label: 'Existing', value: 'existing' },
53
- ], value: valueType, onChange: (value) => {
54
- setValueType(value);
55
- } }));
56
- }
57
- return (React.createElement(FieldWrap_1.default, { className: (0, clsx_1.default)('twa:overflow-visible twa:max-w-full', props.className), style: props.style }, isDateType ? (React.createElement(React.Fragment, null,
58
- valueType === 'new' ? input : permittedValueSelector,
59
- valueTypeSelector)) : (permittedValueSelector)));
49
+ return (React.createElement(Flex_1.Flex, { className: (0, clsx_1.default)('twa:overflow-visible twa:max-w-full', props.className), style: props.style }, isDateType ? (React.createElement(React.Fragment, null,
50
+ React.createElement(InputGroup_1.InputGroup, { Component: Flex_1.Flex, "data-id": "bulk-update-input-wrapper", className: "twa:w-full" },
51
+ React.createElement(DropdownButton_1.default, { "aria-label": "Bulk Update Value Selector", "data-id": "bulk-update-value-type-selector", "data-value": valueType, columns: ['label'], variant: "outlined", tone: "neutral", items: [
52
+ { label: 'New', icon: React.createElement(icons_1.Icon, { name: "edit" }), onClick: () => setValueType('new') },
53
+ {
54
+ label: 'Existing',
55
+ icon: React.createElement(icons_1.Icon, { name: "grid" }),
56
+ onClick: () => setValueType('existing'),
57
+ },
58
+ ] },
59
+ React.createElement(React.Fragment, null, valueType === 'existing' ? React.createElement(icons_1.Icon, { name: "grid" }) : React.createElement(icons_1.Icon, { name: "edit" }))),
60
+ valueType === 'new' ? input : permittedValueSelector))) : (permittedValueSelector)));
60
61
  };
61
62
  exports.BulkUpdateValueSelector = BulkUpdateValueSelector;