@adaptabletools/adaptable 20.1.0 → 20.1.1

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": "20.1.0",
3
+ "version": "20.1.1",
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",
@@ -38,7 +38,7 @@ export interface ColumnOptions {
38
38
  /**
39
39
  * Common properties for Column Header Context
40
40
  */
41
- export type BaseColumnHeaderContext = {
41
+ export interface BaseColumnHeaderContext extends BaseContext {
42
42
  /**
43
43
  * The default header name for the column
44
44
  */
@@ -55,8 +55,163 @@ export type BaseColumnHeaderContext = {
55
55
  * The current Layout
56
56
  */
57
57
  currentLayout: Layout;
58
- } & BaseContext;
59
- export type ColumnHeaderContext = BaseColumnHeaderContext & ({
58
+ }
59
+ export interface AutoGroupColumnHeaderContext extends BaseColumnHeaderContext {
60
+ /**
61
+ * Auto-generated Group Column when GroupDisplayType is `single` column
62
+ */
63
+ columnType: 'autoGroupColumn';
64
+ /**
65
+ * Technical ID of the Column
66
+ */
67
+ columnId: string;
68
+ /**
69
+ * IDs of the Columns that are grouped
70
+ */
71
+ groupedColumnIds: string[];
72
+ }
73
+ export interface RowGroupColumnHeaderContext extends BaseColumnHeaderContext {
74
+ /**
75
+ * Group Columns - see `TableLayout.RowGroupedColumns` or `PivotLayout.PivotGroupedColumns`
76
+ */
77
+ columnType: 'groupColumn';
78
+ /**
79
+ * Technical ID of the Column
80
+ */
81
+ columnId: string;
82
+ /**
83
+ * ID of the grouped Column
84
+ */
85
+ groupColumnId: string;
86
+ }
87
+ export interface TableColumnHeaderContext extends BaseColumnHeaderContext {
88
+ /**
89
+ * Table Column - see `TableLayout.TableColumns`
90
+ */
91
+ columnType: 'tableColumn';
92
+ /**
93
+ * Technical ID of the Column
94
+ */
95
+ columnId: string;
96
+ /**
97
+ * Optional Aggregation function of the Column - see `TableLayout.TableAggregationColumns`
98
+ */
99
+ aggregation?: string;
100
+ }
101
+ export interface TableColumnGroupHeaderContext extends BaseColumnHeaderContext {
102
+ /**
103
+ * Column Group - see https://www.ag-grid.com/javascript-data-grid/column-groups/
104
+ */
105
+ columnType: 'tableColumnGroup';
106
+ /**
107
+ * Technical ID of the Column Group - see `ColGroupDef.groupId`
108
+ */
109
+ groupId: string;
110
+ /**
111
+ * IDs of the Column Group children - see `ColGroupDef.children`
112
+ */
113
+ childrenColumnIds: string[];
114
+ /**
115
+ * State of the Column Group
116
+ */
117
+ state: 'expanded' | 'collapsed';
118
+ }
119
+ export interface PivotColumnGroupHeaderContext extends BaseColumnHeaderContext {
120
+ /**
121
+ * Pivot Column - see `PivotLayout.PivotColumns`
122
+ */
123
+ columnType: 'pivotColumnGroup';
124
+ /**
125
+ * Technical ID of the generated Column Group
126
+ */
127
+ groupId: string;
128
+ /**
129
+ * Pivot Keys for the current Column Group
130
+ */
131
+ pivotKeys: string[];
132
+ /**
133
+ * State of the Column Group
134
+ */
135
+ state: 'expanded' | 'collapsed';
136
+ }
137
+ export interface PivotAggregationColumnHeaderContext extends BaseColumnHeaderContext {
138
+ /**
139
+ * Pivot Aggregation Column - see `PivotLayout.PivotAggregationColumns`
140
+ */
141
+ columnType: 'pivotAggregationColumn';
142
+ /**
143
+ * Technical ID of the generated Column
144
+ */
145
+ columnId: string;
146
+ /**
147
+ * Current Pivot Keys
148
+ */
149
+ pivotKeys: string[];
150
+ /**
151
+ * ID of the Aggregated Column - see `PivotLayout.PivotAggregationColumns`
152
+ */
153
+ aggregatedColumnId: string;
154
+ /**
155
+ * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
156
+ */
157
+ aggregation: string;
158
+ }
159
+ export interface PivotGrandTotalHeaderContext extends BaseColumnHeaderContext {
160
+ /**
161
+ * Pivot Grand Total - see `PivotLayout.PivotGrandTotal`
162
+ */
163
+ columnType: 'pivotGrandTotal';
164
+ /**
165
+ * ID of the Aggregated Column - see `PivotLayout.PivotAggregationColumns`
166
+ */
167
+ aggregatedColumnId: string;
168
+ /**
169
+ * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
170
+ */
171
+ aggregation: string;
172
+ }
173
+ export interface PivotColumnTotalHeaderContext extends BaseColumnHeaderContext {
174
+ /**
175
+ * Pivot Column Total - see `PivotLayout.PivotColumnTotal`
176
+ */
177
+ columnType: 'pivotColumnTotal';
178
+ /**
179
+ * Current Pivot Keys
180
+ */
181
+ pivotKey: string;
182
+ /**
183
+ * ID of the Pivot Column - see `PivotLayout.PivotColumns`
184
+ */
185
+ pivotColumnId: string;
186
+ /**
187
+ * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
188
+ */
189
+ aggregation: string;
190
+ }
191
+ export interface PivotAggregationTotalHeaderContext extends BaseColumnHeaderContext {
192
+ /**
193
+ * Pivot Aggregation Total Column - see `PivotLayout.PivotAggregationColumns.TotalColumn`
194
+ */
195
+ columnType: 'pivotAggregationTotal';
196
+ /**
197
+ * ID of the Aggregated Column - see `PivotLayout.PivotAggregationColumns`
198
+ */
199
+ aggregatedColumnId: string;
200
+ /**
201
+ * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
202
+ */
203
+ aggregation: string;
204
+ /**
205
+ * ID of the Pivot Column - see `PivotLayout.PivotColumns`
206
+ */
207
+ pivotColumnId: string;
208
+ /**
209
+ * Current Pivot Keys
210
+ */
211
+ pivotKey: string;
212
+ }
213
+ export type ColumnHeaderContext = TableColumnHeaderContext | TableColumnGroupHeaderContext | AutoGroupColumnHeaderContext | RowGroupColumnHeaderContext | PivotColumnGroupHeaderContext | PivotAggregationColumnHeaderContext | PivotGrandTotalHeaderContext | PivotColumnTotalHeaderContext | PivotAggregationTotalHeaderContext;
214
+ export type ColumnHeaderContextOld = BaseColumnHeaderContext & ({
60
215
  /**
61
216
  * Auto-generated Group Column when GroupDisplayType is `single` column
62
217
  */
@@ -1,4 +1,4 @@
1
- import { FormatColumn } from '../../../../types';
1
+ import { FormatColumn } from '../../../AdaptableState/FormatColumnState';
2
2
  export declare const getFormatColumnSettingsViewItems: (formatColumn: FormatColumn) => {
3
3
  name: string;
4
4
  values: string[];
@@ -1,12 +1,21 @@
1
1
  export const getFormatColumnSettingsViewItems = (formatColumn) => {
2
- const values = [
3
- `Cell alignment: ${formatColumn.CellAlignment ?? 'default'}`,
4
- `Data Rows: ${formatColumn.RowScope?.ExcludeDataRows ? 'Yes' : 'No'}`,
5
- `Group Rows: ${formatColumn.RowScope?.ExcludeGroupRows ? 'Yes' : 'No'}`,
6
- `Row Summaries: ${formatColumn.RowScope?.ExcludeSummaryRows ? 'Yes' : 'No'}`,
7
- ].filter(Boolean);
2
+ let values = [];
3
+ if (formatColumn.CellAlignment) {
4
+ values.push(`Cell Alignment: ${formatColumn.CellAlignment}`);
5
+ }
6
+ if (formatColumn.RowScope) {
7
+ if (formatColumn.RowScope.ExcludeDataRows) {
8
+ values.push('Exclude Data Rows');
9
+ }
10
+ if (formatColumn.RowScope.ExcludeGroupRows) {
11
+ values.push('Exclude Group Rows');
12
+ }
13
+ if (formatColumn.RowScope.ExcludeSummaryRows) {
14
+ values.push('Exclude Summary Rows');
15
+ }
16
+ }
8
17
  return {
9
18
  name: 'Settings',
10
- values,
19
+ values: values.filter(Boolean),
11
20
  };
12
21
  };
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
3
- PUBLISH_TIMESTAMP: 1746214089071 || Date.now(),
4
- VERSION: "20.1.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1746613770593 || Date.now(),
4
+ VERSION: "20.1.1" || '--current-version--',
5
5
  };
@@ -32,7 +32,6 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
32
32
  private globalAgGridEventListener;
33
33
  private columnDefsChanged;
34
34
  private indexColumns;
35
- private getColDefById;
36
35
  private onGridLayoutChanged;
37
36
  private triggerGridLayoutChange;
38
37
  onChange(fn: (layout: TableLayoutModel | PivotLayoutModel) => void): () => void;
@@ -205,9 +205,6 @@ export class LayoutManager extends LMEmitter {
205
205
  };
206
206
  colDefs.forEach(iteration);
207
207
  }
208
- getColDefById(colId) {
209
- return this.idsToColDefs[colId] ?? null;
210
- }
211
208
  onGridLayoutChanged(layout) {
212
209
  // we want to have this check, since onGridLayoutChanged might be triggered
213
210
  // by some AG Grid actions we're not interested - eg: filter changed
@@ -37,15 +37,24 @@ export const logChanges = (l1, l2, log) => {
37
37
  export function isTableLayoutEqual(l1, l2) {
38
38
  l1 = normalizeTableLayoutModel(l1);
39
39
  l2 = normalizeTableLayoutModel(l2);
40
+ clearIgnoredProperties(l1);
41
+ clearIgnoredProperties(l2);
40
42
  const res = isDeepEqual(l1, l2);
41
43
  if (!res) {
42
44
  logChanges(l1, l2);
43
45
  }
44
46
  return res;
45
47
  }
48
+ //#clearIgnoredProperties
49
+ function clearIgnoredProperties(layout) {
50
+ delete layout.GridFilter;
51
+ delete layout.ColumnFilters;
52
+ }
46
53
  export function isPivotLayoutEqual(l1, l2) {
47
54
  l1 = normalizePivotLayoutModel(l1);
48
55
  l2 = normalizePivotLayoutModel(l2);
56
+ clearIgnoredProperties(l1);
57
+ clearIgnoredProperties(l2);
49
58
  const res = isDeepEqual(l1, l2);
50
59
  if (!res) {
51
60
  logChanges(l1, l2);
@@ -1501,6 +1501,22 @@ export declare const ADAPTABLE_METAMODEL: {
1501
1501
  kind: string;
1502
1502
  desc: string;
1503
1503
  };
1504
+ BaseColumnHeaderContext: {
1505
+ name: string;
1506
+ kind: string;
1507
+ desc: string;
1508
+ props: ({
1509
+ name: string;
1510
+ kind: string;
1511
+ desc: string;
1512
+ ref: string;
1513
+ } | {
1514
+ name: string;
1515
+ kind: string;
1516
+ desc: string;
1517
+ ref?: undefined;
1518
+ })[];
1519
+ };
1504
1520
  BaseContext: {
1505
1521
  name: string;
1506
1522
  kind: string;
@@ -4413,6 +4429,11 @@ export declare const ADAPTABLE_METAMODEL: {
4413
4429
  ref: string;
4414
4430
  })[];
4415
4431
  };
4432
+ PivotTotalPosition: {
4433
+ name: string;
4434
+ kind: string;
4435
+ desc: string;
4436
+ };
4416
4437
  PlusMinusNudge: {
4417
4438
  name: string;
4418
4439
  kind: string;