@adaptabletools/adaptable 11.0.5 → 11.0.8

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 (38) hide show
  1. package/README.md +2 -2
  2. package/bundle.cjs.js +110 -110
  3. package/package.json +1 -1
  4. package/publishTimestamp.d.ts +1 -1
  5. package/publishTimestamp.js +1 -1
  6. package/src/AdaptableOptions/GeneralOptions.d.ts +2 -2
  7. package/src/Api/AlertApi.d.ts +1 -1
  8. package/src/Api/BulkUpdateApi.d.ts +1 -1
  9. package/src/Api/CalculatedColumnApi.d.ts +1 -1
  10. package/src/Api/CellSummaryApi.d.ts +1 -1
  11. package/src/Api/ConditionalStyleApi.d.ts +1 -1
  12. package/src/Api/CustomSortApi.d.ts +1 -1
  13. package/src/Api/DashboardApi.d.ts +1 -1
  14. package/src/Api/DataSourceApi.d.ts +1 -1
  15. package/src/Api/ExportApi.d.ts +7 -2
  16. package/src/Api/FormatColumnApi.d.ts +1 -1
  17. package/src/Api/FreeTextColumnApi.d.ts +1 -1
  18. package/src/Api/GridApi.d.ts +1 -1
  19. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -1
  20. package/src/Api/Implementation/ExportApiImpl.js +14 -1
  21. package/src/Api/Implementation/LayoutApiImpl.d.ts +3 -0
  22. package/src/Api/Implementation/LayoutApiImpl.js +12 -0
  23. package/src/Api/LayoutApi.d.ts +14 -2
  24. package/src/Api/PlusMinusApi.d.ts +1 -1
  25. package/src/Api/QueryApi.d.ts +1 -1
  26. package/src/Api/QuickSearchApi.d.ts +1 -1
  27. package/src/Api/ScheduleApi.d.ts +1 -1
  28. package/src/Api/ShortcutApi.d.ts +1 -1
  29. package/src/Api/SmartEditApi.d.ts +1 -1
  30. package/src/Api/TeamSharingApi.d.ts +1 -1
  31. package/src/Api/ThemeApi.d.ts +1 -1
  32. package/src/Utilities/Constants/DocumentationLinkConstants.js +8 -8
  33. package/src/agGrid/PercentBarRenderer.js +2 -1
  34. package/src/agGrid/agGridHelper.js +4 -0
  35. package/src/metamodel/adaptable.metamodel.js +46 -22
  36. package/src/types.d.ts +1 -1
  37. package/version.d.ts +1 -1
  38. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.0.5",
