@adaptabletools/adaptable 16.1.1-canary.2 → 16.2.0-canary.1

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 (81) hide show
  1. package/base.css +6 -1
  2. package/base.css.map +1 -1
  3. package/bundle.cjs.js +195 -197
  4. package/index.css +10 -1
  5. package/index.css.map +1 -1
  6. package/package.json +2 -2
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/DataImportOptions.d.ts +17 -5
  11. package/src/AdaptableOptions/GroupingOptions.d.ts +1 -1
  12. package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
  13. package/src/Api/ColumnApi.d.ts +3 -3
  14. package/src/Api/EventApi.d.ts +13 -2
  15. package/src/Api/Events/DataImported.d.ts +22 -0
  16. package/src/Api/Events/DataImported.js +2 -0
  17. package/src/Api/Internal/AlertInternalApi.d.ts +3 -2
  18. package/src/Api/Internal/AlertInternalApi.js +35 -5
  19. package/src/Api/Internal/DataImportInternalApi.d.ts +5 -0
  20. package/src/Api/Internal/DataImportInternalApi.js +28 -10
  21. package/src/Api/Internal/FilterInternalApi.d.ts +1 -1
  22. package/src/Api/Internal/FilterInternalApi.js +1 -1
  23. package/src/Api/Internal/GridInternalApi.js +1 -0
  24. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +3 -3
  25. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  26. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +4 -4
  27. package/src/PredefinedConfig/Common/Fdc3Intent.js +4 -19
  28. package/src/PredefinedConfig/Common/Menu.d.ts +2 -2
  29. package/src/PredefinedConfig/DashboardState.d.ts +4 -0
  30. package/src/Redux/ActionsReducers/DashboardRedux.d.ts +11 -0
  31. package/src/Redux/ActionsReducers/DashboardRedux.js +14 -1
  32. package/src/Strategy/AlertModule.js +14 -31
  33. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -1
  34. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -0
  35. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +14 -2
  36. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
  37. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +93 -1
  38. package/src/Utilities/Services/AlertService.js +13 -6
  39. package/src/Utilities/Services/DataService.d.ts +4 -1
  40. package/src/Utilities/Services/DataService.js +10 -5
  41. package/src/Utilities/Services/Interface/IAlertService.d.ts +12 -3
  42. package/src/Utilities/Services/Interface/IAlertService.js +9 -0
  43. package/src/Utilities/Services/Interface/IDataService.d.ts +3 -0
  44. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +2 -1
  45. package/src/Utilities/Services/ModuleService.js +2 -0
  46. package/src/Utilities/Services/QueryLanguageService.d.ts +2 -2
  47. package/src/View/Components/Selectors/ColumnSelector.js +0 -5
  48. package/src/View/Dashboard/{CustomToolbarWrapper.d.ts → CustomToolbar.d.ts} +1 -0
  49. package/src/View/Dashboard/{CustomToolbarWrapper.js → CustomToolbar.js} +36 -33
  50. package/src/View/Dashboard/Dashboard.d.ts +2 -2
  51. package/src/View/Dashboard/Dashboard.js +20 -24
  52. package/src/View/Dashboard/DashboardPopup.d.ts +2 -1
  53. package/src/View/Dashboard/DashboardPopup.js +7 -3
  54. package/src/View/Dashboard/DashboardToolbarFactory.d.ts +7 -0
  55. package/src/View/Dashboard/DashboardToolbarFactory.js +46 -0
  56. package/src/View/Dashboard/PinnedDashboard.d.ts +5 -0
  57. package/src/View/Dashboard/PinnedDashboard.js +21 -0
  58. package/src/View/Dashboard/PinnedToolbarsSelector.d.ts +5 -0
  59. package/src/View/Dashboard/PinnedToolbarsSelector.js +52 -0
  60. package/src/View/DataImport/DataImportPopup.js +1 -1
  61. package/src/View/DataImport/DataImportWizard/DataImportWizard.d.ts +6 -1
  62. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +71 -9
  63. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.d.ts +8 -0
  64. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +119 -0
  65. package/src/View/DataImport/DataImportWizard/sections/DataPreview.d.ts +2 -1
  66. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +13 -17
  67. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.d.ts +2 -1
  68. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +1 -1
  69. package/src/View/QuickSearch/QuickSearchInput.js +1 -1
  70. package/src/components/Dashboard/Dashboard.d.ts +1 -0
  71. package/src/components/Dashboard/Dashboard.js +2 -1
  72. package/src/components/DragAndDropContext/ModuleManager.js +1 -1
  73. package/src/components/DragAndDropContext/TabList.js +1 -1
  74. package/src/components/ExpressionEditor/editorButtonsObservable.js +10 -0
  75. package/src/metamodel/adaptable.metamodel.d.ts +20 -0
  76. package/src/metamodel/adaptable.metamodel.js +1 -1
  77. package/src/parser/src/index.js +4 -1
  78. package/src/parser/src/tokenizer.js +5 -2
  79. package/src/types.d.ts +2 -0
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
@@ -16,6 +16,8 @@ class DataService {
16
16
  this.emitter = new Emitter_1.default();
17
17
  this.dataChangeLogSubject$ = new rxjs_1.Subject();
18
18
  this.dataChangeLog$ = this.dataChangeLogSubject$.asObservable();
19
+ this.gridChangeLogSubject$ = new rxjs_1.Subject();
20
+ this.gridChangeLog$ = this.gridChangeLogSubject$.asObservable();
19
21
  this.undoChangeLog = new Map();
20
22
  this.undoChangeTimers = new Map();
21
23
  }
