@adaptabletools/adaptable 13.1.0-canary.1 → 13.1.1-canary.0

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 (42) hide show
  1. package/bundle.cjs.js +161 -161
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableOptions/AlertOptions.d.ts +4 -0
  6. package/src/AdaptableOptions/FinancePluginOptions.d.ts +9 -0
  7. package/src/Api/AlertApi.d.ts +5 -0
  8. package/src/Api/ColumnApi.d.ts +14 -0
  9. package/src/Api/FinanceApi.d.ts +5 -0
  10. package/src/Api/GridApi.d.ts +1 -0
  11. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -0
  12. package/src/Api/Implementation/AlertApiImpl.js +14 -0
  13. package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -0
  14. package/src/Api/Implementation/ColumnApiImpl.js +11 -0
  15. package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/GridApiImpl.js +3 -0
  17. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
  18. package/src/Api/Implementation/InternalApiImpl.js +59 -0
  19. package/src/Api/InternalApi.d.ts +2 -0
  20. package/src/PredefinedConfig/AlertState.d.ts +4 -0
  21. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
  22. package/src/PredefinedConfig/Common/FDC3Context.d.ts +2 -2
  23. package/src/PredefinedConfig/Common/Types.d.ts +1 -1
  24. package/src/PredefinedConfig/StyledColumnState.d.ts +5 -0
  25. package/src/Strategy/AlertModule.js +1 -1
  26. package/src/Strategy/FlashingCellModule.js +1 -1
  27. package/src/Strategy/StyledColumnModule.js +5 -2
  28. package/src/Utilities/Extensions/ObjectExtensions.d.ts +10 -0
  29. package/src/Utilities/Extensions/ObjectExtensions.js +20 -0
  30. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +16 -8
  31. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +2 -2
  32. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +6 -0
  33. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +285 -0
  34. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +28 -17
  35. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +7 -1
  36. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +16 -7
  37. package/src/agGrid/Adaptable.js +15 -1
  38. package/src/agGrid/agGridHelper.js +12 -0
  39. package/src/components/ExpressionEditor/index.js +3 -41
  40. package/src/metamodel/adaptable.metamodel.js +1 -1
  41. package/version.d.ts +1 -1
  42. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "13.1.0-canary.1",