3
+ "version": "11.0.8",
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",
@@ -1,2 +1,2 @@
1
- declare const _default: 1647181545760;
1
+ declare const _default: 1647511077741;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1647181545760;
3
+ exports.default = 1647511077741;
@@ -35,9 +35,9 @@ export interface GeneralOptions {
35
35
  */
36
36
  showGroupingTotalsAsHeader?: boolean;
37
37
  /**
38
- * Sort Grouped Column automatically (using Custom Sort if one applied)
38
+ * Order Grouped Column automatically, deriving from Adaptable State if available (CustomSort or Layout ColumnSort)
39
39
  *
40
- * Order Grouped Column automatically, trying to sort them (in the specified priority order) based on an active CustomSort, a defined Column Comparator, or at least alphanumerically
40
+ * The default group order will be derived from (in the specified priority): 1. an active CustomSort, 2. the defined ColDef Comparator, 3. current Layout ColumnSort or 4. alphanumerically
41
41
  * @defaultValue true
42
42
  * @gridInfoItem
43
43
  */
@@ -131,7 +131,7 @@ export interface AlertApi {
131
131
  */
132
132
  showAlertError(alertHeader: string, alertMessage: string): void;
133
133
  /**
134
- * Opens the Alert popup screen
134
+ * Opens Settings Panel with Alert section selected and visible
135
135
  */
136
136
  showAlertPopup(): void;
137
137
  /**
@@ -8,7 +8,7 @@ export interface BulkUpdateApi {
8
8
  */
9
9
  getBulkUpdateValue(): string;
10
10
  /**
11
- * Opens Bulk Update popup screen
11
+ * Opens Settings Panel with Bulk Update section selected and visible
12
12
  */
13
13
  showBulkUpdatePopup(): void;
14
14
  /**
@@ -48,7 +48,7 @@ export interface CalculatedColumnApi {
48
48
  */
49
49
  deleteCalculatedColumn(calcColumn: string): void;
50
50
  /**
51
- * Opens Calculated Column popup screen
51
+ * Opens Settings Panel with Calculated Column section selected and visible
52
52
  */
53
53
  showCalculatedColumnPopup(): void;
54
54
  /**
@@ -16,7 +16,7 @@ export interface CellSummaryApi {
16
16
  */
17
17
  getCellSummaryOperationDefinitions(): CellSummaryOperation[];
18
18
  /**
19
- * Opens Cell Summary popup screen
19
+ * Opens Settings Panel with Cell Summary section selected and visible
20
20
  */
21
21
  showCellSummaryPopup(): void;
22
22
  }
@@ -30,7 +30,7 @@ export interface ConditionalStyleApi {
30
30
  */
31
31
  getAllSuspendedConditionalStyle(): ConditionalStyle[];
32
32
  /**
33
- * Opens Conditional Style popup screen
33
+ * Opens Settings Panel with Conditional Style section selected and visible
34
34
  */
35
35
  showConditionalStylePopup(): void;
36
36
  /**
@@ -71,7 +71,7 @@ export interface CustomSortApi {
71
71
  */
72
72
  unSuspendCustomSort(customSort: CustomSort): CustomSort;
73
73
  /**
74
- * Opens Custom Sort popup screen
74
+ * Opens Settings Panel with Custom Sort section selected and visible
75
75
  */
76
76
  showCustomSortPopup(): void;
77
77
  }
@@ -119,7 +119,7 @@ export interface DashboardApi {
119
119
  */
120
120
  isToolbarVisible(toolbar: AdaptableDashboardToolbar | string): boolean;
121
121
  /**
122
- * Opens the Dashboard popup screen
122
+ * Opens Settings Panel with Dashboard section selected and visible
123
123
  */
124
124
  showDashboardPopup(): void;
125
125
  /**
@@ -52,7 +52,7 @@ export interface DataSourceApi {
52
52
  */
53
53
  clearDataSource(): void;
54
54
  /**
55
- * Opens Data Source popup screen
55
+ * Opens Settings Panel with Data Source section selected and visible
56
56
  */
57
57
  showDataSourcePopup(): void;
58
58
  }
@@ -77,7 +77,7 @@ export interface ExportApi {
77
77
  */
78
78
  exportDataToExcel(reportData: ReportData, fileName: string): void;
79
79
  /**
80
- * Opens Export popup screen
80
+ * Opens Settings Panel with Export section selected and visible
81
81
  */
82
82
  showExportPopup(): void;
83
83
  /**
@@ -121,5 +121,10 @@ export interface ExportApi {
121
121
  * Runs the report function of the CustomReport with the given reportName
122
122
  * @param reportName custom report name
123
123
  */
124
- runCustomReport(reportName: string): ReportData;
124
+ runCustomReport(reportName: string): ReportData | undefined;
125
+ /**
126
+ * Returns the ReportData for the Report with the given name
127
+ * @param reportName - the name of the report
128
+ */
129
+ getReportDataForReport(reportName: string): ReportData | undefined;
125
130
  }
@@ -99,7 +99,7 @@ export interface FormatColumnApi {
99
99
  */
100
100
  applyFormatColumnDisplayFormats(): void;
101
101
  /**
102
- * Opens the Format Column popup screen
102
+ * Opens Settings Panel with Format Column section selected and visible
103
103
  */
104
104
  showFormatColumnPopup(): void;
105
105
  /**
@@ -65,7 +65,7 @@ export interface FreeTextColumnApi {
65
65
  */
66
66
  checkFreeTextColumnForDataChange(dataChangedInfo: DataChangedInfo): void;
67
67
  /**
68
- * Opens FreeTextColumn popup screen
68
+ * Opens Settings Panel with Free Text Column section selected and visible
69
69
  */
70
70
  showFreeTextColumnPopup(): void;
71
71
  /**
@@ -433,7 +433,7 @@ export interface GridApi {
433
433
  */
434
434
  getGridContainerElement(): HTMLElement | null;
435
435
  /**
436
- * Opens Grid Info popup screen
436
+ * Opens Settings Panel with Grid Info section selected and visible
437
437
  */
438
438
  showGridInfoPopup(): void;
439
439
  }
@@ -27,5 +27,6 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
27
27
  editReports(reports: Report[]): Report[];
28
28
  isDataChangeInReport(dataChangedInfo: DataChangedInfo, report: Report): boolean;
29
29
  exportVisualDataToExcel(): void;
30
- runCustomReport(customReportName: string): ReportData;
30
+ runCustomReport(customReportName: string): ReportData | undefined;
31
+ getReportDataForReport(reportName: string): ReportData | undefined;
31
32
  }
