@adaptabletools/adaptable 11.1.2 → 11.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.1.2",
3
+ "version": "11.1.3",
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: 1648639602191;
1
+ declare const _default: 1648804784989;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1648639602191;
3
+ exports.default = 1648804784989;
@@ -17,7 +17,7 @@ export interface ContainerOptions {
17
17
  */
18
18
  agGridContainer?: string | HTMLElement;
19
19
  /**
20
- * how long AdapTable waits for AG Grid before giving up connecting to it; useful when AG Grid is instantiated separately (eg: by AdapTable React or AdapTable Angular)
20
+ * How long AdapTable waits for AG Grid before giving up connecting to it
21
21
  *
22
22
  * @defaultValue 60s
23
23
  * @gridInfoItem
@@ -59,7 +59,7 @@ export interface NotificationsOptions {
59
59
  */
60
60
  transition?: 'Bounce' | 'Slide' | 'Zoom' | 'Flip';
61
61
  /**
62
- * Display an Alert when a System Status Message is set
62
+ * Display System Status Messages as Notifications
63
63
  *
64
64
  * @defaultValue false
65
65
  * @gridInfoItem
@@ -73,7 +73,7 @@ export interface NotificationsOptions {
73
73
  */
74
74
  maxSystemMessagesInStore?: number;
75
75
  /**
76
- * Displays the application icon in Notifications (if provided in `UserInterfaceOptions`)
76
+ * Displays the application icon in Notifications
77
77
  * @defaultValue false
78
78
  */
79
79
  showApplicationIcon?: boolean;
@@ -83,12 +83,31 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
83
83
  // TODO: state does not clear
84
84
  this.api.internalApi.clearFlashingCellState();
85
85
  }
86
- //migrate alert definitions with `AggregationExpression` (now `AggregatedBooleanExpression`)
87
86
  (_a = alertState.AlertDefinitions) === null || _a === void 0 ? void 0 : _a.forEach((alertDefinition) => {
88
- // @ts-ignore
89
- const obsoleteAggregationExpression = alertDefinition.Rule['AggregationExpression'];
90
- if (obsoleteAggregationExpression) {
91
- alertDefinition.Rule.AggregatedBooleanExpression = obsoleteAggregationExpression;
87
+ // if ShowPopup then change to DisplayNotificate
88
+ if (alertDefinition.AlertProperties &&
89
+ alertDefinition.AlertProperties.ShowPopup &&
90
+ alertDefinition.AlertProperties.ShowPopup == true &&
91
+ !alertDefinition.AlertProperties.DisplayNotification) {
92
+ alertDefinition.AlertProperties.DisplayNotification = true;
93
+ alertDefinition.AlertProperties.ShowPopup = undefined;
94
+ }
95
+ // if no rule but a predicate then use that
96
+ if (!alertDefinition.Rule) {
97
+ if (alertDefinition.Predicate && alertDefinition.Predicate != undefined) {
98
+ const predicate = alertDefinition.Predicate;
99
+ alertDefinition.Rule = {
100
+ Predicate: predicate,
101
+ };
102
+ alertDefinition.Predicate = undefined;
103
+ }
104
+ }
105
+ else {
106
+ //migrate alert definitions with `AggregationExpression` (now `AggregatedBooleanExpression`)
107
+ const obsoleteAggregationExpression = alertDefinition.Rule['AggregationExpression'];
108
+ if (obsoleteAggregationExpression) {
109
+ alertDefinition.Rule.AggregatedBooleanExpression = obsoleteAggregationExpression;
110
+ }
92
111
  }
93
112
  });
94
113
  }
@@ -100,10 +100,10 @@ exports.GridInfoPopup = (props) => {
100
100
  const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo, showAdaptableObjects].filter((item) => item).length > 1;
101
101
  return (React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Grid Info', glyphicon: 'info-sign' },
102
102
  React.createElement(rebass_1.Flex, { marginBottom: 2, padding: 3 }, showRadioButtons && (React.createElement(React.Fragment, null,
103
- showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Grid Summary")),
104
- showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Adaptable Options")),
105
- showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", marginRight: 3, value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Column Info")),
106
- showAdaptableObjects && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'AdaptableObjectsSummary', onChange: (_, e) => onShowGridSummaryChanged('AdaptableObjectsSummary') }, "Adaptable Objects"))))),
103
+ showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Summary")),
104
+ showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Options")),
105
+ showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", marginRight: 3, value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Columns")),
106
+ showAdaptableObjects && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'AdaptableObjectsSummary', onChange: (_, e) => onShowGridSummaryChanged('AdaptableObjectsSummary') }, "Objects"))))),
107
107
  state.ActiveTab == 'GridSummary' && (React.createElement(rebass_1.Box, { margin: 2 },
108
108
  React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { colItems: propValueColItems, items: gridSummaries }))),