@@ -25,6 +27,9 @@ class DataService {
25
27
  this.dataChangeLogSubject$.complete();
26
28
  this.dataChangeLogSubject$ = null;
27
29
  this.dataChangeLog$ = null;
30
+ this.gridChangeLogSubject$.complete();
31
+ this.gridChangeLogSubject$ = null;
32
+ this.gridChangeLog$ = null;
28
33
  this.undoChangeLog.clear();
29
34
  this.undoChangeLog = null;
30
35
  this.undoChangeTimers.clear();
@@ -34,9 +39,13 @@ class DataService {
34
39
  if (cellDataChangedInfo.newValue != cellDataChangedInfo.oldValue) {
35
40
  this.emitter.emitSync('CellDataChanged', cellDataChangedInfo);
36
41
  this.adaptable.api.gridApi.internalApi.fireCellChangedEvent(cellDataChangedInfo);
37
- this.logDataChange(cellDataChangedInfo);
42
+ const dataChangeLogEntry = this.extractDataChangeLogEntry(cellDataChangedInfo);
43
+ this.dataChangeLogSubject$.next(dataChangeLogEntry);
38
44
  }
39
45
  }
46
+ CreateGridChangedEvent(gridDataChangedInfo) {
47
+ this.gridChangeLogSubject$.next(gridDataChangedInfo);
48
+ }
40
49
  // we need this temporary "shared memory" because the value change and the AG Grid cellChanged event are asynchronous
41
50
  // in the first phase we keep the undone change
42
51
  logUndoChange(change) {
@@ -75,10 +84,6 @@ class DataService {
75
84
  newValue,
76
85
  });
77
86
  }
78
- logDataChange(cellDataChangedInfo) {
79
- const dataChangeLogEntry = this.extractDataChangeLogEntry(cellDataChangedInfo);
80
- this.dataChangeLogSubject$.next(dataChangeLogEntry);
81
- }
82
87
  extractDataChangeLogEntry(cellDataChangedInfo) {
83
88
  // create rowData snapshot
84
89
  const rowData = cellDataChangedInfo.rowData
@@ -1,10 +1,17 @@
1
1
  import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
2
2
  import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
3
+ import { GridDataChangedInfo } from '../../../types';
3
4
  import { IAdaptableService } from './IAdaptableService';
4
- export declare type ReactiveAlertInfo = {
5
+ export declare type ReactiveAlertInfo = ReactiveGridDataChangedAlertInfo | ReactiveCellDataChangedAlertInfo;
6
+ export declare type ReactiveGridDataChangedAlertInfo = {
7
+ type: 'gridDataChangedAlert';
5
8
  alertDefinition: AlertDefinition;
6
- type: 'alert';
7
- dataChangeLogEntry: CellDataChangedInfo;
9
+ gridChangeLogEntry: GridDataChangedInfo;
10
+ };
11
+ export declare type ReactiveCellDataChangedAlertInfo = {
12
+ type: 'cellDataChangedAlert';
13
+ alertDefinition: AlertDefinition;
14
+ cellChangeLogEntry: CellDataChangedInfo;
8
15
  };
9
16
  export interface IAlertService extends IAdaptableService {
10
17
  createReactiveAlert(alertDefinition: AlertDefinition): void;
@@ -13,3 +20,5 @@ export interface IAlertService extends IAdaptableService {
13
20
  getReactiveActiveAlerts(): AlertDefinition[];
14
21
  isReactiveAlertActive(alertDefinition: AlertDefinition): boolean;
15
22
  }
23
+ export declare const isGridDataChangedInfo: (value: CellDataChangedInfo | GridDataChangedInfo) => value is GridDataChangedInfo<any>;
24
+ export declare const isCellDataChangedInfo: (value: CellDataChangedInfo | GridDataChangedInfo) => value is CellDataChangedInfo<any>;
@@ -1,2 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCellDataChangedInfo = exports.isGridDataChangedInfo = void 0;
4
+ const isGridDataChangedInfo = (value) => {
5
+ return typeof value.rowTrigger === 'string';
6
+ };
7
+ exports.isGridDataChangedInfo = isGridDataChangedInfo;
8
+ const isCellDataChangedInfo = (value) => {
9
+ return !(0, exports.isGridDataChangedInfo)(value);
10
+ };
11
+ exports.isCellDataChangedInfo = isCellDataChangedInfo;
@@ -1,10 +1,13 @@
1
1
  import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IAdaptableService } from './IAdaptableService';
4
+ import { GridDataChangedInfo } from '../../../types';
4
5
  export interface IDataService extends IAdaptableService {
5
6
  CreateDataChangedEvent(cellDataChangedInfo: CellDataChangedInfo): void;
7
+ CreateGridChangedEvent(gridDataChangedInfo: GridDataChangedInfo): void;
6
8
  on(eventName: 'CellDataChanged', callback: (cellDataChangedInfo: CellDataChangedInfo) => void): () => void;
7
9
  readonly dataChangeLog$: Observable<CellDataChangedInfo>;
10
+ readonly gridChangeLog$: Observable<GridDataChangedInfo>;
8
11
  logUndoChange(undoChange: CellDataChangedInfo): void;
9
12
  extractUndoChange(undoChange: CellDataChangedInfo): CellDataChangedInfo | undefined;
10
13
  }
@@ -9,10 +9,11 @@ import { BooleanFunctionName } from '../../ExpressionFunctions/booleanExpression
9
9
  import { ScalarFunctionName } from '../../ExpressionFunctions/scalarExpressionFunctions';
10
10
  import { ObservableFunctionName } from '../../ExpressionFunctions/observableExpressionFunctions';
11
11
  import { ExpressionFunctionMap } from '../../../parser/src/types';
12
+ import { GridDataChangedInfo } from '../../../types';
12
13
  export interface IQueryLanguageService extends IAdaptableService {
13
14
  evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: IRowNode): boolean;
14
15
  evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: IRowNode): any;
15
- evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
16
+ evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo | GridDataChangedInfo>;
16
17
  evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): BooleanAggregationParameter;