@@ -6,6 +6,7 @@ const ExportRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/Ex
6
6
  const ApiBase_1 = require("./ApiBase");
7
7
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
8
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
9
+ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
9
10
  class ExportApiImpl extends ApiBase_1.ApiBase {
10
11
  getExportState() {
11
12
  return this.getAdaptableState().Export;
@@ -162,7 +163,19 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
162
163
  runCustomReport(customReportName) {
163
164
  var _a;
164
165
  const customReport = (_a = this.getExportOptions().customReports) === null || _a === void 0 ? void 0 : _a.find((cr) => cr.name == customReportName);
165
- return customReport ? customReport.onRunReport() : undefined;
166
+ if (!customReport) {
167
+ LoggingHelper_1.LogAdaptableWarning(`Custom Report '${customReportName}' not found!`);
168
+ return undefined;
169
+ }
170
+ return customReport.onRunReport();
171
+ }
172
+ getReportDataForReport(reportName) {
173
+ const report = this.getReportByName(reportName);
174
+ if (!report) {
175
+ LoggingHelper_1.LogAdaptableWarning(`Report '${reportName}' not found!`);
176
+ return undefined;
177
+ }
178
+ return this.adaptable.api.internalApi.getReportService().getReportData(report);
166
179
  }
167
180
  }
168
181
  exports.ExportApiImpl = ExportApiImpl;
@@ -2,6 +2,7 @@ import { ApiBase } from './ApiBase';
2
2
  import { LayoutApi } from '../LayoutApi';
3
3
  import { LayoutState, Layout } from '../../PredefinedConfig/LayoutState';
4
4
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
5
+ import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
5
6
  export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
6
7
  getLayoutState(): LayoutState;
7
8
  shouldAutoSaveLayout: (layout?: Layout) => boolean;
@@ -12,6 +13,7 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
12
13
  setLayout(layoutName: string): void;
13
14
  fireLayoutChangedEvent(trigger: string, oldSate: LayoutState, newState: LayoutState): void;
14
15
  getCurrentLayout(): Layout;
16
+ getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
15
17
  getCurrentLayoutName(): string;
16
18
  getLayoutByName(layoutName: string): Layout | null;
17
19
  getAllLayout(): Layout[];
@@ -30,5 +32,6 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
30
32
  createDefaultLayoutIfNeeded(): Layout | null;
31
33
  showChangeColumnCaption(column: AdaptableColumn): void;
32
34
  showLayoutPopup(): void;
35
+ showLayoutEditor(): void;
33
36
  isCurrentLayoutReadOnly(): boolean;
34
37
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
6
6
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
7
7
  const ApiBase_1 = require("./ApiBase");
8
+ const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
8
9
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
9
10
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
10
11
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
@@ -69,6 +70,11 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
69
70
  let layoutName = state.Layout.CurrentLayout;
70
71
  return (this.getLayoutByName(layoutName) || ObjectFactory_1.default.CreateEmptyLayout({ Name: GeneralConstants_1.DEFAULT_LAYOUT }));
71
72
  }