109
109
  state.ActiveTab == 'AdaptableOptions' && React.createElement(AdaptableOptionsComponent_1.AdaptableOptionsComponent, { api: props.api }),
@@ -347,10 +347,7 @@ exports.LayoutEditor = React.memo((props) => {
347
347
  React.createElement(icons_1.Icon, { name: "clear" }))));
348
348
  } })),
349
349
  React.createElement(ListPanel, { className: "ab-LayoutEditor__PivotListPanel", header: React.createElement(rebass_1.Flex, { width: "100%", flexDirection: "row", justifyContent: "space-between", alignItems: "center" },
350
- React.createElement(rebass_1.Text, null, "Pivoted Columns"),
351
- React.createElement(CheckBox_1.CheckBox, { mt: 0, mb: 0, checked: layout.EnablePivot, onChange: (checked) => {
352
- setLayout(Object.assign(Object.assign({}, layout), { EnablePivot: checked }));
353
- } }, "Enable")), bodyProps: { padding: 0 } },
350
+ React.createElement(rebass_1.Text, null, "Pivoted Columns")), bodyProps: { padding: 0 } },
354
351
  React.createElement(PivotList_1.PivotList, { pivotColumns: layout.PivotColumns, onPivotColumnsChange: onPivotColumnsChange, isDropDisabled: state.dropDisabledOnPivot, onReady: (dragEnd) => {
355
352
  onDragEndRef.current.pivotList = dragEnd;
356
353
  }, renderItem: (colId, clear) => {
@@ -12,6 +12,7 @@ const AdaptablePopover_1 = require("../../AdaptablePopover");
12
12
  const rebass_1 = require("rebass");
13
13
  const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
14
14
  const ColumnLabels_1 = require("./LayoutEditor/ColumnLabels");
15
+ const CheckBox_1 = require("../../../components/CheckBox");
15
16
  class LayoutEditorWizard extends React.Component {
16
17
  constructor(props) {
17
18
  super(props);
@@ -80,7 +81,11 @@ class LayoutEditorWizard extends React.Component {
80
81
  ' '),
81
82
  this.state.errorMessage ? (React.createElement(FormLayout_1.FormRow, { label: "" },
82
83
  React.createElement(ErrorBox_1.default, null, this.state.errorMessage))) : null)),
83
- React.createElement(rebass_1.Flex, { flex: 1, pr: 2, alignItems: "center", justifyContent: "end" },
84
+ React.createElement(rebass_1.Flex, { flex: 1, alignItems: "center", justifyContent: "flex-end" },
85
+ React.createElement(CheckBox_1.CheckBox, { mt: 0, mb: 0, checked: this.state.layout.EnablePivot, onChange: (checked) => {
86
+ this.updateLayout({ EnablePivot: checked });
87
+ } }, "Enable Pivot Layout")),
88
+ React.createElement(rebass_1.Flex, { width: 120, pr: 2, alignItems: "center", justifyContent: "end" },
84
89
  React.createElement(rebass_1.Text, { mr: 2 }, "Legend"),
85
90
  React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 200, bodyText: [
86
91
  React.createElement(Panel_1.default, { variant: "modern", header: "Legend: Column Behaviour", className: "ab-LayoutEditor__LegendPanel", style: {
@@ -131,6 +131,7 @@ export declare class Adaptable implements IAdaptable {
131
131
  private getAlertRowClass;
132
132
  private getAlertRowStyle;
133
133
  private getFlashingCellStyle;
134
+ private getFlashingCellClass;
134
135
  private getCellHighlightStyle;
135
136
  private getRowHighlightStyle;
136
137
  private getRowHighlightClass;
@@ -903,6 +903,20 @@ class Adaptable {
903
903
  ? flashingCell.flashingCellDefinition.DownChangeStyle
904
904
  : flashingCell.flashingCellDefinition.NeutralChangeStyle)) !== null && _a !== void 0 ? _a : {});
905
905
  }
906
+ getFlashingCellClass(col, params) {
907
+ var _a, _b, _c;
908
+ const primaryKey = params.node.aggData
909
+ ? params.node.id
910
+ : this.getPrimaryKeyValueFromRowNode(params.node);
911
+ const flashingCell = this.api.internalApi.getAdaptableFlashingCellFor(primaryKey, col.columnId);
912
+ if (!flashingCell) {
913
+ return;
914
+ }
915
+ return flashingCell.direction === 'up'
916
+ ? (_a = flashingCell.flashingCellDefinition.UpChangeStyle) === null || _a === void 0 ? void 0 : _a.ClassName : flashingCell.direction === 'down'
917
+ ? (_b = flashingCell.flashingCellDefinition.DownChangeStyle) === null || _b === void 0 ? void 0 : _b.ClassName : flashingCell.direction === 'neutral'
918
+ ? (_c = flashingCell.flashingCellDefinition.NeutralChangeStyle) === null || _c === void 0 ? void 0 : _c.ClassName : undefined;
919
+ }
906
920
  getCellHighlightStyle(col, params) {
907
921
  const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
908
922
  const cellHightlight = this.api.internalApi
@@ -994,8 +1008,7 @@ class Adaptable {
994
1008
  return (_b = conditionalStyle.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
995
1009
  }
996
1010
  })
997
- .filter((x) => !!x)
998
- .join(' ');
1011
+ .filter((x) => !!x);
999
1012
  return classNames;
1000
1013
  }
1001
1014
  getEditableCellClass(abColumn, params) {
@@ -2092,7 +2105,10 @@ class Adaptable {
2092
2105
  if (newlyCreatedSpecialColDef) {
2093
2106
  // if it's a special column and we have a special col def for it, return the special col def
2094
2107
  processedSpecialColDefIds.push(colDef.colId);
2095
- return newlyCreatedSpecialColDef;
2108
+ // merge the user defined colDef with the special col def
2109
+ // this way the user may provide some custom settings for the special col def (tooltip, etc)
2110
+ const mergedColDef = Object.assign(Object.assign({}, colDef), newlyCreatedSpecialColDef);
2111
+ return mergedColDef;
2096
2112
  }
2097
2113
  else {
2098
2114
  // otherwise, return the original col def
@@ -2841,14 +2857,13 @@ class Adaptable {
2841
2857
  const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
2842
2858
  const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
2843
2859
  const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
2844
- const classNameMap = {};
2845
2860
  const cellClass = (params) => {
2846
- var _a;
2847
2861
  const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
2848
2862
  const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
2849
2863
  const editableClassName = this.getEditableCellClass(abColumn, params);
2850
2864
  const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
2851
2865
  const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
2866
+ const flashingClassName = this.getFlashingCellClass(abColumn, params);
2852
2867
  const returnValue = [
2853
2868
  this.getExcelClassNameForCell(colId, primaryKeyValue),
2854
2869
  typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
@@ -2860,29 +2875,11 @@ class Adaptable {
2860
2875
  editableClassName,
2861
2876
  readonlyClassName,
2862
2877
  highlightAlertClassName,
2878
+ flashingClassName,
2863
2879
  ]
2864
- // we flatten the array because 'userCellClass' might return a string[]
2880
+ // we flatten the array because some rules ('userCellClass',conditionalStyles etc) might return a string[]
2865
2881
  .flat()
2866
2882
  .filter((x) => !!x);
2867
- const returnValueHash = returnValue.join(' ');
2868
- const primaryKey = this.getPrimaryKeyValueFromRowNode(params.node);
2869
- const key = `${primaryKey}:${params.colDef.colId}`;
2870
- if (classNameMap[key] &&
2871
- classNameMap[key] !== returnValueHash &&
2872
- // only hard-reset when removing class-names
2873
- // ag-grid does not remove class-names, it accumulates them
2874
- // https://www.ag-grid.com/javascript-data-grid/cell-styles/#refresh-of-styles
2875
- returnValueHash.length < ((_a = classNameMap[key]) === null || _a === void 0 ? void 0 : _a.length)) {
2876
- setTimeout(() => {
2877
- /**
2878
- * This is called inside a getter function, inside ag-grid.
2879
- * To allow ag-grid run it's logic, the redraw is done inside an timeout
2880
- * to make sure it is not done in an inappropriate time.
2881
- */
2882
- params.api.redrawRows({ rowNodes: [params.node] });
2883
- }, 0);
2884
- }
2885
- classNameMap[key] = returnValueHash;
2886
2883
  return returnValue.length ? returnValue : undefined;
2887
2884
  };
2888
2885
  return cellClass;
@@ -3601,6 +3601,11 @@ export declare const ADAPTABLE_METAMODEL: {
3601
3601
  isOptional: boolean;
3602
3602
  }[];
3603
3603
  };
3604
+ TOAST_POSITIONS: {
3605
+ name: string;
3606
+ kind: string;
3607
+ description: string;
3608
+ };
3604
3609
  ToolPanelApi: {
3605
3610
  name: string;
3606
3611
  kind: string;
@@ -3574,7 +3574,7 @@ exports.ADAPTABLE_METAMODEL = {
3574
3574
  {
3575
3575
  "name": "agGridContainerWaitTimeout",
3576
3576
  "kind": "number",
3577
- "description": "how long AdapTable waits for AG Grid before giving up connecting to it; useful when AG Grid is instantiated separately (eg: by AdapTable React or AdapTable Angular)",
3577
+ "description": "How long AdapTable waits for AG Grid before giving up connecting to it",
3578
3578
  "uiLabel": "Ag Grid Container Wait Timeout",
3579
3579
  "isOptional": true,
3580
3580
  "gridInfo": "item",
@@ -8599,12 +8599,12 @@ exports.ADAPTABLE_METAMODEL = {
8599
8599
  "isOptional": true,
8600
8600
  "gridInfo": "item",
8601
8601
  "defaultValue": "&#39;BottomRight&#39;",
8602
- "reference": "unknown"
8602
+ "reference": "TOAST_POSITIONS"
8603
8603
  },
8604
8604
  {
8605
8605
  "name": "showApplicationIcon",
8606
8606
  "kind": "boolean",
8607
- "description": "Displays the application icon in Notifications (if provided in `UserInterfaceOptions`)",
8607
+ "description": "Displays the application icon in Notifications",
8608
8608
  "uiLabel": "Show Application Icon",
8609
8609
  "isOptional": true,
8610
8610
  "defaultValue": "false"
@@ -8621,7 +8621,7 @@ exports.ADAPTABLE_METAMODEL = {
8621
8621
  {
8622
8622
  "name": "showSystemStatusMessageNotifications",
8623
8623
  "kind": "boolean",
8624
- "description": "Display an Alert when a System Status Message is set",
8624
+ "description": "Display System Status Messages as Notifications",
8625
8625
  "uiLabel": "Show System Status Message Notifications",
8626
8626
  "isOptional": true,
8627
8627
  "gridInfo": "item",
@@ -11179,6 +11179,11 @@ exports.ADAPTABLE_METAMODEL = {
11179
11179
  }
11180
11180
  ]
11181
11181
  },
11182
+ "TOAST_POSITIONS": {
11183
+ "name": "TOAST_POSITIONS",
11184
+ "kind": "TypeAlias",
11185
+ "description": "Different positions offered by Notifications"
11186
+ },
11182
11187
  "ToolPanelApi": {
11183
11188
  "name": "ToolPanelApi",
11184
11189
  "kind": "Interface",
package/src/types.d.ts CHANGED
@@ -9,7 +9,7 @@ export type { AdaptableOptions } from './AdaptableOptions/AdaptableOptions';
9
9
  export { AdaptablePlugin } from './AdaptableOptions/AdaptablePlugin';
10
10
  export type { ContainerOptions } from './AdaptableOptions/ContainerOptions';
11
11
  export type { FlashingCellOptions } from './AdaptableOptions/FlashingCellOptions';
12
- export type { NotificationsOptions } from './AdaptableOptions/NotificationsOptions';
12
+ export type { TOAST_POSITIONS, NotificationsOptions, } from './AdaptableOptions/NotificationsOptions';
13
13
  export type { AlertOptions, ActionHandler, AlertForm, AlertButtonContext, } from './AdaptableOptions/AlertOptions';
14
14
  export type { DashboardOptions, CustomToolbar, DashboardButtonContext, CustomToolbarButtonContext, } from './AdaptableOptions/DashboardOptions';
15
15
  export type { EditOptions, ValidationResult } from './AdaptableOptions/EditOptions';
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "11.1.2";
1
+ declare const _default: "11.1.3";
2
2
  export default _default;
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '11.1.2'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '11.1.3'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version