@adaptabletools/adaptable 16.0.7 → 16.0.8-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 (38) hide show
  1. package/bundle.cjs.js +103 -103
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableOptions/AdaptablePlugin.d.ts +3 -3
  6. package/src/AdaptableOptions/AdaptablePlugin.js +3 -1
  7. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
  8. package/src/Api/ColumnApi.d.ts +5 -0
  9. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  10. package/src/Api/Implementation/ColumnApiImpl.js +4 -1
  11. package/src/PredefinedConfig/Common/AdaptablePredicate.js +4 -4
  12. package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +2 -1
  13. package/src/Strategy/CellSummaryModule.js +7 -7
  14. package/src/Strategy/StyledColumnModule.js +3 -0
  15. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +0 -1
  16. package/src/Utilities/Helpers/Helper.d.ts +10 -10
  17. package/src/Utilities/Helpers/Helper.js +22 -26
  18. package/src/View/Alert/ActiveAlertsPanelItemLabel.js +2 -2
  19. package/src/View/Alert/AlertsPanel.js +2 -2
  20. package/src/View/Components/Badge/index.d.ts +1 -0
  21. package/src/View/Components/Badge/index.js +1 -1
  22. package/src/View/Components/Panels/PanelWithButton.js +2 -2
  23. package/src/View/Components/Panels/PanelWithImage.js +2 -2
  24. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -1
  25. package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
  26. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +5 -5
  27. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
  28. package/src/agGrid/Adaptable.d.ts +1 -1
  29. package/src/agGrid/Adaptable.js +13 -12
  30. package/src/agGrid/BadgeRenderer.js +71 -13
  31. package/src/components/Icon/index.js +3 -3
  32. package/src/components/IconSelector/IconSelector.js +5 -5
  33. package/src/components/SimpleButton/index.js +2 -2
  34. package/src/components/icons/index.d.ts +1 -2
  35. package/src/components/icons/index.js +6 -7
  36. package/src/metamodel/adaptable.metamodel.js +1 -1
  37. package/version.d.ts +1 -1
  38. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "16.0.7",
3
+ "version": "16.0.8-canary.0",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1694355460696;
1
+ declare const _default: 1695122956191;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1694355460696;
3
+ exports.default = 1695122956191;
@@ -1,13 +1,13 @@
1
1
  import * as Redux from 'redux';
2
2
  import { AdaptableOptions } from './AdaptableOptions';
3
- import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
3
+ import { AgGridConfig, IAdaptable } from '../AdaptableInterfaces/IAdaptable';
4
4
  import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
5
5
  import { AdaptableApi } from '../types';
6
6
  import { AdaptableState } from '../PredefinedConfig/AdaptableState';
7
7
  import { AdaptableModule } from '../PredefinedConfig/Common/Types';
8
8
  import { IModule } from '../Strategy/Interface/IModule';
9
9
  import { ColumnSetupInfo } from '../agGrid/ColumnSetupInfo';
10
- import { ColDef, GridOptions } from '@ag-grid-community/core';
10
+ import { ColDef } from '@ag-grid-community/core';
11
11
  import { Layout } from '../PredefinedConfig/LayoutState';
