@adaptabletools/adaptable 12.0.0-canary.6 → 12.0.0

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 (33) hide show
  1. package/bundle.cjs.js +68 -68
  2. package/package.json +2 -2
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
  6. package/src/AdaptableOptions/FinancePluginOptions.d.ts +1 -1
  7. package/src/Api/DataSetApi.d.ts +3 -3
  8. package/src/Api/EventApi.d.ts +9 -9
  9. package/src/Api/Events/DataSetSelected.d.ts +11 -0
  10. package/src/Api/Events/{DataSetChanged.js → DataSetSelected.js} +0 -0
  11. package/src/Api/FilterApi.d.ts +7 -0
  12. package/src/Api/Implementation/DataSetApiImpl.d.ts +1 -1
  13. package/src/Api/Implementation/DataSetApiImpl.js +3 -3
  14. package/src/Api/Implementation/FilterApiImpl.d.ts +8 -0
  15. package/src/Api/Implementation/FilterApiImpl.js +25 -0
  16. package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -0
  17. package/src/Api/Implementation/PredicateApiImpl.js +3 -0
  18. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +4 -0
  19. package/src/Api/Implementation/TeamSharingApiImpl.js +12 -0
  20. package/src/Api/PredicateApi.d.ts +6 -0
  21. package/src/Api/TeamSharingApi.d.ts +15 -0
  22. package/src/Redux/Store/AdaptableStore.js +1 -1
  23. package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
  24. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +2 -1
  25. package/src/View/StatusBar/StatusBarPopup.js +1 -1
  26. package/src/agGrid/Adaptable.js +4 -2
  27. package/src/components/Dashboard/Dashboard.js +2 -1
  28. package/src/metamodel/adaptable.metamodel.d.ts +17 -0
  29. package/src/metamodel/adaptable.metamodel.js +1 -1
  30. package/src/types.d.ts +1 -1
  31. package/version.d.ts +1 -1
  32. package/version.js +1 -1
  33. package/src/Api/Events/DataSetChanged.d.ts +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "12.0.0-canary.6",
3
+ "version": "12.0.0",
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",
@@ -56,6 +56,6 @@
56
56
  "uuid": "^3.3.2"
57
57
  },
58
58
  "peerDependencies": {
59
- "@ag-grid-community/all-modules": ">=27.2.0"
59
+ "@ag-grid-community/all-modules": ">=27.3.0"
60
60
  }
61
61
  }
