@adaptabletools/adaptable 13.0.4 → 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 (45) 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/GeneralOptions.d.ts +33 -5
  8. package/src/Api/AdaptableApi.d.ts +5 -0
  9. package/src/Api/CalendarApi.d.ts +29 -0
  10. package/src/Api/CalendarApi.js +2 -0
  11. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  12. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  13. package/src/Api/Implementation/CalendarApiImpl.d.ts +9 -0
  14. package/src/Api/Implementation/CalendarApiImpl.js +55 -0
  15. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/InternalApiImpl.js +8 -0
  17. package/src/Api/Implementation/LayoutApiImpl.d.ts +7 -0
  18. package/src/Api/Implementation/LayoutApiImpl.js +15 -0
  19. package/src/Api/Implementation/QueryApiImpl.js +3 -8
  20. package/src/Api/InternalApi.d.ts +1 -0
  21. package/src/Api/LayoutApi.d.ts +11 -0
  22. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  23. package/src/PredefinedConfig/Common/AdaptablePredicate.js +55 -41
  24. package/src/PredefinedConfig/StyledColumnState.d.ts +16 -24
  25. package/src/Redux/ActionsReducers/PopupRedux.js +10 -2
  26. package/src/Strategy/FilterModule.js +2 -2
  27. package/src/Strategy/LayoutModule.d.ts +3 -0
  28. package/src/Strategy/LayoutModule.js +98 -4
  29. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +0 -1
  30. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  31. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  32. package/src/View/Layout/PivotDetailsPopoup.d.ts +3 -0
  33. package/src/View/Layout/PivotDetailsPopoup.js +43 -0
  34. package/src/View/Layout/Wizard/LayoutWizard.js +6 -1
  35. package/src/View/Layout/Wizard/sections/SortSection.js +1 -4
  36. package/src/agGrid/Adaptable.d.ts +1 -0
  37. package/src/agGrid/Adaptable.js +3 -6
  38. package/src/components/Modal/index.js +0 -2
  39. package/src/metamodel/adaptable.metamodel.d.ts +53 -23
  40. package/src/metamodel/adaptable.metamodel.js +1 -1
  41. package/src/types.d.ts +3 -2
  42. package/version.d.ts +1 -1
  43. package/version.js +1 -1
  44. package/src/Utilities/Helpers/CalendarHelper.d.ts +0 -25
  45. package/src/Utilities/Helpers/CalendarHelper.js +0 -342
@@ -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',
@@ -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;