73
+ getCurrentLayoutColumnSort(columnId) {
74
+ var _a, _b, _c, _d;
75
+ const currentLayout = this.getCurrentLayout();
76
+ return ((_d = (_c = (_b = (_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.ColumnSorts) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (sort) => sort.ColumnId === columnId)) === null || _c === void 0 ? void 0 : _c.SortOrder) !== null && _d !== void 0 ? _d : null);
77
+ }
72
78
  getCurrentLayoutName() {
73
79
  return this.getAdaptableState().Layout.CurrentLayout;
74
80
  }
@@ -243,6 +249,12 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
243
249
  showLayoutPopup() {
244
250
  this.showModulePopup(ModuleConstants.LayoutModuleId);
245
251
  }
252
+ showLayoutEditor() {
253
+ this.dispatchAction(PopupRedux.PopupShowScreen(ModuleConstants.LayoutModuleId, 'LayoutPopup', {
254
+ action: 'Edit',
255
+ source: 'Other',
256
+ }));
257
+ }
246
258
  isCurrentLayoutReadOnly() {
247
259
  const currentLayout = this.getCurrentLayout();
248
260
  if (currentLayout) {
@@ -1,4 +1,4 @@
1
- import { AdaptableColumn } from '../../types';
1
+ import { AdaptableColumn, ColumnSort } from '../../types';
2
2
  import { LayoutState, Layout } from '../PredefinedConfig/LayoutState';
3
3
  /**
4
4
  * Provides run-time access to the Layout Module and associated state
@@ -24,6 +24,11 @@ export interface LayoutApi {
24
24
  * @returns layout
25
25
  */
26
26
  getCurrentLayout(): Layout;
27
+ /**
28
+ * Retrieves the sort order of a column from the current layout
29
+ * @param columnId Column id
30
+ */
31
+ getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
27
32
  /**
28
33
  * Retrieves map with visible columns in current Layout
29
34
  */
@@ -119,15 +124,22 @@ export interface LayoutApi {
119
124
  */
120
125
  createDefaultLayoutIfNeeded(): Layout | null;
121
126
  /**
122
- * Opens Layout popup screen
127
+ * Opens Settings Panel with Layout section selected and visible
123
128
  */
124
129
  showLayoutPopup(): void;
130
+ /**
131
+ * Opens the Layout Editor for the current Layout
132
+ */
133
+ showLayoutEditor(): void;
125
134
  /**
126
135
  * Sets a new Caption / Header for a Column (this Layout only)
127
136
  * @param columnId Column to Update
128
137
  * @param caption New Caption to display
129
138
  */
130
139
  setColumnCaption(columnId: string, caption: string): void;
140
+ /**
141
+ * Specifies where Current Layout is editable
142
+ */
131
143
  isCurrentLayoutReadOnly(): boolean;
132
144
  /**
133
145
  * Opens change column caption popup
@@ -42,7 +42,7 @@ export interface PlusMinusApi {
42
42
  */
43
43
  applyPlusMinus(cells: GridCell[]): void;
44
44
  /**
45
- * Opens Plus Minus popup screen
45
+ * Opens Settings Panel with Plus Minus section selected and visible
46
46
  */
47
47
  showPlusMinusPopup(): void;
48
48
  /**
@@ -36,7 +36,7 @@ export interface QueryApi {
36
36
  */
37
37
  getNamedQueryModuleReferences(namedQueryName: string): string[];
38
38
  /**
39
- * Opens Query Popup screen
39
+ * Opens Settings Panel with Query section selected and visible
40
40
  */
41
41
  showQueryPopup(): void;
42
42
  /**
@@ -31,7 +31,7 @@ export interface QuickSearchApi {
31
31
  */
32
32
  setQuickSearchStyle(style: AdaptableStyle): void;
33
33
  /**
34
- * Opens Quick Search popup screen
34
+ * Opens Settings Panel with Quick Search section selected and visible
35
35
  */
36
36
  showQuickSearchPopup(): void;
37
37
  }
@@ -247,7 +247,7 @@ export interface ScheduleApi {
247
247
  */
248
248
  applySchedule(schedule: BaseSchedule, scheduleType: 'Report' | 'ipushpull' | 'Glue42' | 'Reminder' | 'OpenFin'): void;
249
249
  /**
250
- * Opens Schedule popup screen
250
+ * Opens Settings Panel with Schedule section selected and visible
251
251
  */
252
252
  showSchedulePopup(): void;
253
253
  }
@@ -56,7 +56,7 @@ export interface ShortcutApi {
56
56
  */
57
57
  unSuspendShortcut(shortcut: Shortcut): Shortcut;
58
58
  /**
59
- * Opens Shortcut popup screen
59
+ * Opens Settings Panel with Shortcut section selected and visible
60
60
  */
61
61
  showShortcutPopup(): void;
62
62
  }
@@ -22,7 +22,7 @@ export interface SmartEditApi {
22
22
  */
23
23
  getSmartEditValue(): number;
24
24
  /**
25
- * Opens Smart Edit popup screen
25
+ * Opens Settings Panel with Smart Edit section selected and visible
26
26
  */
27
27
  showSmartEditPopup(): void;
28
28
  /**
@@ -20,7 +20,7 @@ export interface TeamSharingApi {
20
20
  */
21
21
  hasTeamSharingFullRights(): boolean;
22
22
  /**
23
- * Opens Team Sharing popup screen
23
+ * Opens Settings Panel with Team Sharing section selected and visible
24
24
  */
25
25
  showTeamSharingPopup(): void;
26
26
  /**
@@ -53,7 +53,7 @@ export interface ThemeApi {
53
53
  */
54
54
  getAllTheme(): AdaptableTheme[];
55
55
  /**
56
- * Opens Theme popup screen
56
+ * Opens Settings Panel with Theme section selected and visible
57
57
  */
58
58
  showThemePopup(): void;
59
59
  }
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LicenseDocsLink = exports.PrimaryKeyDocsLink = exports.PredicateDocsLink = exports.AggregatedScalarQueryDocsLink = exports.AggregatedBooleanQueryDocsLink = exports.ObservableQueryDocsLink = exports.ScalarQueryDocsLink = exports.BooleanQueryDocsLink = exports.ExpressionEditorDocsLink = exports.HOST_URL_DOCS = void 0;
4
4
  exports.HOST_URL_DOCS = 'https://docs.adaptabletools.com';
5
5
  //export const HOST_URL_DOCS = 'http://localhost:3000';
6
- exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/learn/ui-expression-editor`;
7
- exports.BooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression#boolean-expressions`;
8
- exports.ScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression#scalar-expressions`;
9
- exports.ObservableQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression#observable-expressions`;
10
- exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression#aggregation-boolean-expressions`;
11
- exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression#aggregation-scalar-expressions`;
12
- exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-predicate`;
13
- exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/learn/dev-guide-tutorial-primary-key`;
6
+ exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/guide/ui-expression-editor`;
7
+ exports.BooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-boolean`;
8
+ exports.ScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-scalar`;
9
+ exports.ObservableQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-observable`;
10
+ exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-aggregation#aggregated-boolean-expressions`;
11
+ exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-aggregation#aggregated-scalar-expressions`;
12
+ exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-predicate`;
13
+ exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/guide/dev-guide-tutorial-primary-key`;
14
14
  exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/licensing`;
@@ -77,7 +77,8 @@ exports.getPercentBarRendererForColumn = (formatColumn, api) => {
77
77
  return this.eGui;
78
78
  }
79
79
  refresh(params) {
80
- return true;
80
+ // by returning FALSE we force a re-render every time the cell value changes
81
+ return false;
81
82
  }
82
83
  };
83
84
  };
@@ -516,6 +516,10 @@ class agGridHelper {
516
516
  if (definedColumnComparator) {
517
517
  return definedColumnComparator(nodeA.key, nodeB.key);
518
518
  }
519
+ const sortOder = adaptable.api.layoutApi.getCurrentLayoutColumnSort(firstGroupedColumn.columnId);
520
+ if (sortOder === 'Desc') {
521
+ return nodeA.key > nodeB.key ? -1 : 1;
522
+ }
519
523
  }
520
524
  // if no comparator available, just sort alphanumerically
521
525
  if (nodeA.key == nodeB.key) {