@@ -1,2 +1,2 @@
1
- declare const _default: 1655383572755;
1
+ declare const _default: 1655715935913;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1655383572755;
3
+ exports.default = 1655715935913;
@@ -29,6 +29,9 @@ export declare type AngularFrameworkComponent<T = unknown> = {
29
29
  export declare type ReactFrameworkComponent = ({ adaptableApi, }: {
30
30
  adaptableApi: AdaptableApi;
31
31
  }) => ReactElement;
32
+ /**
33
+ * Context provided for any custom rendering
34
+ */
32
35
  export interface CustomRenderContext {
33
36
  visible: boolean;
34
37
  element: HTMLDivElement;
@@ -86,7 +86,7 @@ export interface FDC3Column {
86
86
  /**
87
87
  * Returns a custom icon to display in the Raise Intent Context Menu Item;
88
88
  */
89
- getIconForIntent?: (intent: FDC3Intent | CustomFDC3Intent) => AdaptableIcon;
89
+ intentIcon?: (intent: FDC3Intent | CustomFDC3Intent) => AdaptableIcon;
90
90
  }
91
91
  /**
92
92
  * A Column which will be defined as an FDC3 Instrument
@@ -33,8 +33,8 @@ export interface DataSetApi {
33
33
  */
34
34
  showDataSetPopup(): void;
35
35
  /**
36
- * Fire the DataSet Changed Event
37
- * @param dataSet Data Set which has changed
36
+ * Fires the DataSet Selected Event
37
+ * @param dataSet Data Set which has been selected
38
38
  */
39
- fireDataSetChangeEvent(dataSet: DataSet): void;
39
+ fireDataSetSelectedEvent(dataSet: DataSet): void;
40
40
  }
@@ -15,7 +15,7 @@ import { FlashingCellDisplayedInfo } from './Events/FlashingCellDisplayed';
15
15
  import { GridDataChangedInfo } from './Events/GridDataChanged';
16
16
  import { TeamSharingEntityChangedInfo } from './Events/TeamSharingEntityChanged';
17
17
  import { ActionRowSubmittedInfo } from './Events/ActionRowSubmitted';
18
- import { DataSetChangedInfo } from './Events/DataSetChanged';
18
+ import { DataSetSelectedInfo } from './Events/DataSetSelected';
19
19
  /**
20
20
  * Responsible for publishing the many Events that AdapTable fires
21
21
  */
@@ -209,18 +209,18 @@ export interface EventApi {
209
209
  */
210
210
  off(eventName: 'ActionRowSubmitted', callback: (actionRowSubmittedInfo: ActionRowSubmittedInfo) => void): void;
211
211
  /**
212
- * Event fired when a DataSet is changed
212
+ * Event fired when a DataSet is Selected
213
213
  *
214
- * @param eventName DataSetChanged
215
- * @param callback DataSetChangedInfo
214
+ * @param eventName DataSetSelected
215
+ * @param callback DataSetSelectedInfo
216
216
  */
217
- on(eventName: 'DataSetChanged', callback: (dataSetChangedInfo: DataSetChangedInfo) => void): () => void;
217
+ on(eventName: 'DataSetSelected', callback: (dataSetSelectedInfo: DataSetSelectedInfo) => void): () => void;
218
218
  /**
219
- * Unsubscribe from DataSetChanged
220
- * @param eventName DataSetChanged
219
+ * Unsubscribe from DataSetSelected
220
+ * @param eventName DataSetSelected
221
221
  * @param callback
222
222
  */
223
- off(eventName: 'DataSetChanged', callback: (dataSetChangedInfo: DataSetChangedInfo) => void): void;
223
+ off(eventName: 'DataSetSelected', callback: (dataSetSelectedInfo: DataSetSelectedInfo) => void): void;
224
224
  /**
225
225
  * Fired when Adaptable is up and running - has no arguments.
226
226
  * @param eventName - AdaptableReady
@@ -252,6 +252,6 @@ export interface EventApi {
252
252
  emitSync(eventName: 'DashboardChanged', data?: any): any[];
253
253
  emitSync(eventName: 'FlashingCellDisplayed', data?: any): any[];
254
254
  emitSync(eventName: 'AdaptableDestroy'): any[];
255
- emit(eventName: 'AdaptableReady' | 'AlertFired' | 'CheckboxColumnClicked' | 'CustomToolbarConfigured' | 'AdaptableStateChanged' | 'DashboardChanged' | 'CellChanged' | 'GridDataChanged' | 'LayoutChanged' | 'LiveDataChanged' | 'SearchChanged' | 'SelectionChanged' | 'SystemStatusMessageDisplayed' | 'TeamSharingEntityChanged' | 'ThemeChanged' | 'FDC3MessageSent' | 'ActionRowSubmitted' | 'DataSetChanged', data?: any): Promise<any>;
255
+ emit(eventName: 'AdaptableReady' | 'AlertFired' | 'CheckboxColumnClicked' | 'CustomToolbarConfigured' | 'AdaptableStateChanged' | 'DashboardChanged' | 'CellChanged' | 'GridDataChanged' | 'LayoutChanged' | 'LiveDataChanged' | 'SearchChanged' | 'SelectionChanged' | 'SystemStatusMessageDisplayed' | 'TeamSharingEntityChanged' | 'ThemeChanged' | 'FDC3MessageSent' | 'ActionRowSubmitted' | 'DataSetSelected', data?: any): Promise<any>;
256
256
  destroy(): void;
257
257
  }
@@ -0,0 +1,11 @@
1
+ import { DataSet } from '../../types';
2
+ import { BaseEventInfo } from './BaseEventInfo';
3
+ /**
4
+ * Object returned by the `DataSetSelected` event
5
+ */
6
+ export interface DataSetSelectedInfo extends BaseEventInfo {
7
+ /**
8
+ * The DataSet that has been selected
9
+ */
10
+ dataSet: DataSet;
11
+ }
@@ -108,4 +108,11 @@ export interface FilterApi {
108
108
  * @param node Row Node to evaluate
109
109
  */
110
110
  evaluateColumnFilter(columnFilter: ColumnFilter, node: RowNode): boolean;
111
+ /**
112
+ * Checks if a filter is active or applied.
113
+ * It is applied when:
114
+ * - filter predicate does not have inputs
115
+ * - filter predicate has inputs with values
116
+ */
117
+ isFilterActive(columnFilter: ColumnFilter): boolean;
111
118
  }
@@ -8,5 +8,5 @@ export declare class DataSetApiImpl extends ApiBase implements DataSetApi {
8
8
  setDataSet(dataSetName: string): void;
9
9
  clearCurrentDataSet(): void;
10
10
  showDataSetPopup(): void;
11
- fireDataSetChangeEvent(dataSet: DataSet): void;
11
+ fireDataSetSelectedEvent(dataSet: DataSet): void;
12
12
  }
@@ -29,13 +29,13 @@ class DataSetApiImpl extends ApiBase_1.ApiBase {
29
29
  showDataSetPopup() {
30
30
  this.showModulePopup(ModuleConstants.DataSetModuleId);
31
31
  }
32
- fireDataSetChangeEvent(dataSet) {
32
+ fireDataSetSelectedEvent(dataSet) {
33
33
  if (this.adaptable.isInitialised) {
34
- const dataSetChangedInfo = {
34
+ const dataSetSelectedInfo = {
35
35
  adaptableApi: this.adaptable.api,
36
36
  dataSet,
37
37
  };
38
- this.adaptable.api.eventApi.emit('DataSetChanged', dataSetChangedInfo);
38
+ this.adaptable.api.eventApi.emit('DataSetSelected', dataSetSelectedInfo);
39
39
  }
40
40
  }
41
41
  }
@@ -28,4 +28,12 @@ export declare class FilterApiImpl extends ApiBase implements FilterApi {
28
28
  columnFiltersToString(columnFilters: ColumnFilter[]): string;
29
29
  evaluateColumnFilter(columnFilter: ColumnFilter, node: RowNode): boolean;
30
30
  private getColumnFilterById;
31
+ /**
32
+ * Checks if a filter is applied. It is applied when:
33
+ * - has no inputs
34
+ * - has inputs and inputs have values
35
+ *
36
+ * @param filter
37
+ */
38
+ isFilterActive(filter: ColumnFilter): boolean;
31
39
  }
@@ -7,6 +7,7 @@ const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/La
7
7
  const ApiBase_1 = require("./ApiBase");
8
8
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
9
9
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
10
+ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
10
11
  class FilterApiImpl extends ApiBase_1.ApiBase {
11
12
  getAllSystemFilterIds() {
12
13
  return this.getFilterOptions().systemFilters;
@@ -179,5 +180,29 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
179
180
  var _a;
180
181
  return (_a = this.getColumnFilters()) === null || _a === void 0 ? void 0 : _a.find((columnFilter) => columnFilter.Uuid === id);
181
182
  }
183
+ /**
184
+ * Checks if a filter is applied. It is applied when:
185
+ * - has no inputs
186
+ * - has inputs and inputs have values
187
+ *
188
+ * @param filter
189
+ */
190
+ isFilterActive(filter) {
191
+ const predicateDef = this.adaptable.api.predicateApi.getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
192
+ if (ArrayExtensions_1.default.IsNull(predicateDef.inputs) &&
193
+ // values predicates have no inputs in the definition
194
+ !this.adaptable.api.predicateApi.hasPredicateValues(filter.Predicate)) {
195
+ return true;
196
+ }
197
+ const inputs = filter.Predicate.Inputs;
198
+ if (ArrayExtensions_1.default.IsEmpty(inputs)) {
199
+ return false;
200
+ }
201
+ // all values in the array need to be non-empty (e.g. between has two values, [min, max])
202
+ const allInputsHaveValues = inputs.every((value) => {
203
+ return value !== undefined && value !== null && value !== '';
204
+ });
205
+ return allInputsHaveValues;
206
+ }
182
207
  }
183
208
  exports.FilterApiImpl = FilterApiImpl;
@@ -14,4 +14,5 @@ export declare class PredicateApiImpl extends ApiBase implements PredicateApi {
14
14
  isValidPredicate(predicate: AdaptablePredicate | undefined): boolean;
15
15
  handlePredicate(predicate: AdaptablePredicate | undefined, params: Omit<PredicateDefHandlerParams, 'api' | 'inputs'>, defaultReturn: boolean): boolean;
16
16
  getEqualityPredicateForDataType(dataType: AdaptableColumnDataType): SystemFilterPredicateId;
17
+ hasPredicateValues(predicate: AdaptablePredicate): boolean;
17
18
  }
@@ -96,5 +96,8 @@ class PredicateApiImpl extends ApiBase_1.ApiBase {
96
96
  }
97
97
  return predicateId;
98
98
  }
99
+ hasPredicateValues(predicate) {
100
+ return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
101
+ }
99
102
  }
100
103
  exports.PredicateApiImpl = PredicateApiImpl;
@@ -12,4 +12,8 @@ export declare class TeamSharingApiImpl extends ApiBase implements TeamSharingAp
12
12
  fireTeamSharingEntityChangedEvent(sharedEntity: SharedEntity): void;
13
13
  shareEntity(entity: AdaptableObject, module: AdaptableModule, sharedEntityConfig: SharedEntityConfig): void;
14
14
  unshareEntity(entityId: string): void;
15
+ importSharedEntry(sharedEntity: SharedEntity): void;
16
+ private getTeamSharingState;
17
+ getLoadedSharedEntities(): SharedEntity[];
18
+ triggerLoadingTeamSharingEntries(): void;
15
19
  }
@@ -69,5 +69,17 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
69
69
  }
