@adaptabletools/adaptable 13.0.5 → 13.0.6
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/bundle.cjs.js +182 -182
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +6 -6
- package/src/AdaptableOptions/GeneralOptions.d.ts +1 -1
- package/src/AdaptableOptions/LayoutOptions.d.ts +17 -0
- package/src/Api/Implementation/CalendarApiImpl.js +4 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +7 -0
- package/src/Strategy/LayoutModule.js +18 -1
- package/src/View/Layout/PivotDetailsPopoup.js +40 -18
- package/src/metamodel/adaptable.metamodel.d.ts +28 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.6",
|
|
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",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1667290792339;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -127,11 +127,11 @@ export interface InstrumentColumn extends FDC3Column {
|
|
|
127
127
|
*/
|
|
128
128
|
permidColumnId?: string;
|
|
129
129
|
/**
|
|
130
|
-
* Column which holds a FIGI value as instrument data
|
|
130
|
+
* Column which holds a [FIGI](https://www.openfigi.com/about/figi) value as instrument data
|
|
131
131
|
*/
|
|
132
132
|
figiColumnId?: string;
|
|
133
133
|
/**
|
|
134
|
-
* FDC3 Intents
|
|
134
|
+
* Instrument-related FDC3 Intents; can be: `ViewChart` `ViewQuote` `ViewNews` `ViewAnalysis` `ViewInstrument`
|
|
135
135
|
*/
|
|
136
136
|
intents?: InstrumentIntents;
|
|
137
137
|
}
|
|
@@ -152,7 +152,7 @@ export interface PositionColumn extends FDC3Column {
|
|
|
152
152
|
*/
|
|
153
153
|
instrumentColumnId: string;
|
|
154
154
|
/**
|
|
155
|
-
* FDC3 Intents
|
|
155
|
+
* Position-related FDC3 Intents; can be: `ViewChart` `ViewNews` `ViewAnalysis`
|
|
156
156
|
*/
|
|
157
157
|
intents?: PositionIntents;
|
|
158
158
|
}
|
|
@@ -178,7 +178,7 @@ export interface ContactColumn extends FDC3Column {
|
|
|
178
178
|
*/
|
|
179
179
|
fds_idColumnId?: string;
|
|
180
180
|
/**
|
|
181
|
-
* FDC3 Intents
|
|
181
|
+
* Contact-related FDC3 Intents; can be: `StartCall` `StartChat` `ViewContact`
|
|
182
182
|
*/
|
|
183
183
|
intents?: ContactIntents;
|
|
184
184
|
}
|
|
@@ -207,7 +207,7 @@ export interface OrganizationColumn extends FDC3Column {
|
|
|
207
207
|
*/
|
|
208
208
|
fds_idColumnId?: string;
|
|
209
209
|
/**
|
|
210
|
-
* FDC3 Intents
|
|
210
|
+
* Organization-related FDC3 Intents; can be: `ViewNews` `ViewAnalysis`
|
|
211
211
|
*/
|
|
212
212
|
intents?: OrganizationIntents;
|
|
213
213
|
}
|
|
@@ -229,7 +229,7 @@ export interface CountryColumn extends FDC3Column {
|
|
|
229
229
|
*/
|
|
230
230
|
isoalpha3ColumnId?: string;
|
|
231
231
|
/**
|
|
232
|
-
* FDC3 Intents
|
|
232
|
+
* Country-related FDC3 Intents; can only be: `ViewChart`
|
|
233
233
|
*/
|
|
234
234
|
intents?: CountryIntents;
|
|
235
235
|
}
|
|
@@ -66,6 +66,10 @@ export interface LayoutOptions {
|
|
|
66
66
|
* Options for leveraging Object Tags to extend Layouts
|
|
67
67
|
*/
|
|
68
68
|
layoutTagOptions?: LayoutTagOptions;
|
|
69
|
+
/**
|
|
70
|
+
* Columns displayed in Table that opens when viewing contents of Pivot Cells
|
|
71
|
+
*/
|
|
72
|
+
pivotPreviewColumns?: string[] | ((context: PivotPreviewColumnsContext) => string[]);
|
|
69
73
|
}
|
|
70
74
|
export interface LayoutTagOptions {
|
|
71
75
|
/**
|
|
@@ -132,3 +136,16 @@ export interface AutoGenerateTagsForLayoutsContext extends BaseContext {
|
|
|
132
136
|
*/
|
|
133
137
|
objectTags: AdaptableObjectTag[];
|
|
134
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Context uses for pivotPreviewColumns function in Layout Options
|
|
141
|
+
*/
|
|
142
|
+
export interface PivotPreviewColumnsContext extends BaseContext {
|
|
143
|
+
/**
|
|
144
|
+
* Current Layout
|
|
145
|
+
*/
|
|
146
|
+
layout: Layout;
|
|
147
|
+
/**
|
|
148
|
+
* Column being opened
|
|
149
|
+
*/
|
|
150
|
+
columnId: string;
|
|
151
|
+
}
|
|
@@ -23,11 +23,15 @@ class CalendarApiImpl extends ApiBase_1.ApiBase {
|
|
|
23
23
|
}
|
|
24
24
|
isWorkingDay(dateToCheck) {
|
|
25
25
|
const holidays = this.getGeneralOptions().holidays;
|
|
26
|
+
if (!holidays) {
|
|
27
|
+
return dateToCheck.getDay() != 0 && dateToCheck.getDay() != 6;
|
|
28
|
+
}
|
|
26
29
|
if (holidays.isHoliday) {
|
|
27
30
|
const context = {
|
|
28
31
|
dateToCheck: dateToCheck,
|
|
29
32
|
userName: this.getOptions().userName,
|
|
30
33
|
adaptableId: this.getOptions().adaptableId,
|
|
34
|
+
adaptableApi: this.getAdaptableApi(),
|
|
31
35
|
};
|
|
32
36
|
if (holidays.isHoliday(context)) {
|
|
33
37
|
return false;
|
|
@@ -28,7 +28,7 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
|
|
|
28
28
|
isDateColumn(column: AdaptableColumn): boolean;
|
|
29
29
|
getColumnDataTypeFromColumnId(columnId: string): AdaptableColumnDataType | undefined;
|
|
30
30
|
getFriendlyNameFromColumn(columnId: string, column: AdaptableColumn): string;
|
|
31
|
-
getFriendlyNameFromColumnId(columnId: string): string;
|
|
31
|
+
getFriendlyNameFromColumnId(columnId: string): string | undefined;
|
|
32
32
|
getFriendlyNamesFromColumnIds(columnIds: string[]): string[];
|
|
33
33
|
getColumnIdFromFriendlyName(friendlyName: string): string;
|
|
34
34
|
getColumnIdsFromFriendlyNames(friendlyNames: string[]): string[];
|
|
@@ -115,6 +115,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
115
115
|
return columnId + GeneralConstants.MISSING_COLUMN;
|
|
116
116
|
}
|
|
117
117
|
getFriendlyNameFromColumnId(columnId) {
|
|
118
|
+
if (this.isAutoPivotColumn(columnId)) {
|
|
119
|
+
return GeneralConstants.EMPTY_STRING;
|
|
120
|
+
}
|
|
118
121
|
const foundColumn = this.getColumns().find((c) => c.columnId == columnId);
|
|
119
122
|
if (foundColumn) {
|
|
120
123
|
return this.getFriendlyNameFromColumn(columnId, foundColumn);
|
|
@@ -180,6 +183,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
180
183
|
if (ArrayExtensions_1.default.IsNullOrEmpty(this.getColumns())) {
|
|
181
184
|
return;
|
|
182
185
|
}
|
|
186
|
+
if (this.isAutoPivotColumn(columnId)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
183
189
|
const foundColumn = this.getColumns().find((c) => c.columnId == columnId);
|
|
184
190
|
if (foundColumn) {
|
|
185
191
|
return foundColumn;
|
|
@@ -269,6 +275,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
269
275
|
return this.getColumns().filter((c) => c.queryable);
|
|
270
276
|
}
|
|
271
277
|
LogMissingColumnWarning(columnId) {
|
|
278
|
+
console.log('MISSING', columnId);
|
|
272
279
|
if (this.adaptable.adaptableOptions.columnOptions.showMissingColumnsWarning &&
|
|
273
280
|
this.adaptable.adaptableOptions.columnOptions.showMissingColumnsWarning === true) {
|
|
274
281
|
if (!this.isAutoRowGroupColumn(columnId) &&
|
|
@@ -236,7 +236,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
236
236
|
return returnColumnMenuItems;
|
|
237
237
|
}
|
|
238
238
|
createViewPivotItemsMenuItem(menuContext) {
|
|
239
|
-
var _a, _b;
|
|
239
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
240
240
|
// current group => menuContext.rowNode.field;
|
|
241
241
|
if (((_b = (_a = menuContext.selectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells) === null || _b === void 0 ? void 0 : _b.length) !== 1) {
|
|
242
242
|
return;
|
|
@@ -251,6 +251,19 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
251
251
|
if (!isPivotColumn && this.api.columnApi.getColumnDataTypeFromColumnId(columnId) !== 'Number') {
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Cannot base the values on the pivot column id, because the value or the field may have underscrores
|
|
256
|
+
*
|
|
257
|
+
*
|
|
258
|
+
* e.g. pivot_license_MIT License_stargazers_count
|
|
259
|
+
*/
|
|
260
|
+
// pivot_status_Booked_price
|
|
261
|
+
// price
|
|
262
|
+
const aggColumn = (_f = (_e = (_d = (_c = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _c === void 0 ? void 0 : _c.call(agGridColumn).pivotValueColumn) === null || _d === void 0 ? void 0 : _d.getColDef) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.field;
|
|
263
|
+
// Booked
|
|
264
|
+
const pivotValue = (_j = (_h = (_g = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _g === void 0 ? void 0 : _g.call(agGridColumn)) === null || _h === void 0 ? void 0 : _h.pivotKeys) === null || _j === void 0 ? void 0 : _j[0];
|
|
265
|
+
// status - the preview works only with one column
|
|
266
|
+
const pivotColumnId = (_k = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.PivotColumns) === null || _k === void 0 ? void 0 : _k[0];
|
|
254
267
|
function getData(rows) {
|
|
255
268
|
return [
|
|
256
269
|
...rows.map((row) => {
|
|
@@ -271,6 +284,10 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
271
284
|
columnId,
|
|
272
285
|
rowGroups,
|
|
273
286
|
rows: data,
|
|
287
|
+
layout: currentLayout,
|
|
288
|
+
aggColumn,
|
|
289
|
+
pivotValue,
|
|
290
|
+
pivotColumnId,
|
|
274
291
|
};
|
|
275
292
|
return {
|
|
276
293
|
isVisible: true,
|
|
@@ -14,25 +14,47 @@ const tableDOMProps = {
|
|
|
14
14
|
};
|
|
15
15
|
const PivotDetailsPopoup = (props) => {
|
|
16
16
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const adaptableApi = adaptable.api;
|
|
18
|
+
const primaryKey = adaptableApi.internalApi.getAdaptableOptions().primaryKey;
|
|
19
|
+
const { hasPivotValue, rows, rowGroups, columnId, layout, aggColumn, pivotValue, pivotColumnId, } = props.popupProps;
|
|
19
20
|
let data = rows;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
const columns = React.useMemo(() => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const getFriendlyName = (columnId) => adaptableApi.columnApi.getFriendlyNameFromColumnId(columnId);
|
|
24
|
+
const pivotPreviewOptionColumn = (_b = (_a = adaptableApi.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.layoutOptions) === null || _b === void 0 ? void 0 : _b.pivotPreviewColumns;
|
|
25
|
+
let pivotPreviewExtraColumns = [];
|
|
26
|
+
if (typeof pivotPreviewOptionColumn === 'function') {
|
|
27
|
+
const pivotPreviewColumnsContext = {
|
|
28
|
+
layout: layout,
|
|
29
|
+
columnId: columnId,
|
|
30
|
+
adaptableApi: adaptableApi,
|
|
31
|
+
};
|
|
32
|
+
pivotPreviewExtraColumns = pivotPreviewOptionColumn(pivotPreviewColumnsContext);
|
|
33
|
+
}
|
|
34
|
+
else if (Array.isArray(pivotPreviewOptionColumn)) {
|
|
35
|
+
pivotPreviewExtraColumns = pivotPreviewOptionColumn;
|
|
36
|
+
}
|
|
37
|
+
let columns = {
|
|
38
|
+
[primaryKey]: { field: primaryKey, header: getFriendlyName(primaryKey) },
|
|
39
|
+
};
|
|
40
|
+
if (hasPivotValue) {
|
|
41
|
+
// pivot_license_MIT License_stargazers_count
|
|
42
|
+
// splitting by _ does not work
|
|
43
|
+
columns = Object.assign(Object.assign({}, columns), { [aggColumn]: { field: aggColumn, header: getFriendlyName(aggColumn) }, [pivotColumnId]: { field: pivotColumnId, header: getFriendlyName(pivotColumnId) } });
|
|
44
|
+
data = rows.filter((row) => (row === null || row === void 0 ? void 0 : row[pivotColumnId]) === pivotValue);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
columns = Object.assign(Object.assign({}, columns), { [columnId]: { field: columnId, header: getFriendlyName(columnId) } });
|
|
48
|
+
}
|
|
49
|
+
const extraColumns = [];
|
|
50
|
+
if (Array.isArray(rowGroups) && rowGroups.length > 0) {
|
|
51
|
+
extraColumns.push(...rowGroups);
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(pivotPreviewExtraColumns) && pivotPreviewExtraColumns.length > 0) {
|
|
54
|
+
extraColumns.push(...pivotPreviewExtraColumns);
|
|
55
|
+
}
|
|
56
|
+
return Object.assign(Object.assign({}, columns), extraColumns.reduce((acc, colId) => (Object.assign(Object.assign({}, acc), { [colId]: { field: colId, header: getFriendlyName(colId) } })), {}));
|
|
57
|
+
}, [props.popupProps]);
|
|
36
58
|
return (React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: columnId },
|
|
37
59
|
React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
|
|
38
60
|
default: {
|
|
@@ -3766,6 +3766,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3766
3766
|
gridInfo?: undefined;
|
|
3767
3767
|
noCode?: undefined;
|
|
3768
3768
|
defaultValue?: undefined;
|
|
3769
|
+
} | {
|
|
3770
|
+
name: string;
|
|
3771
|
+
kind: string;
|
|
3772
|
+
description: string;
|
|
3773
|
+
uiLabel: string;
|
|
3774
|
+
isOptional: boolean;
|
|
3775
|
+
gridInfo?: undefined;
|
|
3776
|
+
noCode?: undefined;
|
|
3777
|
+
defaultValue?: undefined;
|
|
3778
|
+
reference?: undefined;
|
|
3769
3779
|
})[];
|
|
3770
3780
|
};
|
|
3771
3781
|
LayoutState: {
|
|
@@ -4123,6 +4133,24 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4123
4133
|
reference: string;
|
|
4124
4134
|
}[];
|
|
4125
4135
|
};
|
|
4136
|
+
PivotPreviewColumnsContext: {
|
|
4137
|
+
name: string;
|
|
4138
|
+
kind: string;
|
|
4139
|
+
description: string;
|
|
4140
|
+
properties: ({
|
|
4141
|
+
name: string;
|
|
4142
|
+
kind: string;
|
|
4143
|
+
description: string;
|
|
4144
|
+
uiLabel: string;
|
|
4145
|
+
reference?: undefined;
|
|
4146
|
+
} | {
|
|
4147
|
+
name: string;
|
|
4148
|
+
kind: string;
|
|
4149
|
+
description: string;
|
|
4150
|
+
uiLabel: string;
|
|
4151
|
+
reference: string;
|
|
4152
|
+
})[];
|
|
4153
|
+
};
|
|
4126
4154
|
PluginsApi: {
|
|
4127
4155
|
name: string;
|
|
4128
4156
|
kind: string;
|