@adaptabletools/adaptable 11.0.2-canary.0 → 11.0.4

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.
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPercentBarRendererForColumn = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
6
+ const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
7
+ const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
8
+ exports.getPercentBarRendererForColumn = (formatColumn, api) => {
9
+ var _a;
10
+ if (!((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle)) {
11
+ return;
12
+ }
13
+ return class PercentBarRenderer {
14
+ init(params) {
15
+ if (!formatColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
16
+ return;
17
+ }
18
+ const min = api.formatColumnApi.getNumericStyleMinValue(formatColumn.ColumnStyle, params.node, params.value);
19
+ const max = api.formatColumnApi.getNumericStyleMaxValue(formatColumn.ColumnStyle, params.node, params.value);
20
+ let value = params.value;
21
+ if (Helper_1.default.objectNotExists(value)) {
22
+ value = 0;
23
+ }
24
+ const clampedValue = clamp_1.default(value, min, max);
25
+ const percentageValue = ((clampedValue - min) / (max - min)) * 100;
26
+ let cellBackColor;
27
+ const percentBarStyle = formatColumn.ColumnStyle.PercentBarStyle;
28
+ if (percentBarStyle.ColumnComparison) {
29
+ cellBackColor = percentBarStyle.ColumnComparison.Color;
30
+ }
31
+ else {
32
+ const matchingRange = percentBarStyle.CellRanges.find((r) => r.Min <= clampedValue && r.Max >= clampedValue);
33
+ if (matchingRange) {
34
+ cellBackColor = matchingRange.Color;
35
+ }
36
+ }
37
+ if (cellBackColor) {
38
+ this.eGui = document.createElement('div');
39
+ this.eGui.className = 'ab-PercentBar__wrapper';
40
+ this.eGui.style.height = percentBarStyle.CellText ? '80%' : '100%';
41
+ this.eGui.style.display = 'flex';
42
+ this.eGui.style.flexDirection = 'column';
43
+ this.eGui.style.justifyContent = 'center';
44
+ const barEl = document.createElement('div');
45
+ barEl.className = 'ab-PercentBar__bar';
46
+ barEl.style.background = percentBarStyle.BackColor;
47
+ barEl.style.flex = '1';
48
+ const barInsideEl = document.createElement('div');
49
+ barInsideEl.className = 'ab-PercentBar__barInside';
50
+ barInsideEl.style.background = cellBackColor;
51
+ barInsideEl.style.height = '100%';
52
+ barInsideEl.style.width = `${percentageValue.toFixed(0)}%`;
53
+ barEl.append(barInsideEl);
54
+ this.eGui.append(barEl);
55
+ if (percentBarStyle.CellText) {
56
+ const textEl = document.createElement('div');
57
+ textEl.className = 'ab-PercentBar__text';
58
+ textEl.style.lineHeight = '1.2';
59
+ if (percentBarStyle.CellText.includes('CellValue')) {
60
+ if (formatColumn.DisplayFormat) {
61
+ const options = formatColumn.DisplayFormat
62
+ .Options;
63
+ if (options) {
64
+ value = FormatHelper_1.default.NumberFormatter(params.value, options);
65
+ }
66
+ }
67
+ textEl.innerText = value;
68
+ }
69
+ if (percentBarStyle.CellText.includes('PercentageValue')) {
70
+ textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
71
+ }
72
+ this.eGui.append(textEl);
73
+ }
74
+ }
75
+ }
76
+ getGui() {
77
+ return this.eGui;
78
+ }
79
+ refresh(params) {
80
+ return true;
81
+ }
82
+ };
83
+ };
@@ -22,7 +22,7 @@ export declare class agGridHelper {
22
22
  setUpModules(): Map<AdaptableModule, IModule>;
23
23
  TrySetUpNodeIds(): boolean;
24
24
  createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
25
- createNumericStyleRendererFunc(formatColumn: FormatColumn): ICellRendererFunc;
25
+ createPercentBarRendererComp(formatColumn: FormatColumn): ICellRendererFunc;
26
26
  getCleanValue(value: string): string | undefined;
27
27
  getRenderedValue(colDef: ColDef, valueToRender: any): any;
28
28
  createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.agGridHelper = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
6
5
  const Enums_1 = require("../PredefinedConfig/Common/Enums");
7
6
  const Uuid_1 = require("../PredefinedConfig/Uuid");
8
7
  const AlertModule_1 = require("../Strategy/AlertModule");
@@ -33,14 +32,13 @@ const ToolPanelModule_1 = require("../Strategy/ToolPanelModule");
33
32
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
34
33
  const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
35
34
  const StringExtensions_1 = require("../Utilities/Extensions/StringExtensions");
36
- const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
37
35
  const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
38
- const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
39
36
  const CheckboxRenderer_1 = require("./CheckboxRenderer");
40
37
  const DataChangeHistoryModule_1 = require("../Strategy/DataChangeHistoryModule");
41
38
  const FlashingCellModule_1 = require("../Strategy/FlashingCellModule");
42
39
  const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
43
40
  const ChartingModule_1 = require("../Strategy/ChartingModule");
41
+ const PercentBarRenderer_1 = require("./PercentBarRenderer");
44
42
  const tinycolor = require('tinycolor2');
45
43
  /**
46
44
  * Adaptable AG Grid implementation is getting really big and unwieldy
@@ -121,77 +119,8 @@ class agGridHelper {
121
119
  createCheckboxRendererComp(columnId, isColumnReadOnly) {
122
120
  return CheckboxRenderer_1.getCheckboxRendererForColumn(columnId, isColumnReadOnly, this.adaptable.api);
123
121
  }
124
- createNumericStyleRendererFunc(formatColumn) {
125
- const numericStyle = formatColumn.ColumnStyle;
126
- if (!numericStyle || numericStyle.CheckBoxStyle) {
127
- return;
128
- }
129
- const cellRendererFunc = (params) => {
130
- if (!formatColumn.IncludeGroupedRows && this.adaptable.isGroupRowNode(params.node)) {
131
- return;
132
- }
133
- const min = this.adaptable.api.formatColumnApi.getNumericStyleMinValue(numericStyle, params.node, params.value);
134
- const max = this.adaptable.api.formatColumnApi.getNumericStyleMaxValue(numericStyle, params.node, params.value);
135
- let value = params.value;
136
- if (Helper_1.default.objectNotExists(value)) {
137
- value = 0;
138
- }
139
- const percentBarStyle = numericStyle.PercentBarStyle;
140
- if (percentBarStyle) {
141
- const clampedValue = clamp_1.default(value, min, max);
142
- const percentageValue = ((clampedValue - min) / (max - min)) * 100;
143
- let cellBackColor;
144
- if (percentBarStyle.ColumnComparison) {
145
- cellBackColor = percentBarStyle.ColumnComparison.Color;
146
- }
147
- else {
148
- const matchingRange = percentBarStyle.CellRanges.find((r) => r.Min <= clampedValue && r.Max >= clampedValue);
149
- if (matchingRange) {
150
- cellBackColor = matchingRange.Color;
151
- }
152
- }
153
- if (cellBackColor) {
154
- const wrapperEl = document.createElement('div');
155
- wrapperEl.className = 'ab-PercentBar__wrapper';
156
- wrapperEl.style.height = percentBarStyle.CellText ? '80%' : '100%';
157
- wrapperEl.style.display = 'flex';
158
- wrapperEl.style.flexDirection = 'column';
159
- wrapperEl.style.justifyContent = 'center';
160
- const barEl = document.createElement('div');
161
- barEl.className = 'ab-PercentBar__bar';
162
- barEl.style.background = percentBarStyle.BackColor;
163
- barEl.style.flex = '1';
164
- const barInsideEl = document.createElement('div');
165
- barInsideEl.className = 'ab-PercentBar__barInside';
166
- barInsideEl.style.background = cellBackColor;
167
- barInsideEl.style.height = '100%';
168
- barInsideEl.style.width = `${percentageValue.toFixed(0)}%`;
169
- barEl.append(barInsideEl);
170
- wrapperEl.append(barEl);
171
- if (percentBarStyle.CellText) {
172
- const textEl = document.createElement('div');
173
- textEl.className = 'ab-PercentBar__text';
174
- textEl.style.lineHeight = '1.2';
175
- if (percentBarStyle.CellText.includes('CellValue')) {
176
- if (formatColumn.DisplayFormat) {
177
- const options = formatColumn.DisplayFormat
178
- .Options;
179
- if (options) {
180
- value = FormatHelper_1.default.NumberFormatter(params.value, options);
181
- }
182
- }
183
- textEl.innerText = value;
184
- }
185
- if (percentBarStyle.CellText.includes('PercentageValue')) {
186
- textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
187
- }
188
- wrapperEl.append(textEl);
189
- }
190
- return wrapperEl;
191
- }
192
- }
193
- };
194
- return cellRendererFunc;
122
+ createPercentBarRendererComp(formatColumn) {
123
+ return PercentBarRenderer_1.getPercentBarRendererForColumn(formatColumn, this.adaptable.api);
195
124
  }
196
125
  getCleanValue(value) {
197
126
  if (value == null || value == 'null' || value == undefined || value == 'undefined') {
@@ -497,6 +497,11 @@ export declare const ADAPTABLE_METAMODEL: {
497
497
  reference: string;
498
498
  })[];
499
499
  };
500
+ AdaptableQuery: {
501
+ name: string;
502
+ kind: string;
503
+ description: string;
504
+ };
500
505
  AdaptableReadyInfo: {
501
506
  name: string;
502
507
  kind: string;
@@ -1998,15 +2003,6 @@ export declare const ADAPTABLE_METAMODEL: {
1998
2003
  defaultValue: string;
1999
2004
  gridInfo?: undefined;
2000
2005
  reference?: undefined;
2001
- } | {
2002
- name: string;
2003
- kind: string;
2004
- description: string;
2005
- uiLabel: string;
2006
- isOptional: boolean;
2007
- gridInfo?: undefined;
2008
- defaultValue?: undefined;
2009
- reference?: undefined;
2010
2006
  } | {
2011
2007
  name: string;
2012
2008
  kind: string;
@@ -1328,6 +1328,11 @@ exports.ADAPTABLE_METAMODEL = {
1328
1328
  }
1329
1329
  ]
1330
1330
  },
1331
+ "AdaptableQuery": {
1332
+ "name": "AdaptableQuery",
1333
+ "kind": "TypeAlias",
1334
+ "description": "An AdaptableQuery can be either a Boolean, Scalar, Observable, AggregatedBoolean, or AggregatedScalar expression"
1335
+ },
1331
1336
  "AdaptableReadyInfo": {
1332
1337
  "name": "AdaptableReadyInfo",
1333
1338
  "kind": "Interface",
@@ -2433,6 +2438,12 @@ exports.ADAPTABLE_METAMODEL = {
2433
2438
  "description": "Retrieves currently selected Cell Summary Operation",
2434
2439
  "uiLabel": "Get Current Cell Summary Operation"
2435
2440
  },
2441
+ {
2442
+ "name": "setCurrentCellSummaryOperation",
2443
+ "kind": "function",
2444
+ "description": "Sets the currently selected Cell Summary Operation",
2445
+ "uiLabel": "Set Current Cell Summary Operation"
2446
+ },
2436
2447
  {
2437
2448
  "name": "showCellSummaryPopup",
2438
2449
  "kind": "function",
@@ -5685,9 +5696,11 @@ exports.ADAPTABLE_METAMODEL = {
5685
5696
  {
5686
5697
  "name": "quickFilterHeight",
5687
5698
  "kind": "number",
5688
- "description": "TODO: add comment",
5699
+ "description": "Sets a height for Quick Filter Bar (if not provided AG Grid&#39;s default is used)",
5689
5700
  "uiLabel": "Quick Filter Height",
5690
- "isOptional": true
5701
+ "isOptional": true,
5702
+ "gridInfo": "item",
5703
+ "defaultValue": "null"
5691
5704
  },
5692
5705
  {
5693
5706
  "name": "quickFilterTrigger",
package/src/types.d.ts CHANGED
@@ -104,6 +104,7 @@ export type { AdaptableFormat, DateFormatterOptions, NumberFormatterOptions, Str
104
104
  export type { AdaptableMessageType } from './PredefinedConfig/Common/AdaptableMessageType';
105
105
  export type { AdaptableObject } from './PredefinedConfig/Common/AdaptableObject';
106
106
  export type { SuspendableObject } from './PredefinedConfig/Common/SuspendableObject';
107
+ export type { AdaptableQuery, AdaptableAggregatedBooleanQuery, AdaptableAggregatedScalarQuery, AdaptableBooleanQuery, AdaptableObservableQuery, AdaptableScalarQuery, } from './PredefinedConfig/Common/AdaptableQuery';
107
108
  export type { AdaptablePredicate, AdaptablePredicateDef, ModuleScope, PredicateDefHandlerParams, PredicateDefInput, PredicateDefToStringParams, } from './PredefinedConfig/Common/AdaptablePredicate';
108
109
  export type { FDC3Context, InstrumentContext } from './PredefinedConfig/Common/FDC3Context';
109
110
  export type { AdaptableScope } from './PredefinedConfig/Common/AdaptableScope';
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "11.0.2-canary.0";
1
+ declare const _default: "11.0.4";
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.0.2-canary.0'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '11.0.4'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version