70
70
  this.dispatchAction(TeamSharingRedux.TeamSharingRemoveItem(entityId));
71
71
  }
72
+ importSharedEntry(sharedEntity) {
73
+ this.adaptable.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingImportItem(sharedEntity));
74
+ }
75
+ getTeamSharingState() {
76
+ return this.getAdaptableState().TeamSharing;
77
+ }
78
+ getLoadedSharedEntities() {
79
+ return this.getTeamSharingState().SharedEntities;
80
+ }
81
+ triggerLoadingTeamSharingEntries() {
82
+ this.adaptable.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingGet());
83
+ }
72
84
  }
73
85
  exports.TeamSharingApiImpl = TeamSharingApiImpl;
@@ -59,4 +59,10 @@ export interface PredicateApi {
59
59
  * @param dataType DataType of Column
60
60
  */
61
61
  getEqualityPredicateForDataType(dataType: AdaptableColumnDataType): SystemFilterPredicateId;
62
+ /**
63
+ * Returns true if the predicate has a dropdown.
64
+ *
65
+ * @param predicate
66
+ */
67
+ hasPredicateValues(predicate: AdaptablePredicate): boolean;
62
68
  }
@@ -54,4 +54,19 @@ export interface TeamSharingApi {
54
54
  * @param entityId the ID of the AdaptableObject to be removed from Team Share
55
55
  */
56
56
  unshareEntity(entityId: string): void;
57
+ /**
58
+ * Import shared entry.
59
+ *
60
+ * @param sharedEntity shared entry to import
61
+ */
62
+ importSharedEntry(sharedEntity: SharedEntity): void;
63
+ /**
64
+ * Retrieves already loaded shared entries.
65
+ */
66
+ getLoadedSharedEntities(): SharedEntity[];
67
+ /**
68
+ * Trigger loading of shared entries.
69
+ * By default shared entries are loaded when the Team Sharing popup is visible.
70
+ */
71
+ triggerLoadingTeamSharingEntries(): void;
57
72
  }