3
+ "version": "13.1.1-canary.0",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1668677727949;
1
+ declare const _default: 1668783544579;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1668677727949;
3
+ exports.default = 1668783544579;
@@ -49,6 +49,10 @@ export interface AlertOptions {
49
49
  * @gridInfoItem
50
50
  */
51
51
  dataChangeDetectionPolicy?: 'rawValue' | 'formattedValue';
52
+ /**
53
+ * Function providing Title to display in Alert; if empty, AdapTable provides dynamically
54
+ */
55
+ alertMessageTitle?: (alertMessageContext: AlertMessageContext) => string | undefined;
52
56
  /**
53
57
  * Function providing Message to display in Alert; if empty, AdapTable provides dynamically
54
58
  */
@@ -83,10 +83,18 @@ export interface FDC3Column {
83
83
  * Should Column display a 'Broadcast' context menu item
84
84
  */
85
85
  showBroadcastContextMenu?: boolean;
86
+ /**
87
+ * Should Column display a 'Raise Intent for Context' context menu item
88
+ */
89
+ showRaiseIntentForContextMenu?: boolean;
86
90
  /**
87
91
  * Label to display in Broadcast Context Menu Item
88
92
  */
89
93
  broadcastContextMenuLabel?: string | ((broadcastFDC3MessageContext: ContextMenuContext) => string);
94
+ /**
95
+ * Label to display in RaiseIntentForContext Context Menu Item
96
+ */
97
+ raiseIntentForContextMenuLabel?: string | ((raiseFDC3IntentForContext: ContextMenuContext) => string);
90
98
  /**
91
99
  * FDC3 intents which the Column can raise
92
100
  */
@@ -281,6 +289,7 @@ export declare type FDC3ContextHandler = (context: FDC3Context) => void;
281
289
  export interface FDC3DesktopAgent {
282
290
  raiseIntent: (intent: FDC3Intent, context: FDC3Context) => void;
283
291
  broadcast: (context: FDC3Context) => void;
292
+ raiseIntentForContext: (context: FDC3Context) => void;
284
293
  addIntentListener: (intent: FDC3Intent | CustomFDC3Intent, listener: (context: FDC3Context) => void) => void;
285
294
  addContextListener: (contextType: string | null, handler: FDC3ContextHandler) => {
286
295
  unsubscribe: () => void;
@@ -163,6 +163,11 @@ export interface AlertApi {
163
163
  * @param alertDefinition Alert Definition to use
164
164
  */
165
165
  getAlertDescription(alertDefinition: AlertDefinition, cellDataChangedInfo?: CellDataChangedInfo): string;
166
+ /**
167
+ * Returns a description title of an Alert Definition
168
+ * @param alertDefinition Alert Definition to use
169
+ */
170
+ getAlertMessageTitle(alertDefinition: AlertDefinition, cellDataChangedInfo?: CellDataChangedInfo): string;
166
171
  /**
167
172
  * Returns a description of an Alert Definition's Rule
168
173
  * @param alertDefinition Alert Definition to use
@@ -33,6 +33,20 @@ export interface ColumnApi {
33
33
  * Returns all boolean Columns
34
34
  */
35
35
  getBooleanColumns(): AdaptableColumn[];
36
+ /**
37
+ * Return all number-array columns
38
+ */
39
+ getNumberArrayColumns(): AdaptableColumn[];
40
+ /**
41
+ * Return all tuple-number-array columns
42
+ * e.g. [[1, 2], [3, 4]]
43
+ */
44
+ getTupleNumberArrayColumns(): AdaptableColumn[];
45
+ /**
46
+ * Return all object-number-array columns
47
+ * e.g. [{x : 1, y : 2}, {x : 3, y : 4}]
48
+ */
49
+ getObjectNumberArrayColumns(): AdaptableColumn[];
36
50
  /**
37
51
  * Returns all Sortable Columns
38
52
  */
@@ -96,6 +96,11 @@ export interface FinanceApi {
96
96
  * @param context context for Event
97
97
  */
98
98
  publishBroadcastFDC3MessageEvent(context: FDC3Context): void;
99
+ /**
100
+ * Publishes an FDC3 Message Event of type `RaiseIntentForContext`
101
+ * @param context context for Event
102
+ */
103
+ publishRaiseFDC3IntentForContextEvent(context: FDC3Context): void;
99
104
  /**
100
105
  * Publishes an FDC3 Message Event of type `Raise Event`
101
106
  * @param context context for Event
@@ -219,6 +219,7 @@ export interface GridApi {
219
219
  * @param primaryKeyValue Primary Key Value to look up
220
220
  */
221
221
  getRowNodeForPrimaryKey(primaryKeyValue: any): RowNode;
222
+ getRowNodeForIndex(rowIndex: number): RowNode | undefined;
222
223
  /**
223
224
  * Returns the Primary Kev Value for a given Row Node
224
225
  * @param rowNode rowNode to look up
@@ -41,6 +41,7 @@ export declare class AlertApiImpl extends ApiBase implements AlertApi {
41
41
  editAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
42
42
  suspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
43
43
  unSuspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
44
+ getAlertMessageTitle(alertDefinition: AlertDefinition, cellDataChangedInfo?: CellDataChangedInfo): string | undefined;
44
45
  getAlertDescription(alertDefinition: AlertDefinition, cellDataChangedInfo?: CellDataChangedInfo): string;
45
46
  getAlertRuleDescription(alert: AlertDefinition): string;
46
47
  isCellChangedAdaptableAlert(alert: AdaptableAlert): boolean;
@@ -300,6 +300,20 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
300
300
  this.dispatchAction(AlertRedux.AlertDefinitionUnSuspend(alertDefinition));
301
301
  return this.getAlertDefinitionById(alertDefinition.Uuid);
302
302
  }
303
+ getAlertMessageTitle(alertDefinition, cellDataChangedInfo) {
304
+ var _a, _b;
305
+ const alertMessageFunction = (_a = this.adaptable.adaptableOptions.alertOptions) === null || _a === void 0 ? void 0 : _a.alertMessageTitle;
306
+ if (alertMessageFunction) {
307
+ const returnText = alertMessageFunction({ alertDefinition, cellDataChangedInfo });
308
+ if (returnText) {
309
+ return returnText;
310
+ }
311
+ }
312
+ if (alertDefinition.MessageHeader) {
313
+ return alertDefinition.MessageHeader;
314
+ }
315
+ return (_b = cellDataChangedInfo === null || cellDataChangedInfo === void 0 ? void 0 : cellDataChangedInfo.column) === null || _b === void 0 ? void 0 : _b.friendlyName;
316
+ }
303
317
  getAlertDescription(alertDefinition, cellDataChangedInfo) {
304
318
  var _a;
305
319
  const alertMessageFunction = (_a = this.adaptable.adaptableOptions.alertOptions) === null || _a === void 0 ? void 0 : _a.alertMessageText;
@@ -42,6 +42,9 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
42
42
  getColumnFromFriendlyName(columnName: string, logWarning?: boolean): AdaptableColumn;
43
43
  getColumnsOfType(dataType: AdaptableColumnDataType): AdaptableColumn[];
44
44
  getNumericColumns(): AdaptableColumn[];
45
+ getNumberArrayColumns(): AdaptableColumn[];
46
+ getTupleNumberArrayColumns(): AdaptableColumn[];
47
+ getObjectNumberArrayColumns(): AdaptableColumn[];
45
48
  getStringColumns(): AdaptableColumn[];
46
49
  getDateColumns(): AdaptableColumn[];
47
50
  getBooleanColumns(): AdaptableColumn[];
@@ -238,6 +238,8 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
238
238
  return this.getNumericColumns();
239
239
  case 'String':
240
240
  return this.getStringColumns();
241
+ case 'NumberArray':
242
+ return this.getNumberArrayColumns();
241
243
  default:
242
244
  return this.getColumns();
243
245
  }
@@ -245,6 +247,15 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
245
247
  getNumericColumns() {
246
248
  return this.getColumns().filter((c) => c.dataType == 'Number');
247
249
  }
250
+ getNumberArrayColumns() {
251
+ return this.getColumns().filter((c) => c.dataType == 'NumberArray');
252
+ }
253
+ getTupleNumberArrayColumns() {
254
+ return this.getColumns().filter((c) => c.dataType == 'TupleNumberArray');
255
+ }
256
+ getObjectNumberArrayColumns() {
257
+ return this.getColumns().filter((c) => c.dataType == 'ObjectNumberArray');
258
+ }
248
259
  getStringColumns() {
249
260
  return this.getColumns().filter((c) => c.dataType == 'String');
250
261
  }
@@ -71,6 +71,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
71
71
  getRowNodesForPrimaryKeys(primaryKeyValues: any[]): RowNode[];
72
72
  getRowNodeForPrimaryKey(primaryKeyValue: any): RowNode;
73
73
  getPrimaryKeyValueForRowNode(rowNode: RowNode): any;
74
+ getRowNodeForIndex(index: number): RowNode<any>;
74
75
  getPrimaryKeyValuesForRowNodes(rowNodes: RowNode[]): any[];
75
76
  setRowGroupColumns(columnIds: string[]): void;
76
77
  clearRowGroupColumns(): void;
@@ -217,6 +217,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
217
217
  getPrimaryKeyValueForRowNode(rowNode) {
218
218
  return this.adaptable.getPrimaryKeyValueFromRowNode(rowNode);
219
219
  }
220
+ getRowNodeForIndex(index) {
221
+ return this.adaptable.getRowNodeByIndex(index);
222
+ }
220
223
  getPrimaryKeyValuesForRowNodes(rowNodes) {
221
224
  return rowNodes.map((rowNode) => this.getPrimaryKeyValueForRowNode(rowNode));
222
225
  }
@@ -144,4 +144,6 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
144
144
  getEditLookUpValuesForColumn(editLookUpItem: EditLookUpPermittedValues, column: AdaptableColumn, gridCell?: GridCell): any[] | undefined;
145
145
  getAdaptableQueryExpressionText(query: Partial<AdaptableQuery>): string;
146
146
  deleteConditionalStyles(conditionalStyles: any[]): void;
147
+ getValueUsingField(rowData: Record<string, any>, column: AdaptableColumn): any;
148
+ setValueUsingField(rowData: Record<string, any>, column: AdaptableColumn, newValue: any): Record<string, any>;
147
149
  }
@@ -663,5 +663,64 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
663
663
  this.dispatchAction(DeadRedux.ConditionalStyleDelete(cs));
664
664
  });
665
665
  }
666
+ // "borrowed" from https://github.com/ag-grid/ag-grid/blob/v28.2.1/community-modules/core/src/ts/utils/object.ts#L205
667
+ getValueUsingField(rowData, column) {
668
+ var _a;
669
+ if (!rowData || !column) {
670
+ return;
671
+ }
672
+ const columnValueKey = (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId;
673
+ const isColumnValueKeyContainsDots = columnValueKey === null || columnValueKey === void 0 ? void 0 : columnValueKey.includes('.');
674
+ // if no '.', then it's not a deep value
675
+ if (!isColumnValueKeyContainsDots) {
676
+ return rowData[columnValueKey];
677
+ }
678
+ // otherwise it is a deep value, so need to dig for it
679
+ const fields = columnValueKey.split('.');
680
+ let currentObject = rowData;
681
+ for (let i = 0; i < fields.length; i++) {
682
+ if (currentObject == null) {
683
+ return undefined;
684
+ }
685
+ currentObject = currentObject[fields[i]];
686
+ }
687
+ return currentObject;
688
+ }
689
+ // "borrowed" from https://github.com/ag-grid/ag-grid/blob/v28.2.1/community-modules/core/src/ts/valueService/valueService.ts#L236
690
+ setValueUsingField(rowData, column, newValue) {
691
+ var _a;
692
+ if (!rowData || !column) {
693
+ return;
694
+ }
695
+ const columnValueKey = (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId;
696
+ const isColumnValueKeyContainsDots = columnValueKey === null || columnValueKey === void 0 ? void 0 : columnValueKey.includes('.');
697
+ let valuesAreSame = false;
698
+ if (!isColumnValueKeyContainsDots) {
699
+ // soft comparison to match strings and numbers
700
+ valuesAreSame = rowData[columnValueKey] == newValue;
701
+ if (!valuesAreSame) {
702
+ rowData[columnValueKey] = newValue;
703
+ }
704
+ }
705
+ else {
706
+ // otherwise it is a deep value, so need to dig for it
707
+ const fieldPieces = columnValueKey.split('.');
708
+ let currentObject = rowData;
709
+ while (fieldPieces.length > 0 && currentObject) {
710
+ const fieldPiece = fieldPieces.shift();
711
+ if (fieldPieces.length === 0) {
712
+ // soft comparison to match strings and numbers
713
+ valuesAreSame = currentObject[fieldPiece] == newValue;
714
+ if (!valuesAreSame) {
715
+ currentObject[fieldPiece] = newValue;
716
+ }
717
+ }
718
+ else {
719
+ currentObject = currentObject[fieldPiece];
720
+ }
721
+ }
722
+ }
723
+ return rowData;
724
+ }
666
725
  }
667
726
  exports.InternalApiImpl = InternalApiImpl;
@@ -71,6 +71,8 @@ export interface InternalApi {
71
71
  setModuleButtonMenuItems(menuItems: AdaptableMenuItem[]): void;
72
72
  setSelectedCells(selectedCellInfo: SelectedCellInfo): void;
73
73
  setSelectedRows(selectedRowInfo: SelectedRowInfo): void;
74
+ getValueUsingField(rowData: Record<string, any>, column: AdaptableColumn): any;
75
+ setValueUsingField(rowData: Record<string, any>, column: AdaptableColumn, newValue: any): any;
74
76
  setPivotModeOn(): void;
75
77
  setPivotModeOff(): void;
76
78
  isGridInPivotMode(): boolean;
@@ -36,6 +36,10 @@ export interface AlertDefinition extends SuspendableObject {
36
36
  * Type of Alert: 'Info', 'Success', 'Warning', 'Error'; influences Alert colour, icon and logging
37
37
  */
38
38
  MessageType: AdaptableMessageType;
39
+ /**
40
+ * The Alert Title Message to display
41
+ */
42
+ MessageHeader?: string;
39
43
  /**
40
44
  * Alert Message; if not provided AdapTable creates dynamically using Rule & Scope (Note: can be provided as a function in AlertOptions)
41
45
  */
@@ -2,7 +2,7 @@ import { AdaptableObject } from './AdaptableObject';
2
2
  /**
3
3
  * Type of data stored in an Adaptable Column
4
4
  */
5
- export declare type AdaptableColumnDataType = 'String' | 'Number' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
5
+ export declare type AdaptableColumnDataType = 'String' | 'Number' | 'Boolean' | 'Date' | 'Object' | 'NumberArray' | 'TupleNumberArray' | 'ObjectNumberArray' | 'Unknown';
6
6
  /**
7
7
  * Base class for Adaptable Column containing most important properties
8
8
  */
@@ -219,9 +219,9 @@ export interface CountryContext extends FDC3Context {
219
219
  */
220
220
  export interface AdaptableFDC3EventInfo extends BaseEventInfo {
221
221
  /**
222
- * Type of Event: `RaiseIntent` or `BroadcastMessage`
222
+ * Type of Event: `RaiseIntent`, `RaiseIntentForContext` or `BroadcastMessage`
223
223
  */
224
- eventType: 'RaiseIntent' | 'BroadcastMessage';
224
+ eventType: 'RaiseIntent' | 'RaiseIntentForContext' | 'BroadcastMessage';
225
225
  /**
226
226
  * The FDC3 Intent which caused Event to fire (if type is `RaiseIntent`)
227
227
  */
@@ -36,4 +36,4 @@ export declare type TypeHint<Base, Literals> = (Base & {
36
36
  }) | Literals;
37
37
  export declare type AdaptableQLModules = AdaptableQLModule[];
38
38
  export declare type AdaptableQLModule = 'CalculatedColumn' | 'Filter' | 'Query';
39
- export declare type AdaptableColumnType = 'abColDefBoolean' | 'abColDefDate' | 'abColDefNumber' | 'abColDefString' | 'abColDefObject' | 'abColDefCustom' | 'abSpecialColumn';
39
+ export declare type AdaptableColumnType = 'abColDefBoolean' | 'abColDefDate' | 'abColDefNumber' | 'abColDefString' | 'abColDefObject' | 'abColDefNumberArray' | 'abColDefTupleNumberArray' | 'abColDefObjectNumberArray' | 'abColDefCustom' | 'abSpecialColumn';
@@ -1,5 +1,6 @@
1
1
  import { ConfigState } from './ConfigState';
2
2
  import { SuspendableObject } from './Common/SuspendableObject';
3
+ import { SparklineOptions } from '@ag-grid-community/core';
3
4
  /**
4
5
  * Predefined Configuration for Styled Column Module
5
6
  */
@@ -29,6 +30,7 @@ export interface StyledColumn extends SuspendableObject {
29
30
  * Renders a Checkbox in a boolean column
30
31
  */
31
32
  CheckBoxStyle?: boolean;
33
+ SparkLineStyle?: SparkLineStyle;
32
34
  /**
33
35
  * Includes the Styled Column in Grouped Rows
34
36
  * @defaultValue false
@@ -123,3 +125,6 @@ export declare type CellTextOption = 'CellValue' | 'PercentageValue';
123
125
  * Whether the Range is Number or Percent based
124
126
  */
125
127
  export declare type RangeValueType = 'Number' | 'Percentage';
128
+ export declare type SparkLineStyle = {
129
+ options?: SparklineOptions;
130
+ };
@@ -172,7 +172,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
172
172
  }
173
173
  showAlertForDefinitions(cellDataChangedInfo, alertDefinitions = []) {
174
174
  alertDefinitions.forEach((alertDefinition) => {
175
- const alert = ObjectFactory_1.default.CreateCellChangedAlert(cellDataChangedInfo.column.friendlyName, this.api.alertApi.getAlertDescription(alertDefinition, cellDataChangedInfo), alertDefinition, cellDataChangedInfo);
175
+ const alert = ObjectFactory_1.default.CreateCellChangedAlert(this.api.alertApi.getAlertMessageTitle(alertDefinition, cellDataChangedInfo), this.api.alertApi.getAlertDescription(alertDefinition, cellDataChangedInfo), alertDefinition, cellDataChangedInfo);
176
176
  this.api.alertApi.displayAlert(alert);
177
177
  });
178
178
  }
@@ -96,7 +96,7 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
96
96
  const flashingCellForCell = this.api.internalApi.getAdaptableFlashingCellFor(menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
97
97
  if (flashingCellForRow) {
98
98
  if (flashingCellForRow.flashTarget === 'row' ||
99
- (Array.isArray(flashingCellForRow.flashTarget) &&
99
+ (Array.isArray(flashingCellForRow === null || flashingCellForRow === void 0 ? void 0 : flashingCellForRow.flashTarget) &&
100
100
  flashingCellForRow.flashTarget.includes('row'))) {
101
101
  items.push(this.createColumnMenuItemReduxAction('Clear Flashing Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForRow)));
102
102
  }
@@ -125,9 +125,12 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
125
125
  else if (styledColumn.PercentBarStyle) {
126
126
  type = 'Percent Bar';
127
127
  }
128
- else {
128
+ else if (styledColumn.CheckBoxStyle) {
129
129
  type = 'Check Box';
130
130
  }
131
+ else if (styledColumn.SparkLineStyle) {
132
+ type = 'Spark Line';
133
+ }
131
134
  return {
132
135
  abObject: styledColumn,
133
136
  items: [
@@ -139,7 +142,7 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
139
142
  name: 'Column',
140
143
  values: [this.api.columnApi.getFriendlyNameFromColumnId(styledColumn.ColumnId)],
141
144
  },
142
- {
145
+ !styledColumn.SparkLineStyle && {
143
146
  name: 'Style',
144
147
  view: () => {
145
148
  return (0, StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary)(styledColumn, this.api);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns a new object with the property updated.
3
+ * The property is identified by the path.
4
+ *
5
+ * @param obj Object
6
+ * @param path path to the property
7
+ * @param value new property value
8
+ * @returns
9
+ */
10
+ export declare function setInPath<T>(obj: any, path: string[], value: any): T;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setInPath = void 0;
4
+ /**
5
+ * Returns a new object with the property updated.
6
+ * The property is identified by the path.
7
+ *
8
+ * @param obj Object
9
+ * @param path path to the property
10
+ * @param value new property value
11
+ * @returns
12
+ */
13
+ function setInPath(obj, path, value) {
14
+ var _a;
15
+ if (path.length === 1) {
16
+ return Object.assign(Object.assign({}, obj), { [path[0]]: value });
17
+ }
18
+ return Object.assign(Object.assign({}, obj), { [path[0]]: setInPath((_a = obj === null || obj === void 0 ? void 0 : obj[path[0]]) !== null && _a !== void 0 ? _a : {}, path.slice(1), value) });
19
+ }
20
+ exports.setInPath = setInPath;
@@ -13,6 +13,7 @@ const AlertButtonsEditor_1 = require("./AlertButtonsEditor");
13
13
  const CodeBlock_1 = require("../../../components/CodeBlock");
14
14
  const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
15
15
  const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
16
+ const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
16
17
  const DEFAULT_BUTTONS = [
17
18
  {
18
19
  Label: 'OK',
@@ -48,7 +49,7 @@ const AlertPreview = (_a) => {
48
49
  const Buttons = (((_a = alertForm === null || alertForm === void 0 ? void 0 : alertForm.Buttons) === null || _a === void 0 ? void 0 : _a.length) ? alertForm.Buttons : DEFAULT_BUTTONS).map(mapButtons);
49
50
  const result = {
50
51
  alertType: 'generic',
51
- header: alertDefinition.MessageType,
52
+ header: api.alertApi.getAlertMessageTitle(alertDefinition),
52
53
  message: api.alertApi.getAlertDescription(alertDefinition),
53
54
  alertDefinition: Object.assign(Object.assign({}, alertDefinition), { AlertForm: Object.assign(Object.assign({}, alertForm), { Buttons }) }),
54
55
  };
@@ -59,10 +60,11 @@ const AlertPreview = (_a) => {
59
60
  };
60
61
  exports.AlertPreview = AlertPreview;
61
62
  const AlertDisplayWizardSection = (props) => {
62
- var _a, _b, _c, _d;
63
+ var _a, _b, _c, _d, _e;
63
64
  const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
64
65
  const messageType = data.MessageType;
65
66
  const messageText = api.alertApi.getAlertDescription(data);
67
+ const messageHeader = (_a = data.MessageHeader) !== null && _a !== void 0 ? _a : '';
66
68
  const adaptableAlert = {
67
69
  alertType: 'generic',
68
70
  header: data.MessageType,
@@ -73,6 +75,10 @@ const AlertDisplayWizardSection = (props) => {
73
75
  const { value } = e.target;
74
76
  props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
75
77
  };
78
+ const onMessageHeaderChange = (e) => {
79
+ const { value } = e.target;
80
+ props.onChange(Object.assign(Object.assign({}, data), { MessageHeader: value }));
81
+ };
76
82
  return (React.createElement(React.Fragment, null,
77
83
  React.createElement(Tabs_1.Tabs, { "data-name": "message-type" },
78
84
  React.createElement(Tabs_1.Tabs.Tab, null, "Message Type"),
@@ -89,23 +95,25 @@ const AlertDisplayWizardSection = (props) => {
89
95
  React.createElement(Tabs_1.Tabs.Content, null,
90
96
  React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Trigger and Condition)"),
91
97
  ' ',
92
- React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText,
93
- // onChange={(e: any) => onPredicateInputChange(e, index)}
94
- onChange: (e) => onMessageTextChange(e) }))),
98
+ React.createElement(FormLayout_1.default, null,
99
+ React.createElement(FormLayout_1.FormRow, { label: "Header" },
100
+ React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageHeader, onChange: (e) => onMessageHeaderChange(e) })),
101
+ React.createElement(FormLayout_1.FormRow, { label: "Message" },
102
+ React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText, onChange: (e) => onMessageTextChange(e) }))))),
95
103
  React.createElement(Tabs_1.Tabs, { "data-name": "display-options", mt: 2, mb: 3, autoFocus: false },
96
104
  React.createElement(Tabs_1.Tabs.Tab, null, "Display options"),
97
105
  React.createElement(Tabs_1.Tabs.Content, null,
98
- React.createElement(CheckBox_1.CheckBox, { checked: (_a = data.AlertProperties) === null || _a === void 0 ? void 0 : _a.DisplayNotification, onChange: (DisplayNotification) => {
106
+ React.createElement(CheckBox_1.CheckBox, { checked: (_b = data.AlertProperties) === null || _b === void 0 ? void 0 : _b.DisplayNotification, onChange: (DisplayNotification) => {
99
107
  const newAlertDefinition = Object.assign(Object.assign({}, data), { AlertProperties: Object.assign(Object.assign({}, data.AlertProperties), { DisplayNotification }) });
100
108
  if (!DisplayNotification && typeof newAlertDefinition.AlertForm === 'object') {
101
109
  delete newAlertDefinition.AlertForm.Buttons;
102
110
  }
103
111
  props.onChange(newAlertDefinition);
104
112
  } }, "Show a Notification when Alert is triggered (with action buttons)"),
105
- ((_b = data.AlertProperties) === null || _b === void 0 ? void 0 : _b.DisplayNotification) ? (typeof data.AlertForm === 'string' ? (React.createElement(rebass_1.Text, { fontSize: 2 }, "Alert buttons cannot be customized because form is dynamically driven")) : (React.createElement(AlertButtonsEditor_1.AlertButtonsEditor, { AlertButtons: ((_c = data.AlertForm) === null || _c === void 0 ? void 0 : _c.Buttons) || DEFAULT_BUTTONS, api: api, adaptableAlert: adaptableAlert, onChange: (buttons) => {
113
+ ((_c = data.AlertProperties) === null || _c === void 0 ? void 0 : _c.DisplayNotification) ? (typeof data.AlertForm === 'string' ? (React.createElement(rebass_1.Text, { fontSize: 2 }, "Alert buttons cannot be customized because form is dynamically driven")) : (React.createElement(AlertButtonsEditor_1.AlertButtonsEditor, { AlertButtons: ((_d = data.AlertForm) === null || _d === void 0 ? void 0 : _d.Buttons) || DEFAULT_BUTTONS, api: api, adaptableAlert: adaptableAlert, onChange: (buttons) => {
106
114
  props.onChange(Object.assign(Object.assign({}, data), { AlertForm: Object.assign(Object.assign({}, data.AlertForm), { Buttons: buttons }) }));
107
115
  } }))) : null)),
108
- ((_d = data.AlertProperties) === null || _d === void 0 ? void 0 : _d.DisplayNotification) ? (React.createElement(Tabs_1.Tabs, { "data-name": "alert-preview", autoFocus: false },
116
+ ((_e = data.AlertProperties) === null || _e === void 0 ? void 0 : _e.DisplayNotification) ? (React.createElement(Tabs_1.Tabs, { "data-name": "alert-preview", autoFocus: false },
109
117
  React.createElement(Tabs_1.Tabs.Tab, null, "Alert preview"),
110
118
  React.createElement(Tabs_1.Tabs.Content, null, typeof data.AlertForm === 'string' ? (React.createElement(rebass_1.Text, { fontSize: 2 }, "Preview not available because form is dynamically driven")) : (React.createElement(exports.AlertPreview, { alertDefinition: data, api: api }))))) : null));
111
119
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
2
+ import { AdaptableColumn, AdaptableColumnDataType } from '../../../PredefinedConfig/Common/AdaptableColumn';
3
3
  import { ListGroupProps } from '../../../components/List/ListGroup';
4
4
  export interface ListBoxFilterFormProps extends ListGroupProps {
5
5
  currentColumn: AdaptableColumn;
@@ -11,7 +11,7 @@ export interface ListBoxFilterFormProps extends ListGroupProps {
11
11
  }[];
12
12
  uiSelectedColumnValues: Array<string>;
13
13
  onColumnValueSelectedChange: (SelectedValues: Array<any>) => void;
14
- dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
14
+ dataType: AdaptableColumnDataType;
15
15
  isLoading?: boolean;
16
16
  suppressClientSideFilter?: boolean;
17
17
  onFilterChange?: (filter: string) => void;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { StyledColumn } from '../../../types';
3
+ export interface StyledColumnSparklineSettingsSectionProps {
4
+ onChange: (data: StyledColumn) => void;
5
+ }
6
+ export declare const StyledColumnSparklineSettingsSection: React.FunctionComponent<StyledColumnSparklineSettingsSectionProps>;