@adaptabletools/adaptable 13.0.4-canary.2 → 13.0.5

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 (47) hide show
  1. package/README.md +3 -3
  2. package/bundle.cjs.js +193 -193
  3. package/package.json +1 -1
  4. package/publishTimestamp.d.ts +1 -1
  5. package/publishTimestamp.js +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  7. package/src/AdaptableOptions/ActionOptions.d.ts +1 -5
  8. package/src/AdaptableOptions/GeneralOptions.d.ts +33 -5
  9. package/src/Api/AdaptableApi.d.ts +5 -0
  10. package/src/Api/CalendarApi.d.ts +29 -0
  11. package/src/Api/CalendarApi.js +2 -0
  12. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  13. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  14. package/src/Api/Implementation/CalendarApiImpl.d.ts +9 -0
  15. package/src/Api/Implementation/CalendarApiImpl.js +55 -0
  16. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
  17. package/src/Api/Implementation/InternalApiImpl.js +8 -0
  18. package/src/Api/Implementation/LayoutApiImpl.d.ts +7 -0
  19. package/src/Api/Implementation/LayoutApiImpl.js +15 -0
  20. package/src/Api/Implementation/QueryApiImpl.js +3 -8
  21. package/src/Api/InternalApi.d.ts +1 -0
  22. package/src/Api/LayoutApi.d.ts +11 -0
  23. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  24. package/src/PredefinedConfig/Common/AdaptablePredicate.js +55 -41
  25. package/src/PredefinedConfig/StyledColumnState.d.ts +16 -24
  26. package/src/Redux/ActionsReducers/PopupRedux.js +10 -2
  27. package/src/Strategy/FilterModule.js +2 -2
  28. package/src/Strategy/LayoutModule.d.ts +3 -0
  29. package/src/Strategy/LayoutModule.js +98 -4
  30. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -2
  31. package/src/Utilities/Defaults/DefaultSettingsPanel.js +18 -15
  32. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  33. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  34. package/src/View/Layout/PivotDetailsPopoup.d.ts +3 -0
  35. package/src/View/Layout/PivotDetailsPopoup.js +43 -0
  36. package/src/View/Layout/Wizard/LayoutWizard.js +6 -1
  37. package/src/View/Layout/Wizard/sections/SortSection.js +1 -4
  38. package/src/agGrid/Adaptable.d.ts +1 -0
  39. package/src/agGrid/Adaptable.js +10 -13
  40. package/src/components/Modal/index.js +0 -2
  41. package/src/metamodel/adaptable.metamodel.d.ts +53 -23
  42. package/src/metamodel/adaptable.metamodel.js +1 -1
  43. package/src/types.d.ts +3 -2
  44. package/version.d.ts +1 -1
  45. package/version.js +1 -1
  46. package/src/Utilities/Helpers/CalendarHelper.d.ts +0 -25
  47. package/src/Utilities/Helpers/CalendarHelper.js +0 -342
@@ -14,27 +14,30 @@ exports.DEFAULT_NAVIGATION_ITEMS = [
14
14
  'Dashboard',
15
15
  'ToolPanel',
16
16
  'StatusBar',
17
- 'StateManagement',
18
17
  '-',
19
- 'Alert',
18
+ 'Layout',
19
+ 'Export',
20
20
  'CalculatedColumn',
21
+ 'FreeTextColumn',
21
22
  'CustomSort',
22
- 'DataSet',
23
- 'Export',
24
- 'Filter',
25
- 'FlashingCell',
23
+ 'Alert',
24
+ 'SystemStatus',
25
+ '-',
26
+ 'StyledColumn',
26
27
  'FormatColumn',
27
- 'FreeTextColumn',
28
- 'Layout',
29
- 'PlusMinus',
30
- 'Query',
28
+ 'FlashingCell',
29
+ 'Theme',
30
+ '-',
31
31
  'QuickSearch',
32
- 'Schedule',
33
- 'Shortcut',
34
- 'StyledColumn',
32
+ 'Query',
33
+ 'Filter',
34
+ 'DataSet',
35
35
  '-',
36
- 'SystemStatus',
36
+ 'PlusMinus',
37
+ 'Shortcut',
37
38
  'DataChangeHistory',
39
+ '-',
40
+ 'Schedule',
41
+ 'StateManagement',
38
42
  'TeamSharing',
39
- 'Theme',
40
43
  ];
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { WindowPopupChildProps } from './WindowPopups';
3
3
  export declare const WINDOW_QUERY_EDITOR = "WINDOW_QUERY_EDITOR";