@@ -729,7 +729,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
729
729
  case SystemRedux.SYSTEM_DATA_SET_SELECT: {
730
730
  let returnAction = next(action);
731
731
  const dataSet = adaptable.api.dataSetApi.getCurrentDataSet();
732
- adaptable.api.dataSetApi.fireDataSetChangeEvent(dataSet);
732
+ adaptable.api.dataSetApi.fireDataSetSelectedEvent(dataSet);
733
733
  requestAnimationFrame(() => {
734
734
  if (dataSet.form) {
735
735
  middlewareAPI.dispatch(PopupRedux_1.PopupShowForm({
@@ -325,7 +325,7 @@ class QuickFilterFormComponent extends React.Component {
325
325
  this.props.api.filterApi.clearColumnFilterByColumn(filter.ColumnId);
326
326
  }
327
327
  hasValuesPredicate(predicate) {
328
- return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
328
+ return this.props.api.predicateApi.hasPredicateValues(predicate);
329
329
  }
330
330
  }
331
331
  function mapStateToProps(state, ownProps) {
@@ -113,6 +113,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
113
113
  },
114
114
  layoutOptions: {
115
115
  createDefaultLayout: false,
116
+ autoSizeColumnsInLayout: true,
116
117
  },
117
118
  actionOptions: actionOptions,
118
119
  predefinedConfig: {
@@ -287,7 +288,7 @@ const getColumnHeaderLabel = (columnId, mainAdaptableInstance) => {
287
288
  return headerMap.get(columnId);
288
289
  };
289
290
  const getChangeTriggerLabel = (changeInfo) => {
290
- return changeInfo.trigger === 'tick' ? 'Ticking data' : 'User edit';
291
+ return changeInfo.trigger === 'tick' ? 'Ticking' : 'User Edit';
291
292
  };
292
293
  const filterChangeHistoryLog = (changeObject, filterValues) => {
293
294
  const result = {};
@@ -39,6 +39,6 @@ const StatusBarPopup = (props) => {
39
39
  dragAndDropTab: false,
40
40
  deleteTab: false,
41
41
  editTabName: false,
42
- }, onTabsChange: handleTabChange, disabled: disabled, tabs: tabs, availableItems: availableItems, tabsTitle: 'Status Bar Panels', unusedPanelTitle: "Available Status Panels", dragItemText: "Drag into a Status Bar Panel below" })) : (React.createElement(EmptyContent_1.default, null, "To enable this feature add to Grid Options statusPanels the Adaptable Status Panel."))));
42
+ }, onTabsChange: handleTabChange, disabled: disabled, tabs: tabs, availableItems: availableItems, tabsTitle: 'AdapTable Status Bar Panels', unusedPanelTitle: "Available Module Status Panels", dragItemText: "Drag into a Status Bar Panel below" })) : (React.createElement(EmptyContent_1.default, null, "To enable this feature add to Grid Options statusPanels the Adaptable Status Panel."))));
43
43
  };
