@adaptabletools/adaptable 13.0.4 → 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.
Files changed (49) hide show
  1. package/README.md +3 -3
  2. package/bundle.cjs.js +145 -145
  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/FinancePluginOptions.d.ts +6 -6
  8. package/src/AdaptableOptions/GeneralOptions.d.ts +33 -5
  9. package/src/AdaptableOptions/LayoutOptions.d.ts +17 -0
  10. package/src/Api/AdaptableApi.d.ts +5 -0
  11. package/src/Api/CalendarApi.d.ts +29 -0
  12. package/src/Api/CalendarApi.js +2 -0
  13. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  14. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  15. package/src/Api/Implementation/CalendarApiImpl.d.ts +9 -0
  16. package/src/Api/Implementation/CalendarApiImpl.js +59 -0
  17. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  18. package/src/Api/Implementation/ColumnApiImpl.js +7 -0
  19. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
  20. package/src/Api/Implementation/InternalApiImpl.js +8 -0
  21. package/src/Api/Implementation/LayoutApiImpl.d.ts +7 -0
  22. package/src/Api/Implementation/LayoutApiImpl.js +15 -0
  23. package/src/Api/Implementation/QueryApiImpl.js +3 -8
  24. package/src/Api/InternalApi.d.ts +1 -0
  25. package/src/Api/LayoutApi.d.ts +11 -0
  26. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  27. package/src/PredefinedConfig/Common/AdaptablePredicate.js +55 -41
  28. package/src/PredefinedConfig/StyledColumnState.d.ts +16 -24
  29. package/src/Redux/ActionsReducers/PopupRedux.js +10 -2
  30. package/src/Strategy/FilterModule.js +2 -2
  31. package/src/Strategy/LayoutModule.d.ts +3 -0
  32. package/src/Strategy/LayoutModule.js +115 -4
  33. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +0 -1
  34. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  35. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  36. package/src/View/Layout/PivotDetailsPopoup.d.ts +3 -0
  37. package/src/View/Layout/PivotDetailsPopoup.js +65 -0
  38. package/src/View/Layout/Wizard/LayoutWizard.js +6 -1
  39. package/src/View/Layout/Wizard/sections/SortSection.js +1 -4
  40. package/src/agGrid/Adaptable.d.ts +1 -0
  41. package/src/agGrid/Adaptable.js +3 -6
  42. package/src/components/Modal/index.js +0 -2
  43. package/src/metamodel/adaptable.metamodel.d.ts +81 -23
  44. package/src/metamodel/adaptable.metamodel.js +1 -1
  45. package/src/types.d.ts +4 -3
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
  48. package/src/Utilities/Helpers/CalendarHelper.d.ts +0 -25
  49. package/src/Utilities/Helpers/CalendarHelper.js +0 -342
@@ -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,65 @@
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 adaptableApi = adaptable.api;
18
+ const primaryKey = adaptableApi.internalApi.getAdaptableOptions().primaryKey;
19
+ const { hasPivotValue, rows, rowGroups, columnId, layout, aggColumn, pivotValue, pivotColumnId, } = props.popupProps;
20
+ let data = rows;
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]);
58
+ return (React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: columnId },
59
+ React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
60
+ default: {
61
+ defaultFlex: 1,
62
+ },
63
+ }, domProps: tableDOMProps, columns: columns })));
64
+ };
65
+ 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',
@@ -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;
@@ -3733,6 +3766,16 @@ export declare const ADAPTABLE_METAMODEL: {
3733
3766
  gridInfo?: undefined;
3734
3767
  noCode?: undefined;
3735
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;
3736
3779
  })[];
3737
3780
  };
3738
3781
  LayoutState: {
@@ -4056,14 +4099,6 @@ export declare const ADAPTABLE_METAMODEL: {
4056
4099
  isOptional: boolean;
4057
4100
  defaultValue: string;
4058
4101
  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
4102
  } | {
4068
4103
  name: string;
4069
4104
  kind: string;
@@ -4098,6 +4133,24 @@ export declare const ADAPTABLE_METAMODEL: {
4098
4133
  reference: string;
4099
4134
  }[];
4100
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
+ };
4101
4154
  PluginsApi: {
4102
4155
  name: string;
4103
4156
  kind: string;
@@ -4375,6 +4428,11 @@ export declare const ADAPTABLE_METAMODEL: {
4375
4428
  uiLabel: string;
4376
4429
  }[];
4377
4430
  };
4431
+ RangeValueType: {
4432
+ name: string;
4433
+ kind: string;
4434
+ description: string;
4435
+ };
4378
4436
  ReactFrameworkComponent: {
4379
4437
  name: string;
4380
4438
  kind: string;