17
18
  evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): ScalarAggregationParameter;
18
19
  validateBoolean(expression: string, module: AdaptableModule, config?: {
@@ -93,6 +93,8 @@ class ModuleService {
93
93
  return learnUrl + 'ui-dashboard';
94
94
  case 'DataSet':
95
95
  return learnUrl + 'handbook-data-sets';
96
+ case 'DataImport':
97
+ return learnUrl + 'handbook-importing';
96
98
  case 'DataChangeHistory':
97
99
  return learnUrl + 'handbook-monitoring-data-change-history';
98
100
  case 'Export':
@@ -4,7 +4,7 @@ import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChang
4
4
  import { IRowNode } from '@ag-grid-community/core';
5
5
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
6
6
  import { ScalarAggregationParameter } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
7
- import { AdaptableApi } from '../../../types';
7
+ import { AdaptableApi, GridDataChangedInfo } from '../../../types';
8
8
  import { BooleanAggregationParameter } from '../ExpressionFunctions/aggregatedBooleanExpressionFunctions';
9
9
  export declare class QueryLanguageService implements IQueryLanguageService {
10
10
  private adaptableApi;
@@ -17,7 +17,7 @@ export declare class QueryLanguageService implements IQueryLanguageService {
17
17
  evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: any): any;
18
18
  evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: IRowNode): any;
19
19
  evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): ScalarAggregationParameter;
20
- evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
20
+ evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo | GridDataChangedInfo>;
21
21
  evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): BooleanAggregationParameter;
22
22
  validateBoolean(expressionInput: string, module: AdaptableModule, config?: {
23
23
  force?: boolean;
@@ -13,11 +13,6 @@ class ColumnSelector extends React.Component {
13
13
  var _a;
14
14
  const sortedColumns = ArrayExtensions_1.ArrayExtensions.sortArrayWithProperty(Enums_1.SortOrder.Asc, this.props.ColumnList, 'friendlyName');
15
15
  const selectedColumnIds = this.props.SelectedColumnIds.filter((x) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(x));
16
- const placeHolder = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.placeHolder)
17
- ? this.props.placeHolder.toString()
18
- : this.props.SelectionMode == Enums_1.SelectionMode.Single
19
- ? 'Select a column'
20
- : 'Select columns';
21
16
  const isEmptySelectedColumnIds = this.props.SelectedColumnIds.filter((x) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(x)).length == 0;
22
17
  let sortedColumnOptions = sortedColumns.map((column) => {
23
18
  return {
@@ -4,5 +4,6 @@ interface CustomToolbarWrapperProps {
4
4
  customToolbar: CustomToolbar;
5
5
  dashboardRevision: number;
6
6
  }
7
+ export declare const CustomToolbarCmp: (props: CustomToolbarWrapperProps) => JSX.Element;
7
8
  export declare const CustomToolbarWrapper: (props: CustomToolbarWrapperProps) => JSX.Element;
8
9
  export {};
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomToolbarWrapper = void 0;
3
+ exports.CustomToolbarWrapper = exports.CustomToolbarCmp = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const react_1 = require("react");
7
- const PanelDashboard_1 = require("../Components/Panels/PanelDashboard");
8
7
  const AdaptableContext_1 = require("../AdaptableContext");
9
8
  const AdaptableButton_1 = require("../Components/AdaptableButton");
10
- const CustomToolbarWrapper = (props) => {
9
+ const PanelDashboard_1 = require("../Components/Panels/PanelDashboard");
10
+ const CustomToolbarCmp = (props) => {
11
11
  let contentsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__contents';
12
12
  let buttonsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__buttons';
13
13
  const [contentsHTML, setContentsHTML] = (0, react_1.useState)('');
@@ -63,6 +63,38 @@ const CustomToolbarWrapper = (props) => {
63
63
  }
64
64
  };
65
65
  }, []);
66
+ return (React.createElement(React.Fragment, null,
67
+ contentsHTML && (React.createElement("div", { id: contentsDivId, ref: contentsDivRef, className: "CustomToolBarContents ab-CustomToolbar__contents ab-CustomToolbar__contents--render", style: { minHeight: 22 }, dangerouslySetInnerHTML: { __html: contentsHTML } })),
68
+ props.customToolbar.toolbarButtons && (React.createElement("div", { id: buttonsDivId, className: "ab-CustomToolbar__buttons", style: { minHeight: 22 } }, props.customToolbar.toolbarButtons.map((button, index) => {
69
+ const dashboardContext = {
70
+ customToolbar: props.customToolbar,
71
+ adaptableApi: api,
72
+ userName: api.optionsApi.getUserName(),
73
+ adaptableId: api.optionsApi.getAdaptableId(),
74
+ dashboardState: api.dashboardApi.getDashboardState(),
75
+ };
76
+ const buttonIcon = api.internalApi.getIconForButton(button, dashboardContext);
77
+ let buttonStyle = api.internalApi.getStyleForButton(button, dashboardContext);
78
+ let buttonLabel = api.internalApi.getLabelForButton(button, dashboardContext);
79
+ let buttonTooltip = api.internalApi.getTooltipForButton(button, dashboardContext);
80
+ if (button.hidden && button.hidden(button, dashboardContext)) {
81
+ return null;
82
+ }
83
+ const disabled = button.disabled && button.disabled(button, dashboardContext);
84
+ let buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'outlined';
85
+ let buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'neutral';
86
+ return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { style: { marginLeft: index ? 'var(--ab-space-1)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, variant: buttonVariant, tone: buttonTone, className: (buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className) || '', onClick: () => {
87
+ button.onClick ? button.onClick(button, dashboardContext) : null;
88
+ setTimeout(() => {
89
+ // mutate state to force a re-rendering
90
+ setComponentRevision(componentRevision + 1);
91
+ }, 16);
92
+ } }, buttonLabel));
93
+ })))));
94
+ };
95
+ exports.CustomToolbarCmp = CustomToolbarCmp;
96
+ const CustomToolbarWrapper = (props) => {
97
+ const { api } = (0, AdaptableContext_1.useAdaptable)();
66
98
  return (React.createElement(PanelDashboard_1.PanelDashboard, { className: `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, "data-name": `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, headerText: props.customToolbar.title ? props.customToolbar.title : '', showConfigureButton: props.customToolbar.showConfigureButton != null &&
67
99
  props.customToolbar.showConfigureButton == true, showCloseButton: props.customToolbar.showCloseButton != null && props.customToolbar.showCloseButton == true, onConfigure: () => {
68
100
  const customToolbarConfiguredInfo = {
@@ -75,35 +107,6 @@ const CustomToolbarWrapper = (props) => {
75
107
  }, accessLevel: api.internalApi
76
108
  .getEntitlementService()
77
109
  .getEntitlementAccessLevelForModule('Dashboard') },
78
- React.createElement("div", { id: contentsDivId, ref: contentsDivRef, className: "CustomToolBarContents ab-CustomToolbar__contents ab-CustomToolbar__contents--render", style: { minHeight: 22 }, dangerouslySetInnerHTML: { __html: contentsHTML } }),
79
- React.createElement("div", { id: buttonsDivId, className: "ab-CustomToolbar__buttons", style: { minHeight: 22 } }, props.customToolbar.toolbarButtons &&
80
- props.customToolbar.toolbarButtons.map((button, index) => {
81
- // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
82
- // with the next opportunity we should abstract it
83
- const dashboardContext = {
84
- customToolbar: props.customToolbar,
85
- adaptableApi: api,
86
- userName: api.optionsApi.getUserName(),
87
- adaptableId: api.optionsApi.getAdaptableId(),
88
- dashboardState: api.dashboardApi.getDashboardState(),
89
- };
90
- const buttonIcon = api.internalApi.getIconForButton(button, dashboardContext);
91
- let buttonStyle = api.internalApi.getStyleForButton(button, dashboardContext);
92
- let buttonLabel = api.internalApi.getLabelForButton(button, dashboardContext);
93
- let buttonTooltip = api.internalApi.getTooltipForButton(button, dashboardContext);
94
- if (button.hidden && button.hidden(button, dashboardContext)) {
95
- return null;
96
- }
97
- const disabled = button.disabled && button.disabled(button, dashboardContext);
98
- let buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'outlined';
99
- let buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'neutral';
100
- return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { style: { marginLeft: index ? 'var(--ab-space-1)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, variant: buttonVariant, tone: buttonTone, className: (buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className) || '', onClick: () => {
101
- button.onClick ? button.onClick(button, dashboardContext) : null;
102
- setTimeout(() => {
103
- // mutate state to force a re-rendering
104
- setComponentRevision(componentRevision + 1);
105
- }, 16);
106
- } }, buttonLabel));
107
- }))));
110
+ React.createElement(exports.CustomToolbarCmp, Object.assign({}, props))));
108
111
  };