4
+ export declare const SHOW_PIVOT_COLUMN_DETAILS = "SHOW_PIVOT_COLUMN_DETAILS";
4
5
  export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.windowFactory = exports.WINDOW_QUERY_EDITOR = void 0;
3
+ exports.windowFactory = exports.SHOW_PIVOT_COLUMN_DETAILS = exports.WINDOW_QUERY_EDITOR = void 0;
4
4
  const ExpandedQueryPopup_1 = require("../../../Query/ExpandedQueryPopup");
5
+ const PivotDetailsPopoup_1 = require("../../../Layout/PivotDetailsPopoup");
5
6
  exports.WINDOW_QUERY_EDITOR = 'WINDOW_QUERY_EDITOR';
7
+ exports.SHOW_PIVOT_COLUMN_DETAILS = 'SHOW_PIVOT_COLUMN_DETAILS';
6
8
  exports.windowFactory = {
7
9
  [exports.WINDOW_QUERY_EDITOR]: ExpandedQueryPopup_1.ExpandedQueryPopup,
10
+ [exports.SHOW_PIVOT_COLUMN_DETAILS]: PivotDetailsPopoup_1.PivotDetailsPopoup,
8
11
  };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { WindowPopupChildProps } from '../Components/Popups/WindowPopups/WindowPopups';
3
+ export declare const PivotDetailsPopoup: React.FunctionComponent<WindowPopupChildProps>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PivotDetailsPopoup = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const InfiniteTable_1 = require("../../components/InfiniteTable");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const tableDOMProps = {
9
+ style: {
10
+ height: '100%',
11
+ minWidth: '10rem',
12
+ minHeight: 300,
13
+ },
14
+ };
15
+ const PivotDetailsPopoup = (props) => {
16
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
17
+ const primaryKey = adaptable.api.internalApi.getAdaptableOptions().primaryKey;
18
+ const { hasPivotValue, rows, rowGroups, columnId, } = props.popupProps;
19
+ let data = rows;
20
+ const getFriendlyName = (columnId) => adaptable.api.columnApi.getFriendlyNameFromColumnId(columnId);
21
+ let columns = {
22
+ [primaryKey]: { field: primaryKey, header: getFriendlyName(primaryKey) },
23
+ };
24
+ if (hasPivotValue) {
25
+ const [prefix, pivotColumnId, pivotValue, aggColumn] = columnId.split('_');
26
+ columns = Object.assign(Object.assign({}, columns), { [aggColumn]: { field: aggColumn, header: getFriendlyName(aggColumn) }, [pivotColumnId]: { field: pivotColumnId, header: getFriendlyName(pivotColumnId) } });
27
+ data = rows.filter((row) => (row === null || row === void 0 ? void 0 : row[pivotColumnId]) === pivotValue);
28
+ }
29
+ else {
30
+ columns = Object.assign(Object.assign({}, columns), { [columnId]: { field: columnId, header: getFriendlyName(columnId) } });
31
+ }
32
+ columns = Object.assign(Object.assign({}, columns), rowGroups.reduce((acc, groupColId) => {
33
+ acc[groupColId] = { field: groupColId, header: getFriendlyName(groupColId) };
34
+ return acc;
35
+ }, {}));
36
+ return (React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: columnId },
37
+ React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
38
+ default: {
39
+ defaultFlex: 1,
40
+ },
41
+ }, domProps: tableDOMProps, columns: columns })));
42
+ };
43
+ exports.PivotDetailsPopoup = PivotDetailsPopoup;
@@ -68,6 +68,7 @@ const LayoutWizard = (props) => {
68
68
  }
69
69
  props.onFinishWizard(layout);
70
70
  };