44
44
  exports.StatusBarPopup = StatusBarPopup;
@@ -2935,12 +2935,14 @@ class Adaptable {
2935
2935
  this.prepareGrid();
2936
2936
  }
2937
2937
  updateColumnFilterActiveState() {
2938
+ var _a;
2938
2939
  const columnFilters = this.api.filterApi.getColumnFilters();
2939
- const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
2940
+ const activeFilters = (_a = columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.filter) === null || _a === void 0 ? void 0 : _a.call(columnFilters, (columnFilter) => this.api.filterApi.isFilterActive(columnFilter));
2941
+ const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(activeFilters);
2940
2942
  const columnsWithActiveFilters = {};
2941
2943
  if (isFilterActive) {
2942
2944
  // used in particular at init time to show the filter icon correctly
2943
- for (const colFilter of columnFilters) {
2945
+ for (const colFilter of activeFilters) {
2944
2946
  const agGridCol = this.gridOptions.columnApi.getColumn(colFilter.ColumnId);
2945
2947
  if (agGridCol) {
2946
2948
  columnsWithActiveFilters[agGridCol.getColId()] = true;
@@ -43,7 +43,7 @@ function Dashboard(props) {
43
43
  } }, child.props.title)))));
44
44
  const renderTabsDropdown = () => {
45
45
  var _a, _b, _c;
46
- if (children && children.length === 0) {
46
+ if (children && children.length < 2) {
47
47
  return null;
48
48
  }
49
49
  const activeTabTitle = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[activeTabIndex]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'Select Toolbar';
@@ -72,6 +72,7 @@ function Dashboard(props) {
72
72
  const renderHomeToolbar = () => (React.createElement(DashboardToolbar_1.DashboardToolbar, { onConfigure: onShowDashboardPopup, className: "ab-Dashboard__home-toolbar", title: title, tooltip: `Configure Dashboard`, showConfigure: true, showClose: false, accessLevel: 'Full' },
73
73
  left,
74
74
  right,
75
+ children && children.length > 1,
75
76
  renderTabsDropdown()));
76
77
  return (React.createElement("div", {
77
78
  // @ts-ignore
@@ -1755,6 +1755,11 @@ export declare const ADAPTABLE_METAMODEL: {
1755
1755
  kind: string;
1756
1756
  description: string;
1757
1757
  };
1758
+ CustomRenderContext: {
1759
+ name: string;
1760
+ kind: string;
1761
+ description: string;
1762
+ };
1758
1763
  CustomReport: {
1759
1764
  name: string;
1760
1765
  kind: string;
@@ -2134,6 +2139,18 @@ export declare const ADAPTABLE_METAMODEL: {
2134
2139
  reference: string;
2135
2140
  }[];
2136
2141
  };
2142
+ DataSetSelectedInfo: {
2143
+ name: string;
2144
+ kind: string;
2145
+ description: string;
2146
+ properties: {
2147
+ name: string;
2148
+ kind: string;
2149
+ description: string;
2150
+ uiLabel: string;
2151
+ reference: string;
2152
+ }[];
2153
+ };
2137
2154
  DataUpdateConfig: {
2138
2155
  name: string;
2139
2156
  kind: string;