109
112
  exports.CustomToolbarWrapper = CustomToolbarWrapper;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import * as Redux from 'redux';
3
- import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
3
+ import { SystemStatusMessageInfo } from '../../PredefinedConfig/Common/SystemStatusMessageInfo';
4
4
  import { AdaptableCoordinate, DashboardState } from '../../PredefinedConfig/DashboardState';
5
5
  import { GridState } from '../../PredefinedConfig/GridState';
6
6
  import * as DashboardRedux from '../../Redux/ActionsReducers/DashboardRedux';
7
7
  import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
8
8
  import * as QuickSearchRedux from '../../Redux/ActionsReducers/QuickSearchRedux';
9
- import { SystemStatusMessageInfo } from '../../PredefinedConfig/Common/SystemStatusMessageInfo';
9
+ import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
10
10
  interface DashboardComponentProps extends ModuleViewPopupProps<any> {
11
11
  DashboardRevision: number;
12
12
  DashboardState: DashboardState;
@@ -2,32 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Dashboard = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
5
6
  const React = tslib_1.__importStar(require("react"));
6
7
  const react_redux_1 = require("react-redux");
7
- const AdaptableViewFactory_1 = require("../AdaptableViewFactory");
8
- const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
9
- const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
8
+ const rebass_1 = require("rebass");
9
+ const Dashboard_1 = require("../../components/Dashboard");
10
10
  const DashboardRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/DashboardRedux"));
11
11
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
12
12
  const QuickSearchRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QuickSearchRedux"));
13
- const rebass_1 = require("rebass");
14
- const Dashboard_1 = require("../../components/Dashboard");
15
- const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
13
+ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
14
+ const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
15
+ const AdaptableViewFactory_1 = require("../AdaptableViewFactory");
16
+ const AdaptableButton_1 = require("../Components/AdaptableButton");
17
+ const AdaptableIconComponent_1 = require("../Components/AdaptableIconComponent");
16
18
  const AdaptableFormControlTextClear_1 = require("../Components/Forms/AdaptableFormControlTextClear");
17
19
  const useQuickSearchDebounced_1 = require("../QuickSearch/useQuickSearchDebounced");
18
20
  const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
19
- const ModuleToolbarWrapper_1 = require("./ModuleToolbarWrapper");
20
- const CustomToolbarWrapper_1 = require("./CustomToolbarWrapper");
21
21
  const CustomDashboardButton_1 = require("./CustomDashboardButton");
22
- const AdaptableIconComponent_1 = require("../Components/AdaptableIconComponent");
23
- const AdaptableButton_1 = require("../Components/AdaptableButton");
22
+ const CustomToolbar_1 = require("./CustomToolbar");
23
+ const DashboardToolbarFactory_1 = require("./DashboardToolbarFactory");
24
+ const PinnedDashboard_1 = require("./PinnedDashboard");
25
+ const ModuleToolbarWrapper_1 = require("./ModuleToolbarWrapper");
24
26
  const DashboardComponent = (props) => {
25
27
  const [searchText, search] = (0, useQuickSearchDebounced_1.useQuickSearchDebounced)(props);
26
28
  const dashboardAccessLevel = props.api.internalApi
27
29
  .getEntitlementService()
28
30
  .getEntitlementAccessLevelForModule('Dashboard');
29
31
  const renderTab = (tab) => {
30
- // JW: dont understand why we need this line but we do...
31
32
  const visibleToolbarNames = tab.Toolbars.filter((vt) => vt);
32
33
  const customToolbars = props.api.dashboardApi.getCustomToolbars();
33
34
  let visibleDashboardElements = visibleToolbarNames.map((visibleToolbarName) => {
@@ -35,28 +36,20 @@ const DashboardComponent = (props) => {
35
36
  if (customToolbar) {
36
37
  if (dashboardAccessLevel != 'Hidden') {
37
38
  return (React.createElement(rebass_1.Box, { key: customToolbar.name, className: `ab-Dashboard__container ab-Dashboard__container--customToolbar` },
38
- React.createElement(CustomToolbarWrapper_1.CustomToolbarWrapper, { customToolbar: customToolbar, dashboardRevision: props.DashboardRevision })));
39
+ React.createElement(CustomToolbar_1.CustomToolbarWrapper, { customToolbar: customToolbar, dashboardRevision: props.DashboardRevision })));
39
40
  }
40
41
  }
41
42
  else {
42
- let moduleToolbarName = visibleToolbarName;
43
+ const moduleToolbarName = visibleToolbarName;
43
44
  if (props.api.internalApi.getModuleService().isModuleAvailable(moduleToolbarName)) {
44
- let accessLevel = props.api.internalApi
45
- .getEntitlementService()
46
- .getEntitlementAccessLevelForModule(moduleToolbarName);
47
45
  let moduleToolbarView = AdaptableViewFactory_1.AdaptableViewPanelFactory.get(moduleToolbarName);
48
46
  if (moduleToolbarView) {
49
47
  let moduleInfo = props.api.internalApi
50
48
  .getModuleService()
51
49
  .getModuleInfoByModule(moduleToolbarName);
52
- let moduleToolbarElement = React.createElement(moduleToolbarView, {
53
- viewType: 'Toolbar',
54
- api: props.api,
55
- accessLevel,
56
- moduleInfo,
57
- });
58
50
  return (React.createElement(rebass_1.Box, { key: moduleToolbarName, className: `ab-Dashboard__container ab-Dashboard__container--${moduleToolbarName}` },
59
- React.createElement(ModuleToolbarWrapper_1.ModuleToolbarWrapper, { moduleInfo: moduleInfo, accessLevel: dashboardAccessLevel }, moduleToolbarElement)));
51
+ React.createElement(ModuleToolbarWrapper_1.ModuleToolbarWrapper, { moduleInfo: moduleInfo, accessLevel: dashboardAccessLevel },
52
+ React.createElement(DashboardToolbarFactory_1.DashboardToolbarFactory, { toolbarName: moduleToolbarName }))));
60
53
  }
61
54
  else {
62
55
  props.api.logError('Cannot find Dashboard Control for ' + visibleToolbarName);
@@ -106,7 +99,10 @@ const DashboardComponent = (props) => {
106
99
  const shouldRenderQuickSearchHeader = dashboardOptions.showQuickSearchInHeader &&
107
100
  props.api.internalApi.getModuleService().getModuleById(ModuleConstants_1.QuickSearchModuleId).isModuleAvailable();
108
101
  const applicationIcon = props.api.optionsApi.getUserInterfaceOptions().applicationIcon;
109
- return props.DashboardState.IsHidden ? (React.createElement("div", null)) : (React.createElement(Dashboard_1.Dashboard, { title: instanceName, canFloat: props.api.optionsApi.getDashboardOptions().canFloat, activeTabIndex: props.DashboardState.ActiveTabIndex, onActiveTabIndexChange: (ActiveTabIndex) => {
102
+ if (props.DashboardState.IsHidden) {
103
+ return React.createElement("div", null);
104
+ }
105
+ return (React.createElement(Dashboard_1.Dashboard, { title: instanceName, canFloat: props.api.optionsApi.getDashboardOptions().canFloat, footer: React.createElement(PinnedDashboard_1.PinnedDashboard, null), activeTabIndex: props.DashboardState.ActiveTabIndex, onActiveTabIndexChange: (ActiveTabIndex) => {
110
106
  props.onSetActiveTabIndex(ActiveTabIndex);
111
107
  }, collapsed: props.DashboardState.IsCollapsed, onCollapsedChange: (IsCollapsed) => {
112
108
  props.onSetIsCollapsed(IsCollapsed);
@@ -17,7 +17,8 @@ interface DashboardPopupComponentProps extends ModuleViewPopupProps<DashboardPop
17
17
  }
18
18
  export declare enum DashboardConfigView {
19
19
  Toolbars = "Toolbars",
20
- Buttons = "Buttons"
20
+ Buttons = "Buttons",
21
+ PinnedToolbars = "PinnedToolbars"
21
22
  }
22
23
  export interface DashboardPopupState {
23
24
  DashboardConfigView: DashboardConfigView;
@@ -13,10 +13,12 @@ const DashboardManager_1 = tslib_1.__importDefault(require("../../components/Das
13
13
  const ModuleValueSelector_1 = require("../Components/ModuleValueSelector");
14
14
  const CheckBox_1 = require("../../components/CheckBox");
15
15
  const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
16
+ const PinnedToolbarsSelector_1 = require("./PinnedToolbarsSelector");
16
17
  var DashboardConfigView;
17
18
  (function (DashboardConfigView) {
18
19
  DashboardConfigView["Toolbars"] = "Toolbars";
19
20
  DashboardConfigView["Buttons"] = "Buttons";
21
+ DashboardConfigView["PinnedToolbars"] = "PinnedToolbars";
20
22
  })(DashboardConfigView = exports.DashboardConfigView || (exports.DashboardConfigView = {}));
21
23
  class DashboardPopupComponent extends React.Component {
22
24
  constructor(props) {
@@ -26,8 +28,8 @@ class DashboardPopupComponent extends React.Component {
26
28
  };
27
29
  }
28
30
  render() {
29
- const availableToolbars = Types_1.ALL_TOOLBARS;
30
31
  const moduleService = this.props.api.internalApi.getModuleService();
32
+ const availableToolbars = Types_1.ALL_TOOLBARS;
31
33
  const systemToolbars = availableToolbars
32
34
  .filter((at) => this.props.api.internalApi.getModuleService().isModuleAvailable(at))
33
35
  .map((at) => ({
@@ -80,12 +82,14 @@ class DashboardPopupComponent extends React.Component {
80
82
  React.createElement(Panel_1.default, { header: 'Dashboard Contents', style: { borderBottom: '1px solid var(--ab-color-primary)' }, variant: "default", borderRadius: "none", marginTop: 4 },
81
83
  React.createElement(rebass_1.Flex, { className: `${baseClassName}__contents-selector`, flexDirection: "row", padding: 2 },
82
84
  React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Toolbars, checked: this.state.DashboardConfigView == DashboardConfigView.Toolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Toolbars"),
83
- React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Buttons, checked: this.state.DashboardConfigView == DashboardConfigView.Buttons, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Buttons")),
85
+ React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Buttons, checked: this.state.DashboardConfigView == DashboardConfigView.Buttons, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Buttons"),
86
+ React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.PinnedToolbars, checked: this.state.DashboardConfigView == DashboardConfigView.PinnedToolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Pinned Toolbars")),
84
87
  React.createElement(rebass_1.Box, { className: `${baseClassName}__Module-Selector`, "data-name": this.state.DashboardConfigView === DashboardConfigView.Toolbars
85
88
  ? 'toolbars'
86
89
  : 'buttons', style: { minHeight: 0, flex: '1 1 0' }, padding: 2 },
87
90
  this.state.DashboardConfigView == DashboardConfigView.Toolbars && (React.createElement(DashboardManager_1.default, { disabled: isDashboardDisabled, availableToolbars: [...systemToolbars, ...customToolbars], tabs: tabs, onTabsChange: this.props.onDashboardSetTabs, api: this.props.api })),
88
- this.state.DashboardConfigView == DashboardConfigView.Buttons && (React.createElement(ModuleValueSelector_1.ModuleValueSelector, { disabled: isDashboardDisabled, options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button', isOptionDisabled: isModuleCheckboxDisabled, xSelectedLabel: () => `Visible Module Buttons:`, onChange: (selectedValues) => this.props.onDashboardSetModuleButtons(selectedValues) })))))));
91
+ this.state.DashboardConfigView == DashboardConfigView.Buttons && (React.createElement(ModuleValueSelector_1.ModuleValueSelector, { disabled: isDashboardDisabled, options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button', isOptionDisabled: isModuleCheckboxDisabled, xSelectedLabel: () => `Visible Module Buttons:`, onChange: (selectedValues) => this.props.onDashboardSetModuleButtons(selectedValues) })),
92
+ this.state.DashboardConfigView === DashboardConfigView.PinnedToolbars && (React.createElement(PinnedToolbarsSelector_1.PinnedToolbarsSelector, null)))))));
89
93
  }
90
94
  onDashboardConfigViewChanged(event) {
91
95
  let e = event.target;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { AdaptableModule } from '../../types';
3
+ interface DashboardToolbarFactoryProps {
4
+ toolbarName: AdaptableModule | string;
5
+ }
6
+ export declare const DashboardToolbarFactory: React.FunctionComponent<DashboardToolbarFactoryProps>;
7
+ export {};
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DashboardToolbarFactory = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const Types_1 = require("../../PredefinedConfig/Common/Types");
8
+ const AdaptableContext_1 = require("../AdaptableContext");
9
+ const AdaptableViewFactory_1 = require("../AdaptableViewFactory");
10
+ const CustomToolbar_1 = require("./CustomToolbar");
11
+ const SystemDashboardToolbarFactory = (props) => {
12
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
13
+ const moduleInfo = adaptable.api.internalApi
14
+ .getModuleService()
15
+ .getModuleInfoByModule(props.toolbarName);
16
+ const accessLevel = adaptable.api.internalApi
17
+ .getEntitlementService()
18
+ .getEntitlementAccessLevelForModule(props.toolbarName);
19
+ const moduleToolbarView = AdaptableViewFactory_1.AdaptableViewPanelFactory.get(props.toolbarName);
20
+ const moduleToolbarElement = React.createElement(moduleToolbarView, {
21
+ viewType: 'Toolbar',
22
+ api: adaptable.api,
23
+ accessLevel,
24
+ moduleInfo,
25
+ });
26
+ return moduleToolbarElement;
27
+ };
28
+ const CustomDashboardToolbarFactory = (props) => {
29
+ const revision = (0, react_redux_1.useSelector)((state) => state.System.DashboardRevision);
30
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
31
+ const customToolbars = adaptable.api.dashboardApi.getCustomToolbars();
32
+ const customToolbar = customToolbars && customToolbars.find((ct) => ct.name == props.toolbarName);
33
+ if (customToolbar) {
34
+ return React.createElement(CustomToolbar_1.CustomToolbarCmp, { customToolbar: customToolbar, dashboardRevision: revision });
35
+ }
36
+ return React.createElement(React.Fragment, null);
37
+ };
38
+ const DashboardToolbarFactory = (props) => {
39
+ if (Types_1.ALL_MODULES.includes(props.toolbarName)) {
40
+ return React.createElement(SystemDashboardToolbarFactory, { toolbarName: props.toolbarName });
41
+ }
42
+ else {
43
+ return React.createElement(CustomDashboardToolbarFactory, { toolbarName: props.toolbarName });
44
+ }
45
+ };
46
+ exports.DashboardToolbarFactory = DashboardToolbarFactory;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ interface PinnedDashboardProps {
3
+ }
4
+ export declare const PinnedDashboard: React.FunctionComponent<PinnedDashboardProps>;
5
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinnedDashboard = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const rebass_1 = require("rebass");
8
+ const DashboardToolbarFactory_1 = require("./DashboardToolbarFactory");
9
+ const PinnedDashboard = (props) => {
10
+ const dashboardState = (0, react_redux_1.useSelector)((state) => state.Dashboard);
11
+ const pinnedToolbars = dashboardState.PinnedToolbars;
12
+ if (!pinnedToolbars || pinnedToolbars.length == 0) {
13
+ return React.createElement(React.Fragment, null);
14
+ }
15
+ return (React.createElement(rebass_1.Flex, { p: 1, className: "ab-Dashboard__pinned-content" }, pinnedToolbars.map((toolbar, index) => {
16
+ return (React.createElement(rebass_1.Box, { mr: 2, mb: 1, className: `ab-Dashboard__pinned-container ab-Dashboard__pinned-container--${toolbar}` },
17
+ React.createElement(rebass_1.Box, { className: "ab-Dashboard__toolbar-content" },
18
+ React.createElement(DashboardToolbarFactory_1.DashboardToolbarFactory, { key: index, toolbarName: toolbar }))));
19
+ })));
20
+ };
21
+ exports.PinnedDashboard = PinnedDashboard;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ interface PinnedToolbarsSelectorProps {
3
+ }
4
+ export declare const PinnedToolbarsSelector: React.FunctionComponent<PinnedToolbarsSelectorProps>;
5
+ export {};
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinnedToolbarsSelector = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const ModuleManager_1 = require("../../components/DragAndDropContext/ModuleManager");
8
+ const Types_1 = require("../../PredefinedConfig/Common/Types");
9
+ const DashboardRedux_1 = require("../../Redux/ActionsReducers/DashboardRedux");
10
+ const AdaptableContext_1 = require("../AdaptableContext");
11
+ const PinnedToolbarsSelector = (props) => {
12
+ const { api } = (0, AdaptableContext_1.useAdaptable)();
13
+ const dashboardAccessLevel = api.internalApi
14
+ .getEntitlementService()
15
+ .getEntitlementAccessLevelForModule('Dashboard');
16
+ const isDashboardDisabled = dashboardAccessLevel === 'ReadOnly';
17
+ const dashboardState = (0, react_redux_1.useSelector)((state) => state.Dashboard);
18
+ const dispatch = (0, react_redux_1.useDispatch)();
19
+ const pinnedToolbars = dashboardState.PinnedToolbars;
20
+ const moduleService = api.internalApi.getModuleService();
21
+ const toolbars = React.useMemo(() => {
22
+ const availableToolbars = Types_1.ALL_TOOLBARS;
23
+ const systemToolbars = availableToolbars
24
+ .filter((at) => api.internalApi.getModuleService().isModuleAvailable(at))
25
+ .map((at) => ({
26
+ Id: at,
27
+ Title: moduleService.getModuleInfoByModule(at).FriendlyName,
28
+ }));
29
+ const customToolbars = api.dashboardApi.getCustomToolbars().map((ct) => ({
30
+ Id: ct.name,
31
+ Title: ct.title ? ct.title : ct.name,
32
+ }));
33
+ return [...systemToolbars, ...customToolbars];
34
+ }, []);
35
+ const tabs = React.useMemo(() => {
36
+ return [
37
+ {
38
+ Name: 'Pinned Toolbars',
39
+ Items: pinnedToolbars !== null && pinnedToolbars !== void 0 ? pinnedToolbars : [],
40
+ },
41
+ ];
42
+ }, [pinnedToolbars]);
43
+ return (React.createElement(ModuleManager_1.ModuleManager, { permittedActions: {
44
+ createTab: false,
45
+ dragAndDropTab: false,
46
+ deleteTab: false,
47
+ editTabName: false,
48
+ }, onTabsChange: (tabs) => {
49
+ dispatch((0, DashboardRedux_1.DashboardSetPinnedToolbars)(tabs[0].Items));
50
+ }, disabled: isDashboardDisabled, tabs: tabs, availableItems: toolbars, tabsTitle: 'Pinned Toolbars', unusedPanelTitle: "Available Pinned Toolbar Panels", dragItemText: "Drag into the Panel below" }));
51
+ };
52
+ exports.PinnedToolbarsSelector = PinnedToolbarsSelector;
@@ -17,7 +17,7 @@ const DataImportPopup = (props) => {
17
17
  }
18
18
  }, []);
19
19
  return (React.createElement(React.Fragment, null,
20
- React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Data Import', glyphicon: 'import' },
20
+ React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Data Import', glyphicon: 'import', infoLink: props.moduleInfo.HelpPage },
21
21
  React.createElement(rebass_1.Box, null,
22
22
  React.createElement(HelpBlock_1.default, { mb: 2, fontSize: 3 }, "Click the 'Import Data' button to insert or update data into AdapTable"),
23
23
  React.createElement(SimpleButton_1.default, { icon: "import", variant: "raised", onClick: () => setIsWizardOpen(true) }, "Import Data"))),
@@ -1,8 +1,13 @@
1
1
  /// <reference types="react" />
2
- import { DataImportValidationError } from '../../../types';
2
+ import { AdaptableColumn, DataImportValidationError } from '../../../types';
3
3
  export interface ValidationErrorsMap {
4
4
  [key: string]: DataImportValidationError[] | null;
5
5
  }
6
+ export declare type ColumnsMap = {
7
+ field: string;
8
+ abColumn?: AdaptableColumn;
9
+ include?: boolean;
10
+ };
6
11
  export declare const DataImportWizard: (props: {
7
12
  onClose: () => void;
8
13
  }) => JSX.Element;