71
+ const layoutSupportedFeatures = adaptable.api.layoutApi.getLayoutSupportedFeatures();
71
72
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { titleContainerStyle: { width: 180 }, defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: layout, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
72
73
  {
73
74
  title: 'Settings',
@@ -96,13 +97,14 @@ const LayoutWizard = (props) => {
96
97
  {
97
98
  title: 'Pivot Columns',
98
99
  details: 'Select Pivot Columns',
99
- isVisible: () => layout === null || layout === void 0 ? void 0 : layout.EnablePivot,
100
+ isVisible: () => (layout === null || layout === void 0 ? void 0 : layout.EnablePivot) && layoutSupportedFeatures.PivotColumns,
100
101
  renderSummary: () => React.createElement(PivotColumnsSection_1.PivotColumnsSectionSummary, null),
101
102
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
102
103
  React.createElement(PivotColumnsSection_1.PivotColumnsSection, { onChange: (newLayout) => setLayout(newLayout) }))),
103
104
  },
104
105
  {
105
106
  title: 'Row Groups',
107
+ isVisible: () => layoutSupportedFeatures.RowGroupedColumns,
106
108
  details: 'Configure Row Grouping',
107
109
  renderSummary: () => React.createElement(RowGroupingSection_1.RowGroupingSectionSummary, null),
108
110
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
@@ -110,6 +112,7 @@ const LayoutWizard = (props) => {
110
112
  },
111
113
  {
112
114
  title: 'Aggregations',
115
+ isVisible: () => layoutSupportedFeatures.AggregationColumns,
113
116
  details: 'Select Column Aggregations',
114
117
  renderSummary: () => React.createElement(AggregationsSection_1.AggregationsSectionSummary, null),
115
118
  isValid: (data) => (0, AggregationsSection_1.isAggregationsSectionValid)(data),
@@ -118,6 +121,7 @@ const LayoutWizard = (props) => {
118
121
  },
119
122
  {
120
123
  title: 'Sort',
124
+ isVisible: () => layoutSupportedFeatures.ColumnSorts,
121
125
  renderSummary: () => React.createElement(SortSection_1.SortSectionSummary, null),
122
126
  details: 'Configure Column Sorts',
123
127
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
@@ -125,6 +129,7 @@ const LayoutWizard = (props) => {
125
129
  },
126
130
  {
127
131
  title: 'Filters',
132
+ isVisible: () => layoutSupportedFeatures.ColumnFilters,
128
133
  isValid: (layout) => (0, FilterSection_1.isColumnFiltersValid)(layout),
129
134
  details: 'View Column Filters',
130
135
  renderSummary: () => React.createElement(FilterSection_1.FilterSectionSummary, null),
@@ -32,10 +32,7 @@ const SortSection = (props) => {
32
32
  var _a;
33
33
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
34
34
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
35
- const allSortableColumns = adaptable.api.columnApi.getSortableColumns().filter((column) => {
36
- // filter out columns that are not in the layout
37
- return layout.Columns.includes(column.columnId);
38
- });
35
+ const allSortableColumns = adaptable.api.columnApi.getSortableColumns();
39
36
  const sortedSortColumns = React.useMemo(() => {
40
37
  var _a;
41
38
  return (0, sortWithOrder_1.sortWithOrderArray)(allSortableColumns.map((col) => col.columnId), ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).map((sort) => sort.ColumnId), { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
@@ -381,6 +381,7 @@ export declare class Adaptable implements IAdaptable {
381
381
  initLicenseService(): LicenseService;
382
382
  showCharts(charts: ChartModel[]): ChartRef[];
383
383
  getChartModels(): ChartModel[];
384
+ getRowModel(): import("@ag-grid-community/core").RowModelType;
384
385
  private getActiveAdaptableAggFuncForCol;
385
386
  private registerAdaptableAggFuncs;
386
387
  /**
@@ -1303,12 +1303,6 @@ class Adaptable {
1303
1303
  let sortIndex = 0;
1304
1304
  const sortModelMap = ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).reduce((acc, customSort) => {
1305
1305
  const colId = customSort.ColumnId;
1306
- if (!layoutColumnsMap[colId]) {
1307
- // pivot layouts may have no pivot columns, only aggregation columns
1308
- if (!layout.AggregationColumns || layout.AggregationColumns[colId] == undefined) {
1309
- return acc;
1310
- }
1311
- }
1312
1306
  acc[colId] = {
1313
1307
  colId,
1314
1308
  sort: customSort.SortOrder === 'Asc' ? 'asc' : 'desc',
@@ -1329,8 +1323,8 @@ class Adaptable {
1329
1323
  [];
1330
1324
  let isChanged = false;
1331
1325
  const colsToAutoSize = {};
1332
- let newColState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState);
1333
- newColState = newColState
1326
+ let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState);
1327
+ newColumnsState = newColumnsState
1334
1328
  .map((colState) => {
1335
1329
  var _a, _b, _c, _d, _e;
1336
1330
  const { colId } = colState;
@@ -1342,7 +1336,8 @@ class Adaptable {
1342
1336
  if (layout.ColumnWidthMap && layout.ColumnWidthMap[colId] != null) {
1343
1337
  newColState.width = layout.ColumnWidthMap[colId];
1344
1338
  }
1345
- else {
1339
+ else if (!hide) {
1340
+ // autosize only the columns which are part of the selected layout
1346
1341
  colsToAutoSize[colId] = true;
1347
1342
  }
1348
1343
  newColState.rowGroupIndex =
@@ -1406,7 +1401,7 @@ class Adaptable {
1406
1401
  // order changed
1407
1402
  const toString = (c) => `${c.colId}-${c.rowGroupIndex}-${c.pivotIndex}-${c.aggFunc}-${c.pinned}-${c.width}-${c.hide}`;
1408
1403
  const oldColStateString = columnsState.map(toString).join(',');
1409
- const newColStateString = newColState.map(toString).join(',');
1404
+ const newColStateString = newColumnsState.map(toString).join(',');
1410
1405
  isChanged = newColStateString != oldColStateString;
1411
1406
  }
1412
1407
  const pivoted = !!layout.EnablePivot;
@@ -1459,7 +1454,7 @@ class Adaptable {
1459
1454
  this.gridOptions.columnApi.setPivotMode(pivoted);
1460
1455
  }
1461
1456
  this.gridOptions.columnApi.applyColumnState({
1462
- state: newColState,
1457
+ state: newColumnsState,
1463
1458
  applyOrder: true,
1464
1459
  });
1465
1460
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
@@ -1497,9 +1492,8 @@ class Adaptable {
1497
1492
  (_a = this.gridOptions.columnApi) === null || _a === void 0 ? void 0 : _a.autoSizeAllColumns();
1498
1493
  }, 200);
1499
1494
  }, 100);
1500
- return;
1501
1495
  }
1502
- if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
1496
+ else if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
1503
1497
  colsToAutoSizeArray.length) {
1504
1498
  (_g = this.gridOptions.columnApi) === null || _g === void 0 ? void 0 : _g.autoSizeColumns(colsToAutoSizeArray);
1505
1499
  }
@@ -4683,6 +4677,9 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4683
4677
  }
4684
4678
  return this.gridOptions.api.getChartModels();
4685
4679
  }
4680
+ getRowModel() {
4681
+ return this.gridOptions.rowModelType;
4682
+ }
4686
4683
  getActiveAdaptableAggFuncForCol(columnId) {
4687
4684
  if (!columnId) {
4688
4685
  return null;
@@ -11,8 +11,6 @@ const rebass_1 = require("rebass");
11
11
  const Backdrop_1 = tslib_1.__importStar(require("./Backdrop"));
12
12
  const uuid_1 = require("../utils/uuid");
13
13
  const UIHelper_1 = require("../../View/UIHelper");
14
- // const uuidv4 = require('uuid/v4');
15
- // const createUuid = (): string => uuidv4();
16
14
  let portalElement;
17
15
  const ensurePortalElement = () => {
18
16
  if (!(0, UIHelper_1.isBrowserDocumentAvailable)()) {
@@ -1324,6 +1324,17 @@ export declare const ADAPTABLE_METAMODEL: {
1324
1324
  isOptional: boolean;
1325
1325
  }[];
1326
1326
  };
1327
+ CalendarApi: {
1328
+ name: string;
1329
+ kind: string;
1330
+ description: string;
1331
+ properties: {
1332
+ name: string;
1333
+ kind: string;
1334
+ description: string;
1335
+ uiLabel: string;
1336
+ }[];
1337
+ };
1327
1338
  CellChangedInfo: {
1328
1339
  name: string;
1329
1340
  kind: string;
@@ -3235,6 +3246,7 @@ export declare const ADAPTABLE_METAMODEL: {
3235
3246
  isOptional: boolean;
3236
3247
  defaultValue: string;
3237
3248
  gridInfo?: undefined;
3249
+ reference?: undefined;
3238
3250
  noCode?: undefined;
3239
3251
  } | {
3240
3252
  name: string;
@@ -3244,6 +3256,7 @@ export declare const ADAPTABLE_METAMODEL: {
3244
3256
  isOptional: boolean;
3245
3257
  defaultValue?: undefined;
3246
3258
  gridInfo?: undefined;
3259
+ reference?: undefined;
3247
3260
  noCode?: undefined;
3248
3261
  } | {
3249
3262
  name: string;
@@ -3253,6 +3266,17 @@ export declare const ADAPTABLE_METAMODEL: {
3253
3266
  isOptional: boolean;
3254
3267
  gridInfo: string;
3255
3268
  defaultValue: string;
3269
+ reference?: undefined;
3270
+ noCode?: undefined;
3271
+ } | {
3272
+ name: string;
3273
+ kind: string;
3274
+ description: string;
3275
+ uiLabel: string;
3276
+ isOptional: boolean;
3277
+ defaultValue: string;
3278
+ reference: string;
3279
+ gridInfo?: undefined;
3256
3280
  noCode?: undefined;
3257
3281
  } | {
3258
3282
  name: string;
@@ -3263,6 +3287,7 @@ export declare const ADAPTABLE_METAMODEL: {
3263
3287
  gridInfo: string;
3264
3288
  noCode: string;
3265
3289
  defaultValue: string;
3290
+ reference?: undefined;
3266
3291
  })[];
3267
3292
  };
3268
3293
  GlobalExpressionFunctionsContext: {
@@ -3352,21 +3377,6 @@ export declare const ADAPTABLE_METAMODEL: {
3352
3377
  name: string;
3353
3378
  kind: string;
3354
3379
  description: string;
3355
- properties: ({
3356
- name: string;
3357
- kind: string;
3358
- description: string;
3359
- uiLabel: string;
3360
- isOptional: boolean;
3361
- reference?: undefined;
3362
- } | {
3363
- name: string;
3364
- kind: string;
3365
- description: string;
3366
- uiLabel: string;
3367
- isOptional: boolean;
3368
- reference: string;
3369
- })[];
3370
3380
  };
3371
3381
  GridApi: {
3372
3382
  name: string;
@@ -3474,6 +3484,29 @@ export declare const ADAPTABLE_METAMODEL: {
3474
3484
  reference: string;
3475
3485
  }[];
3476
3486
  };
3487
+ HolidayContext: {
3488
+ name: string;
3489
+ kind: string;
3490
+ description: string;
3491
+ properties: {
3492
+ name: string;
3493
+ kind: string;
3494
+ description: string;
3495
+ uiLabel: string;
3496
+ }[];
3497
+ };
3498
+ Holidays: {
3499
+ name: string;
3500
+ kind: string;
3501
+ description: string;
3502
+ properties: {
3503
+ name: string;
3504
+ kind: string;
3505
+ description: string;
3506
+ uiLabel: string;
3507
+ isOptional: boolean;
3508
+ }[];
3509
+ };
3477
3510
  IAdaptableNoCodeWizard: {
3478
3511
  name: string;
3479
3512
  kind: string;
@@ -4056,14 +4089,6 @@ export declare const ADAPTABLE_METAMODEL: {
4056
4089
  isOptional: boolean;
4057
4090
  defaultValue: string;
4058
4091
  reference?: undefined;
4059
- } | {
4060
- name: string;
4061
- kind: string;
4062
- description: string;
4063
- uiLabel: string;
4064
- isOptional: boolean;
4065
- defaultValue?: undefined;
4066
- reference?: undefined;
4067
4092
  } | {
4068
4093
  name: string;
4069
4094
  kind: string;
@@ -4375,6 +4400,11 @@ export declare const ADAPTABLE_METAMODEL: {
4375
4400
  uiLabel: string;
4376
4401
  }[];
4377
4402
  };
4403
+ RangeValueType: {
4404
+ name: string;
4405
+ kind: string;
4406
+ description: string;
4407
+ };
4378
4408
  ReactFrameworkComponent: {
4379
4409
  name: string;
4380
4410
  kind: string;