12
12
  declare type AdaptableReducerObject = {
13
13
  [key: string]: (...args: any[]) => any;
@@ -25,7 +25,7 @@ export declare abstract class AdaptablePlugin {
25
25
  rootReducer?: (rootReducer: AdaptableReducerObject) => AdaptableReducerObject;
26
26
  reduxMiddleware?: (adaptable: IAdaptable) => Redux.Middleware;
27
27
  hasProperty(name: string): boolean;
28
- beforeInit(adaptableOptions: AdaptableOptions, gridOptions: GridOptions): void;
28
+ beforeInit(adaptableOptions: AdaptableOptions, agGridOptions: AgGridConfig): void;
29
29
  afterInitOptions(adaptable: IAdaptable, adaptableOptions: AdaptableOptions): void;
30
30
  afterInitApi(adaptable: IAdaptable, api: AdaptableApi): void;
31
31
  afterInitServices(adaptable: IAdaptable): void;
@@ -26,7 +26,9 @@ class AdaptablePlugin {
26
26
  }
27
27
  // plugin lifecycle methods, executed in this exact order
28
28
  // wondering if this is better?
29
- beforeInit(adaptableOptions, gridOptions) { }
29
+ beforeInit(adaptableOptions,
30
+ // adding a nested object allows plugins to modify gridOptions
31
+ agGridOptions) { }
30
32
  afterInitOptions(adaptable, adaptableOptions) { }
31
33
  afterInitApi(adaptable, api) { }
32
34
  afterInitServices(adaptable) { }
@@ -111,7 +111,7 @@ export interface UserInterfaceOptions<TData = any> {
111
111
  */
112
112
  alternativeModuleNames?: AlternativeModuleName[];
113
113
  /**
114
- * Display the Loading message when AdapTable starts
114
+ * Display Loading message when AdapTable starts
115
115
  * @defaultValue true
116
116
  * @noCodeItem
117
117
  */
@@ -182,6 +182,11 @@ export interface ColumnApi {
182
182
  * @param columnId Column ID
183
183
  */
184
184
  hasNumericArrayDataType(columnId: string): boolean;
185
+ /**
186
+ * Checks if the Column with the given `columnId` has any Array-like DataType (`StringArray`,`NumberArray`,`TupleNumberArray` or `ObjectNumberArray`)
187
+ * @param columnId Column ID
188
+ */
189
+ hasArrayDataType(columnId: string): boolean;
185
190
  /**
186
191
  * Checks if the Column with the given `columnId` has a String Array-like DataType (`StringArray`)
187
192
  * @param columnId Column ID
@@ -26,6 +26,7 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
26
26
  getColumnWithColumnId(columnId: string, logWarning?: boolean): AdaptableColumn | undefined;
27
27
  hasNumberDataType(columnId: string): boolean;
28
28
  hasBooleanDataType(columnId: string): boolean;
29
+ hasArrayDataType(columnId: string): boolean;
29
30
  hasStringArrayDataType(columnId: string): boolean;
30
31
  hasNumericArrayDataType(columnId: string): boolean;
31
32
  hasDateDataType(columnId: string): boolean;
@@ -113,6 +113,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
113
113
  }
114
114
  return (column === null || column === void 0 ? void 0 : column.dataType) == 'Boolean';
115
115
  }
116
+ hasArrayDataType(columnId) {
117
+ return this.hasStringArrayDataType(columnId) || this.hasNumericArrayDataType(columnId);
118
+ }
116
119
  hasStringArrayDataType(columnId) {
117
120
  const column = this.getColumnWithColumnId(columnId);
118
121
  if (!column) {
@@ -267,7 +270,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
267
270
  return this.getColumns().filter((c) => c.dataType == 'String');
268
271
  }
269
272
  getStringArrayColumns() {
270
- return this.getColumns().filter((c) => c.dataType == 'String');
273
+ return this.getColumns().filter((c) => c.dataType == 'StringArray');
271
274
  }
272
275
  getDateColumns() {
273
276
  return this.getColumns().filter((c) => c.dataType == 'Date');
@@ -33,7 +33,7 @@ exports.SystemPredicateDefs = [
33
33
  if (inputs.length === 0) {
34
34
  return true;
35
35
  }
36
- if (inputs.includes(GeneralConstants_1.BLANK_DISTINCT_COLUMN_VALUE) && Helper_1.default.IsInputNullOrEmpty(value)) {
36
+ if (inputs.includes(GeneralConstants_1.BLANK_DISTINCT_COLUMN_VALUE) && Helper_1.default.isInputNullOrEmpty(value)) {
37
37
  return true;
38
38
  }
39
39
  if (column.dataType === 'Date') {
@@ -74,7 +74,7 @@ exports.SystemPredicateDefs = [
74
74
  if (inputs.length === 0) {
75
75
  return true;
76
76
  }
77
- if (inputs.includes(GeneralConstants_1.BLANK_DISTINCT_COLUMN_VALUE) && Helper_1.default.IsInputNullOrEmpty(value)) {
77
+ if (inputs.includes(GeneralConstants_1.BLANK_DISTINCT_COLUMN_VALUE) && Helper_1.default.isInputNullOrEmpty(value)) {
78
78
  return false;
79
79
  }
80
80
  if (column.dataType === 'Date') {
@@ -111,7 +111,7 @@ exports.SystemPredicateDefs = [
111
111
  icon: { name: 'unfilled-circle' },
112
112
  columnScope: { All: true },
113
113
  moduleScope: ['filter', 'alert', 'flashingcell', 'formatColumn', 'badgeStyle'],
114
- handler: ({ value }) => Helper_1.default.IsInputNullOrEmpty(value),
114
+ handler: ({ value }) => Helper_1.default.isInputNullOrEmpty(value),
115
115
  },
116
116
  {
117
117
  id: 'NonBlanks',
@@ -119,7 +119,7 @@ exports.SystemPredicateDefs = [
119
119
  icon: { name: 'filled-circle' },
120
120
  columnScope: { All: true },
121
121
  moduleScope: ['filter', 'alert', 'flashingcell', 'formatColumn', 'badgeStyle'],
122
- handler: ({ value }) => Helper_1.default.IsInputNotNullOrEmpty(value),
122
+ handler: ({ value }) => Helper_1.default.isInputNotNullOrEmpty(value),
123
123
  },
124
124
  // Numeric System Filters
125
125
  {
@@ -10,7 +10,8 @@ export interface CellHighlightInfo {
10
10
  /**
11
11
  * Primary Key Value of row containing Cell
12
12
  */
13
- primaryKeyValue: any;
13
+ primaryKeyValue?: any;
14
+ query?: string;
14
15
  /**
15
16
  * Time after which Cell should be unhighlighted
16
17
  */
@@ -77,23 +77,23 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
77
77
  let distinctCount = ArrayExtensions_1.ArrayExtensions.RetrieveDistinct(allValues).length;
78
78
  selectedCellSummary = {
79
79
  Sum: hasNumericColumns
80
- ? Helper_1.Helper.RoundNumberTo4dp(Helper_1.Helper.sumNumberArray(numericValues))
80
+ ? Helper_1.Helper.roundNumberTo4dp(Helper_1.Helper.sumNumberArray(numericValues))
81
81
  : undefined,
82
82
  Average: hasNumericColumns
83
- ? Helper_1.Helper.RoundNumberTo4dp(Helper_1.Helper.meanNumberArray(numericValues))
83
+ ? Helper_1.Helper.roundNumberTo4dp(Helper_1.Helper.meanNumberArray(numericValues))
84
84
  : undefined,
85
85
  Median: hasNumericColumns
86
- ? Helper_1.Helper.RoundNumberTo4dp(Helper_1.Helper.medianNumberArray(numericValues))
86
+ ? Helper_1.Helper.roundNumberTo4dp(Helper_1.Helper.medianNumberArray(numericValues))
87
87
  : undefined,
88
88
  Mode: hasNumericColumns
89
- ? Helper_1.Helper.RoundNumberTo4dp(Helper_1.Helper.modeNumberArray(numericValues))
89
+ ? Helper_1.Helper.roundNumberTo4dp(Helper_1.Helper.modeNumberArray(numericValues))
90
90
  : undefined,
91
91
  Distinct: distinctCount,
92
- Max: hasNumericColumns ? Helper_1.Helper.RoundNumberTo4dp(Math.max(...numericValues)) : undefined,
93
- Min: hasNumericColumns ? Helper_1.Helper.RoundNumberTo4dp(Math.min(...numericValues)) : undefined,
92
+ Max: hasNumericColumns ? Helper_1.Helper.roundNumberTo4dp(Math.max(...numericValues)) : undefined,
93
+ Min: hasNumericColumns ? Helper_1.Helper.roundNumberTo4dp(Math.min(...numericValues)) : undefined,
94
94
  Count: allValues.length,
95
95
  Std_Deviation: hasNumericColumns
96
- ? Helper_1.Helper.RoundNumberTo4dp(Helper_1.Helper.standardDeviationNumberArray(numericValues))
96
+ ? Helper_1.Helper.roundNumberTo4dp(Helper_1.Helper.standardDeviationNumberArray(numericValues))
97
97
  : undefined,
98
98
  Only: distinctCount == 1 ? JSON.stringify(allValues[0]) : '',
99
99
  };
@@ -169,6 +169,9 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
169
169
  case 'String':
170
170
  returnColumnMenuItems.push(newBadgeButton);
171
171
  break;
172
+ case 'StringArray':
173
+ returnColumnMenuItems.push(newBadgeButton);
174
+ break;
172
175
  }
173
176
  }
174
177
  // Then do Checkbox - now removed as AG Grid 30 offers this
@@ -12,7 +12,6 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
12
12
  exports.DefaultAdaptableOptions = {
13
13
  adaptableId: GeneralConstants.ADAPTABLE_ID,
14
14
  adaptableStateKey: undefined,
15
- _gridOptions: null,
16
15
  primaryKey: '',
17
16
  autogeneratePrimaryKey: false,
18
17
  userName: GeneralConstants.USER_NAME,
@@ -6,11 +6,11 @@ export declare const arrayToKeyMap: <T extends string | number | symbol>(arr?: T
6
6
  export declare function convertArrayToCsv(array: any[], separator?: string): string;
7
7
  export declare function createDownloadedFile(content: any, fileName: string, mimeType: string): void;
8
8
  export declare function copyToClipboard(text: string): boolean;
9
- export declare function ReturnItemCount(items: any[], itemName: string): string;
10
- export declare function IsInputNullOrEmpty(itemToCheck: any): boolean;
11
- export declare function IsInputNotNullOrEmpty(itemToCheck: any): boolean;
12
- export declare function RoundNumber(numberToRound: any, decimalPlaces: number): number;
13
- export declare function RoundNumberTo4dp(numberToRound: any): number;
9
+ export declare function returnItemCount(items: any[], itemName: string): string;
10
+ export declare function isInputNullOrEmpty(itemToCheck: any): boolean;
11
+ export declare function isInputNotNullOrEmpty(itemToCheck: any): boolean;
12
+ export declare function roundNumber(numberToRound: any, decimalPlaces: number): number;
13
+ export declare function roundNumberTo4dp(numberToRound: any): number;
14
14
  export declare function sumNumberArray(numericValues: number[]): number;
15
15
  export declare function standardDeviationNumberArray(numericValues: number[]): number;
16
16
  export declare function meanNumberArray(numericValues: number[]): number;
@@ -25,11 +25,11 @@ export declare const Helper: {
25
25
  convertArrayToCsv: typeof convertArrayToCsv;
26
26
  createDownloadedFile: typeof createDownloadedFile;
27
27
  copyToClipboard: typeof copyToClipboard;
28
- ReturnItemCount: typeof ReturnItemCount;
29
- IsInputNullOrEmpty: typeof IsInputNullOrEmpty;
30
- IsInputNotNullOrEmpty: typeof IsInputNotNullOrEmpty;
31
- RoundNumber: typeof RoundNumber;
32
- RoundNumberTo4dp: typeof RoundNumberTo4dp;
28
+ returnItemCount: typeof returnItemCount;
29
+ isInputNullOrEmpty: typeof isInputNullOrEmpty;
30
+ isInputNotNullOrEmpty: typeof isInputNotNullOrEmpty;
31
+ roundNumber: typeof roundNumber;
32
+ roundNumberTo4dp: typeof roundNumberTo4dp;
33
33
  standardDeviationNumberArray: typeof standardDeviationNumberArray;
34
34
  sumNumberArray: typeof sumNumberArray;
35
35
  meanNumberArray: typeof meanNumberArray;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.RoundNumberTo4dp = exports.RoundNumber = exports.IsInputNotNullOrEmpty = exports.IsInputNullOrEmpty = exports.ReturnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectNotExists = exports.objectExists = void 0;
3
+ exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectNotExists = exports.objectExists = void 0;
4
4
  const StringExtensions_1 = require("../Extensions/StringExtensions");
5
5
  const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
6
6
  function objectExists(item) {
@@ -114,14 +114,14 @@ function copyToClipboard(text) {
114
114
  AdaptableLogger_1.AdaptableLogger.consoleWarnBase('Copy not available on this computer.');
115
115
  }
116
116
  exports.copyToClipboard = copyToClipboard;
117
- function ReturnItemCount(items, itemName) {
117
+ function returnItemCount(items, itemName) {
118
118
  if (items.length == 0) {
119
119
  return `No ${itemName}s`;
120
120
  }
121
121
  return items.length == 1 ? `1 ${itemName}` : `${items.length} ${itemName}s`;
122
122
  }
123
- exports.ReturnItemCount = ReturnItemCount;
124
- function IsInputNullOrEmpty(itemToCheck) {
123
+ exports.returnItemCount = returnItemCount;
124
+ function isInputNullOrEmpty(itemToCheck) {
125
125
  if (itemToCheck == 'Invalid Date ') {
126
126
  return true;
127
127
  }
@@ -136,12 +136,12 @@ function IsInputNullOrEmpty(itemToCheck) {
136
136
  }
137
137
  return itemToCheck == null;
138
138
  }
139
- exports.IsInputNullOrEmpty = IsInputNullOrEmpty;
140
- function IsInputNotNullOrEmpty(itemToCheck) {
141
- return !IsInputNullOrEmpty(itemToCheck);
139
+ exports.isInputNullOrEmpty = isInputNullOrEmpty;
140
+ function isInputNotNullOrEmpty(itemToCheck) {
141
+ return !isInputNullOrEmpty(itemToCheck);
142
142
  }
143
- exports.IsInputNotNullOrEmpty = IsInputNotNullOrEmpty;
144
- function RoundNumber(numberToRound, decimalPlaces) {
143
+ exports.isInputNotNullOrEmpty = isInputNotNullOrEmpty;
144
+ function roundNumber(numberToRound, decimalPlaces) {
145
145
  switch (decimalPlaces) {
146
146
  case 1:
147
147
  return Math.round(numberToRound * 10) / 10;
@@ -157,21 +157,17 @@ function RoundNumber(numberToRound, decimalPlaces) {
157
157
  return Math.round(numberToRound * 1000000) / 1000000;
158
158
  }
159
159
  }
160
- exports.RoundNumber = RoundNumber;
161
- function RoundNumberTo4dp(numberToRound) {
162
- return RoundNumber(numberToRound, 4);
160
+ exports.roundNumber = roundNumber;
161
+ function roundNumberTo4dp(numberToRound) {
162
+ return roundNumber(numberToRound, 4);
163
163
  }
164
- exports.RoundNumberTo4dp = RoundNumberTo4dp;
164
+ exports.roundNumberTo4dp = roundNumberTo4dp;
165
165
  function sumNumberArray(numericValues) {
166
- if (numericValues.length) {
167
- let sum = numericValues.reduce(function (a, b) {
166
+ return numericValues.length
167
+ ? numericValues.reduce(function (a, b) {
168
168
  return a + b;
169
- });
170
- return sum;
171
- }
172
- else {
173
- return 0;
174
- }
169
+ })
170
+ : 0;
175
171
  }
176
172
  exports.sumNumberArray = sumNumberArray;
177
173
  function standardDeviationNumberArray(numericValues) {
@@ -258,11 +254,11 @@ exports.Helper = {
258
254
  convertArrayToCsv,
259
255
  createDownloadedFile,
260
256
  copyToClipboard,
261
- ReturnItemCount,
262
- IsInputNullOrEmpty,
263
- IsInputNotNullOrEmpty,
264
- RoundNumber,
265
- RoundNumberTo4dp,
257
+ returnItemCount,
258
+ isInputNullOrEmpty,
259
+ isInputNotNullOrEmpty,
260
+ roundNumber,
261
+ roundNumberTo4dp,
266
262
  standardDeviationNumberArray,
267
263
  sumNumberArray,
268
264
  meanNumberArray,
@@ -4,7 +4,7 @@ exports.ActiveAlertsPanelItemLabel = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const rebass_1 = require("rebass");
7
- const icons_1 = tslib_1.__importDefault(require("../../components/icons"));
7
+ const icons_1 = require("../../components/icons");
8
8
  const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
9
9
  const ActiveAlertsPanelItemLabel = (props) => {
10
10
  const iconColor = UIHelper_1.default.getColorByMessageType(props.data.alertDefinition.MessageType);
@@ -13,7 +13,7 @@ const ActiveAlertsPanelItemLabel = (props) => {
13
13
  fill: iconColor,
14
14
  };
15
15
  const iconName = UIHelper_1.default.getGlyphByMessageType(props.data.alertDefinition.MessageType);
16
- const IconCmp = icons_1.default[iconName];
16
+ const IconCmp = icons_1.allIcons[iconName];
17
17
  const icon = IconCmp ? React.createElement(IconCmp, null) : null;
18
18
  return (React.createElement(rebass_1.Box, null,
19
19
  React.createElement(rebass_1.Text, { style: Object.assign({ float: 'left' }, iconStyle) }, icon),
@@ -8,7 +8,7 @@ const ButtonPreviewDelete_1 = tslib_1.__importDefault(require("../Components/But
8
8
  const PanelWithButton_1 = require("../Components/Panels/PanelWithButton");
9
9
  const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
10
10
  const rebass_1 = require("rebass");
11
- const icons_1 = tslib_1.__importDefault(require("../../components/icons"));
11
+ const icons_1 = require("../../components/icons");
12
12
  const ListGroupItem_1 = tslib_1.__importDefault(require("../../components/List/ListGroupItem"));
13
13
  const ListGroup_1 = tslib_1.__importDefault(require("../../components/List/ListGroup"));
14
14
  const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
@@ -26,7 +26,7 @@ class AlertsPanel extends React.Component {
26
26
  fill: textColor,
27
27
  };
28
28
  const iconName = UIHelper_1.UIHelper.getGlyphByMessageType(alert.alertDefinition.MessageType);
29
- const IconCmp = icons_1.default[iconName];
29
+ const IconCmp = icons_1.allIcons[iconName];
30
30
  const icon = IconCmp ? React.createElement(IconCmp, null) : null;
31
31
  let alertText = (React.createElement("div", { key: alert.Uuid, style: { maxWidth: '600px', width: '100%' } },
32
32
  React.createElement(rebass_1.Flex, { alignItems: "center", width: "100%" },
@@ -4,5 +4,6 @@ export interface BadgeProps {
4
4
  adaptableStyle: AdaptableStyle;
5
5
  icon?: AdaptableIcon;
6
6
  iconPosition?: 'start' | 'end' | 'Start' | 'End';
7
+ gap?: number;
7
8
  }
8
9
  export declare const Badge: React.FunctionComponent<React.PropsWithChildren<BadgeProps>>;
@@ -10,7 +10,7 @@ const Badge = (props) => {
10
10
  const preparedBadgePosition = iconPosition.toLowerCase();
11
11
  const icon = iconProps && React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: iconProps });
12
12
  const style = (0, StyleHelper_1.toStyle)(props.adaptableStyle);
13
- return (React.createElement("div", { className: "ab-Badge", style: style },
13
+ return (React.createElement("div", { className: "ab-Badge", style: Object.assign(Object.assign({}, style), { marginRight: props.gap }) },
14
14
  preparedBadgePosition === 'start' && icon,
15
15
  props.children,
16
16
  preparedBadgePosition === 'end' && icon));
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
7
7
  const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
8
8
  const rebass_1 = require("rebass");
9
- const icons_1 = tslib_1.__importDefault(require("../../../components/icons"));
9
+ const icons_1 = require("../../../components/icons");
10
10
  const ButtonInfo_1 = require("../Buttons/ButtonInfo");
11
11
  //We cannot destructure this.props using the react way in typescript which is a real pain as you
12
12
  //need to transfer props individually as a consequence
@@ -14,7 +14,7 @@ const ButtonInfo_1 = require("../Buttons/ButtonInfo");
14
14
  class PanelWithButton extends React.Component {
15
15
  render() {
16
16
  let { buttonContent } = this.props;
17
- const IconCmp = icons_1.default[this.props.glyphicon];
17
+ const IconCmp = icons_1.allIcons[this.props.glyphicon];
18
18
  let header = (React.createElement(rebass_1.Flex, { alignItems: "center", width: "100%" },
19
19
  React.createElement(rebass_1.Flex, { alignItems: "center" },
20
20
  this.props.glyphicon != null && (IconCmp ? React.createElement(IconCmp, null) : null),
@@ -6,14 +6,14 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const styled_components_1 = require("styled-components");
7
7
  const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
8
8
  const rebass_1 = require("rebass");
9
- const icons_1 = tslib_1.__importDefault(require("../../../components/icons"));
9
+ const icons_1 = require("../../../components/icons");
10
10
  const ButtonInfo_1 = require("../Buttons/ButtonInfo");
11
11
  //We cannot destructure this.props using the react way in typescript which is a real pain as you
12
12
  //need to transfer props individually as a consequence
13
13
  //let { buttonContent, ...other } = this.props
14
14
  class PanelWithImageCmp extends React.Component {
15
15
  render() {
16
- const IconCmp = icons_1.default[(this.props.icon || this.props.glyphicon)];
16
+ const IconCmp = icons_1.allIcons[(this.props.icon || this.props.glyphicon)];
17
17
  const headerStyle = {};
18
18
  if (this.props.headerColor) {
19
19
  headerStyle.color = this.props.headerColor;
@@ -107,7 +107,6 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
107
107
  };
108
108
  }
109
109
  const options = {
110
- _gridOptions: gridOptions,
111
110
  primaryKey: 'primaryKey',
112
111
  licenseKey: mainAdaptableOptions.licenseKey,
113
112
  userName: `${mainAdaptableOptions.userName}`,
@@ -23,7 +23,7 @@ class PlusMinusSummaryComponent extends React.Component {
23
23
  render() {
24
24
  let moduleSummaries = [];
25
25
  // title row
26
- let titleRow = (React.createElement(ModuleHeader_1.ModuleHeader, { key: this.props.moduleInfo.FriendlyName, moduleInfo: this.props.moduleInfo, moduleSummary: Helper_1.Helper.ReturnItemCount(this.props.PlusMinusNudges.filter((item) => this.props.api.scopeApi.isColumnInScopeColumns(this.props.summarisedColumn, item.Scope)), this.props.moduleInfo.FriendlyName), onNew: () => this.onNew(), newButtonTooltip: 'Plus / Minus Rule', accessLevel: this.props.accessLevel }));
26
+ let titleRow = (React.createElement(ModuleHeader_1.ModuleHeader, { key: this.props.moduleInfo.FriendlyName, moduleInfo: this.props.moduleInfo, moduleSummary: Helper_1.Helper.returnItemCount(this.props.PlusMinusNudges.filter((item) => this.props.api.scopeApi.isColumnInScopeColumns(this.props.summarisedColumn, item.Scope)), this.props.moduleInfo.FriendlyName), onNew: () => this.onNew(), newButtonTooltip: 'Plus / Minus Rule', accessLevel: this.props.accessLevel }));
27
27
  moduleSummaries.push(titleRow);
28
28
  // existing items
29
29
  this.props.PlusMinusNudges.map((item, index) => {
@@ -23,11 +23,10 @@ const BadgeEditor = (props) => {
23
23
  var _a, _b;
24
24
  const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
25
25
  const { badge, columnId, onChange } = props;
26
+ // badges evaluate predicate per value
26
27
  const predicateDefs = api.styledColumnApi.internalApi.getBadgePredicateDefsForColumn(columnId);
27
- let previewValue = 'Hello world';
28
- if (api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Number') {
29
- previewValue = '12345';
30
- }
28
+ const dataType = api.columnApi.getColumnDataTypeForColumnId(columnId);
29
+ const previewValue = dataType === 'Number' || dataType == 'NumberArray' ? '12345' : 'Hello world';
31
30
  return (React.createElement(rebass_1.Flex, { className: "ab-Badge-Definition-Editor", mb: 15, p: 3 },
32
31
  React.createElement(rebass_1.Box, { flex: 1 },
33
32
  React.createElement(FormLayout_1.default, null,
@@ -42,11 +41,12 @@ const BadgeEditor = (props) => {
42
41
  } }),
43
42
  ] },
44
43
  React.createElement(SimpleButton_1.default, { variant: "raised" }, "Edit Badge Style"))),
44
+ !api.columnApi.hasArrayDataType(columnId) && ( // dont show predicates for arrays
45
45
  React.createElement(FormLayout_1.FormRow, { label: 'Predicate' }, columnId ? (React.createElement(React.Fragment, null,
46
46
  React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Create (optional) Rule for when the Badge is displayed; if no Rule provided Badge will always display (unless overriden by another Rule)"),
47
47
  React.createElement(PredicateEditor_1.PredicateEditor, { columnId: columnId, predicate: badge.Predicate, predicateDefs: predicateDefs, placeholder: "No Predicate Selected", onChange: (predicate) => {
48
48
  onChange(Object.assign(Object.assign({}, badge), { Predicate: predicate }));
49
- }, onClear: () => onChange(Object.assign(Object.assign({}, badge), { Predicate: undefined })) }))) : (React.createElement(ErrorBox_1.default, null, "Select a column first"))),
49
+ }, onClear: () => onChange(Object.assign(Object.assign({}, badge), { Predicate: undefined })) }))) : (React.createElement(ErrorBox_1.default, null, "Select a column first")))),
50
50
  React.createElement(FormLayout_1.FormRow, { label: "Icon" },
51
51
  React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Select (optional) Icon (and Icon position) to display in the Badge"),
52
52
  ' ',
@@ -36,7 +36,7 @@ const StyledColumnWizardColumnSection = (props) => {
36
36
  sortableColumns = api.columnApi.getNumericArrayColumns();
37
37
  }
38
38
  else if (data.BadgeStyle) {
39
- sortableColumns = [...api.columnApi.getNumericColumns(), ...api.columnApi.getStringColumns()];
39
+ sortableColumns = [...api.columnApi.getNumericColumns(), ...api.columnApi.getStringColumns(), ...api.columnApi.getStringArrayColumns(), ...api.columnApi.getNumberArrayColumns()];
40
40
  }
41
41
  else {
42
42
  sortableColumns = api.columnApi.getNumericColumns();
@@ -453,7 +453,7 @@ export declare class AdaptableNoCodeWizard implements IAdaptableNoCodeWizard {
453
453
  /**
454
454
  * @param adaptableOptions
455
455
  */
456
- constructor(adaptableOptions: AdaptableOptions, extraOptions?: AdaptableNoCodeWizardOptions);
456
+ constructor(adaptableOptions: AdaptableOptions, extraOptions?: AdaptableNoCodeWizardOptions, agGridOptons?: AgGridConfig);
457
457
  render(container?: HTMLElement | null): void;
458
458
  }
459
459
  export {};
@@ -299,14 +299,23 @@ class Adaptable {
299
299
  static async initInternal(adaptableOptions, runtimeConfig) {
300
300
  let promise = null;
301
301
  if (Array.isArray(adaptableOptions.plugins)) {
302
+ const agGridOptions = {
303
+ gridOptions: runtimeConfig.gridOptions,
304
+ modules: runtimeConfig.modules,
305
+ };
302
306
  // do this
303
307
  for (let plugin of adaptableOptions.plugins) {
304
308
  promise =
305
309
  promise && promise.then
306
310
  ? promise.then(() => {
307
- return plugin.beforeInit(adaptableOptions, runtimeConfig.gridOptions);
311
+ return plugin.beforeInit(adaptableOptions, agGridOptions);
308
312
  })
309
- : plugin.beforeInit(adaptableOptions, runtimeConfig.gridOptions);
313
+ : plugin.beforeInit(adaptableOptions, agGridOptions);
314
+ }
315
+ // if gridOptions changed, we need to update the runtimeConfig
316
+ if (agGridOptions.gridOptions !== runtimeConfig.gridOptions) {
317
+ // This allows plugins to modify
318
+ runtimeConfig.gridOptions = agGridOptions.gridOptions;
310
319
  }
311
320
  // instead of
312
321
  // if (Array.isArray(adaptableOptions.plugins)) {
@@ -317,11 +326,6 @@ class Adaptable {
317
326
  // because this await for of introduces too much delay
318
327
  }
319
328
  const doInit = (ab) => {
320
- // required for NoCode
321
- // it should go away with https://github.com/AdaptableTools/adaptable/issues/2278
322
- if (adaptableOptions._gridOptions) {
323
- runtimeConfig.gridOptions = adaptableOptions._gridOptions;
324
- }
325
329
  return ab.init(adaptableOptions, runtimeConfig, true).then((api) => {
326
330
  if (Array.isArray(adaptableOptions.plugins)) {
327
331
  adaptableOptions.plugins.forEach((plugin) => {
@@ -394,7 +398,6 @@ class Adaptable {
394
398
  this.gridOptions = this.runtimeConfig.gridOptions;
395
399
  // we create AdaptableOptions by merging the values provided by the user with the defaults (where no value has been set)
396
400
  this.adaptableOptions = AdaptableHelper_1.default.assignAdaptableOptions(adaptableOptions);
397
- this.adaptableOptions._gridOptions = this.gridOptions;
398
401
  if (this.hasAutogeneratedPrimaryKey()) {
399
402
  this.logger
400
403
  .warn(`Autogenerated primary key (adaptableOptions.autogeneratedPrimaryKey = TRUE) should be used only as a last resort,
@@ -5221,15 +5224,14 @@ class AdaptableNoCodeWizard {
5221
5224
  /**
5222
5225
  * @param adaptableOptions
5223
5226
  */
5224
- constructor(adaptableOptions, extraOptions = {}) {
5225
- var _a;
5227
+ constructor(adaptableOptions, extraOptions = {}, agGridOptons) {
5226
5228
  const defaultInit = async ({ gridOptions, adaptableOptions, agGridModules, }) => {
5227
5229
  return await Adaptable.init(adaptableOptions, { gridOptions, modules: agGridModules });
5228
5230
  };
5229
5231
  this.adaptableOptions = adaptableOptions;
5230
5232
  this.init = extraOptions.onInit || defaultInit;
5231
5233
  this.extraOptions = extraOptions;
5232
- this.agGridModules = core_1.ModuleRegistry.__getRegisteredModules((_a = this.adaptableOptions._gridOptions) === null || _a === void 0 ? void 0 : _a.gridId);
5234
+ this.agGridModules = core_1.ModuleRegistry.__getRegisteredModules(agGridOptons === null || agGridOptons === void 0 ? void 0 : agGridOptons.gridOptions.gridId);
5233
5235
  this.render();
5234
5236
  }
5235
5237
  render(container) {
@@ -5256,7 +5258,6 @@ class AdaptableNoCodeWizard {
5256
5258
  const unmount = (0, renderReactRoot_1.renderReactRoot)(React.createElement(AdaptableWizardView_1.default, Object.assign(Object.assign({ adaptableOptions: this.adaptableOptions }, this.extraOptions), { onInit: (adaptableOptions, gridOptions) => {
5257
5259
  container.classList.remove('adaptable--in-wizard');
5258
5260
  unmount();
5259
- adaptableOptions._gridOptions = gridOptions;
5260
5261
  this.init({
5261
5262
  adaptableOptions,
5262
5263
  gridOptions: gridOptions,